Difference between revisions of "Software access point"

From ArchWiki
Jump to: navigation, search
Line 12: Line 12:
 
=Steps to implement=
 
=Steps to implement=
  
<li>add <pre>
+
the config file of hostapd /etc/hostapd/hostapd.conf will help you to put your wireless device into master mode and willing to accept connection from other computers with encrypted password.
wlan_wlan0="wlan0 mode master essid $YOUR_ESSID channel $CHANNEL"
+
WLAN_INTERFACES=(wlan0)
+
</pre> to /etc/conf.d/wireless  You can also put key $KEY in wlan_wlan0="" to enable WEP. This automates commands to iwconfig.
+
<li>add <pre>
+
bridge_br0="eth0 wlan0"
+
BRIDGE_INTERFACES=(br0)
+
</pre> to /etc/conf.d/bridges, this automated commands to the bridge module and brctl, the equiv would be <pre>brctl addbr br0;brctl addif eth0;brctl addif wlan0</pre>.
+
<li>change the network settings in /etc/rc.conf to<pre>
+
  
lo="lo 127.0.0.1"
+
here is an example from http://www.su-root.eu/computing/turn-your-linux-computer-in-a-wireless-access-point-using-hostapd
eth0="eth0 up"
+
wlan0="wlan0 up"
+
br0="br0 $IP_ADDRESS netmask 255.255.255.0 up"
+
INTERFACES=(lo eth0 wlan0 br0)
+
</pre>
+
<li>run <pre>/etc/rc.d/network restart</pre> as root, or just reboot.
+
</ol>
+
  
<br>This setup works for me to play Mario Kart DS through Nintendo's Wi-Fi Connection. br0 should be given the same settings in /etc/rc.conf eth0 had before. This works for me on kernel 2.6.13-ARCH, hostap-driver-0.4.7, wireless-tools version 28, and a Linksys WMP11 v4 wireless card. Any 802.11b device should be able to connect to this setup, as long as it supports manual ESSID and IP configuration. dhcpd should handle IPs as if it's in charge of a wired LAN, My DS would not automatically detect the ESSID, and I am not aware of a way to activate broadcasting ESSID. It connected just fine when told the ESSID to connect to. WPA seems to be supported by hostap, source files are on the same site as it.  I didn't attempt to configure that, as I didn't need it.  YMMV, RTFM, have fun.
+
<BR>
 +
interface=wlan0<BR>
 +
bridge=br0<BR>
 +
driver=nl80211<BR>
 +
logger_stdout=-1<BR>
 +
logger_stdout_level=2<BR>
 +
ssid=test<BR>
 +
hw_mode=g<BR>
 +
auth_algs=3<BR>
 +
max_num_sta=5<BR>
 +
wpa=2<BR>
 +
wpa_passphrase=tryyourbest<BR>
 +
wpa_key_mgmt=WPA-PSK<BR>
 +
wpa_pairwise=TKIP CCMP<BR>
 +
rsn_pairwise=CCMP<BR>
 +
   
 +
<BR>
 +
before hostapd does its job, eth0, wlan0 and br0 must be up and do not have any address. we can put the following lines in /etc/rc.conf
 +
 
 +
<BR>
 +
eth0="eth0 up"<BR>
 +
wlan0="wlan0 up"<BR>
 +
br0="br0 192.168.0.2 netmask 255.255.255.0 up"<BR>
 +
INTERFACES=(lo eth0 wlan0 br0)<BR>
 +
 
 +
<BR>
 +
in the /etc/conf.d/bridge file, uncomment the lines (change eth1 to wlan0)
 +
 
 +
<BR>
 +
bridge_br0="eth0 wlan0"<BR>
 +
BRIDGE_INTERFACES=(br0)<BR>
 +
 
 +
<BR>
 +
we are ready to go, just reboot the machine and use another computer to see if you can find the "test" wireless connection.
 +
<BR>
 +
 
 +
*untested* if your computer stops at the sign of "waiting for IP address" etc, that may be it can not find a dhcp server. so you need to set up one.
 +
 
 +
<BR>
  
 
*UPDATE* The hostap-driver in pacman works, too.  Thanks Xentac!
 
*UPDATE* The hostap-driver in pacman works, too.  Thanks Xentac!
Line 38: Line 61:
  
 
* Update (2010-12-17) : updated packages requirement
 
* Update (2010-12-17) : updated packages requirement
 +
 +
* Update (2010-12-22) : updated config files for rc.conf, hostapd.conf and bridge.

Revision as of 06:54, 22 December 2010

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Software access point#)

A software access point is used when you want your computer to act as an access point for the local wireless network. It saves you the trouble of getting a separate wireless router.

Things you need

You will need:
  • prism2/2.5/3 pure pci wireless card or nl80211 compatible cards (e.g. ath9k)
  • wireless-tools, hostapd and bridge-utils from pacman

Steps to implement

the config file of hostapd /etc/hostapd/hostapd.conf will help you to put your wireless device into master mode and willing to accept connection from other computers with encrypted password.

here is an example from http://www.su-root.eu/computing/turn-your-linux-computer-in-a-wireless-access-point-using-hostapd


interface=wlan0
bridge=br0
driver=nl80211
logger_stdout=-1
logger_stdout_level=2
ssid=test
hw_mode=g
auth_algs=3
max_num_sta=5
wpa=2
wpa_passphrase=tryyourbest
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP


before hostapd does its job, eth0, wlan0 and br0 must be up and do not have any address. we can put the following lines in /etc/rc.conf


eth0="eth0 up"
wlan0="wlan0 up"
br0="br0 192.168.0.2 netmask 255.255.255.0 up"
INTERFACES=(lo eth0 wlan0 br0)


in the /etc/conf.d/bridge file, uncomment the lines (change eth1 to wlan0)


bridge_br0="eth0 wlan0"
BRIDGE_INTERFACES=(br0)


we are ready to go, just reboot the machine and use another computer to see if you can find the "test" wireless connection.

  • untested* if your computer stops at the sign of "waiting for IP address" etc, that may be it can not find a dhcp server. so you need to set up one.


  • UPDATE* The hostap-driver in pacman works, too. Thanks Xentac!
  • ANOTHER UPDATE* Hostap-driver is in the 2.6.15 kernel. Also, DCHP requests are passed to the wired connection through wireless, so dhcpd is not needed for this.
  • Update (2010-12-17) : updated packages requirement
  • Update (2010-12-22) : updated config files for rc.conf, hostapd.conf and bridge.