AP-mode Howto
From Rt2x00Wiki
This is a short guide to setting up AP-mode on rt2x00 chips. Note that this will not work with Ralink's USB chips because we don't know how to get status messages (ACK/FAIL) for sent packets.
This howto is not aimed for beginners.
Contents |
Installing needed software
First install the stuff you need (may be incomplete, package names are from a debian/ubuntu based system)
- build-essentials git libnl-dev libssl-dev dhcp3-server
Hostapd
Hostapd is a userspace daemon that handles the configuration, association etc for WLAN Access Points.
Get the latest version of hostapd
- git clone git://w1.fi/srv/git/hostap.git
- cd hostap/hostapd
- cp defconfig .config
- edit .config to CONFIG_DRIVER_NL80211=y and CFLAGS += -I#WHERE YOUR KERNEL HEADERS ARE#
- make
Check that a hostapd binary was created in that directory. It will be used in the final step.
edit hostapd.conf
- change the ssid to something more fun :)
- set country_code to match your contry
- change hw_mode=g
- set channel to something more suitable
For wpa you also need to change some wpa settings. Here are some examples of settings to change/uncomment:
* wpa=2 * wpa_passphrase=somepassword * wpa_pairwise=TKIP CCMP
Configure dhcpd to hand out ip addresses
edit /etc/dhcp3/dhcpd.conf to hand out suitable ip addresses. For testing you can for example find the part which corresponds to the one below and uncomment three of the lines.
subnet 10.254.239.0 netmask 255.255.255.224 {
range 10.254.239.10 10.254.239.20;
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
}
Final steps
- disable wireless in network manager
- assign wlan0 an ip address: ifconfig wlan0 10.254.239.1
- run /etc/init.d/dhcp3-server restart
- start hostapd: ./hostapd -dd hostapd.conf
Note, this will not get your clients (machines connecting to your AP) a connection to the internet. After these steps the ap should be visible, clients should be able to connect to it and once connected clients can ping your AP and ssh in to it. Routing the traffic from the AP to eth0 is not configured by the steps above. Feel free to add it if you want.
