Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying find out how to make a linux (Fuduntu) netbook with two network interfaces a wireless access point and act as router and share internet connection for a WiFi tablet.

  • one interface is connected to inet, eth0 (wired),
  • other eth1 is WiFi

So the question is some sort of tethering

share|improve this question

2 Answers 2

It is easy to turn an old notebook into a wireless AP. I don't know Fuduntu. I use Debian, therefore the following instructions are Debian centric but can easily be adapted to other distributions as well. What differs are the package names and the location of the configuration files.

Required software

The following packages are needed:

  • hostap
  • wpasupplicant
  • bridge-utils
  • wireless-tools

Configuration

In the following it is assumed that your wireless connection is wlan0 and your wired one eth0, you need to adapt it to your setup.

First you need to set up the bridge. Remove or comment out any entries that set up wlan0 or eth0 in the file /etc/network/interfaces and add the following lines.

Setting up the bridge

auto br0
iface br0 inet dhcp
  bridge_ports eth0 wlan0
  pre-up ifconfig eth0 0.0.0.0 up
  pre-up ifconfig wlan0 0.0.0.0 up
  pre-up brctl addbr br0
  pre-up brctl addif br0 eth0
  post-down ifconfig wlan0 0.0.0.0 down
  post-down ifconfig eth0 0.0.0.0 down
  post-down brctl delif br0 eth0
  post-down brctl delbr br0

Setting up hostapd

Tell the hostapd daemon to use a particular configuration file: Ensure the following line is present in /etc/default/hostapd

DAEMON_CONF=/etc/hostapd/hostapd.conf

Now you can set up your wireless network. Here I just provide an example configuration. The exact values depend on your hardware, which encryption is supported and your environment (e.g. surrounding networks). Open the file /etc/hostapd/hostapd.conf and ensure the following values are set.

interface=wlan0
bridge=br0
driver=nl80211
ssid=MyNetwork
hw_mode=g
channel=9
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=myverysecretpassword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Important here is to select a driver that works with hostapd and your hardware. The SSID is a random string to identify your network. The channel should be picked, so that there is the least interference with the surrounding networks. The passphrase should be at least eight characters long.

For the other options read the provided configuration file. It is heavily commented and almost serves as a manual.

Starting the access point

Now you can bring up the interfaces

/etc/init.d/networking restart

and start the access point

/etc/init.d/hostapd start

Another possible solution

The FreeBSD distribution pfSense is a firewalling and routing platform with AP functionality. Everything can be set up nicely using a GUI. Behind the scenes it also uses hostap, but the configuration is simpler and more user friendly. The drawback of using pfSense is that you should not do your regular computing on the same box, pfSense expects to be running on a dedicated system, although this is not a technical requirement.

share|improve this answer
    
thanks, i will try unless my linux knoweledge is modest –  Yurij73 Jun 15 '12 at 18:05
    
Actually, if you don't like the idea of writing a configuration file for hostapd, the popular NetworkManager tool also supports managing an AP now, but this is not available through its GUI tools; it requires a manual tweak in its configuration file for mode=ap. Reference in Russian: altlinux.org/… –  imz -- Ivan Zakharyaschev Dec 15 '13 at 21:30

If it's for your one and only tablet, an adhoc connection would be enough. You can use iptables to forward the traffic.

For other purposes, check if hostap works with your adapter, then you have a real access point for multiple users (use iptables for forwarding too here).

share|improve this answer
    
the ad hoc connection was the first i tryed. It is very ease in fuduntu (think in ubuntu the same) one click in network manager applet in system tray and "make new wireless..." so i did a adhoc spot. But my tablet as many others android tablet doesnt list ad-hoc spot! It wants only full feathured wifi Acces Point. my old half-wrecked windows mobile device can easily connect adhoc infrastructure and new android cant! Cést la vie. So the question is root out the tablet or make the AP infrastructure. –  Yurij73 Jun 15 '12 at 17:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.