How to setup a wireless access point
From Alpine Linux
Do not follow instructions here until this notice is removed. |
Contents |
Install needed packages
apk add hostapd wireless-tools wpa_supplicant
Check that card is detected
Cat /proc/net/dev and see which cards are detected. If no cards are available, check what driver the card uses and modprobe it. Check that the card is in master mode.
Setup Bridge
It should be merged with How to configure a network bridge. See also the discussion of bonding, vlans, and bridges on http://lists.alpinelinux.org/alpine-devel between 9 Mar and 23 Mar 2012 (Discuss) |
apk add bridge-utils
vi /etc/network/interfaces
auto br0 iface br0 inet static pre-up brctl addbr br0 pre-up echo 0 > /proc/sys/net/bridge/bridge-nf-call-arptables pre-up echo 0 > /proc/sys/net/bridge/bridge-nf-call-iptables pre-up echo 0 > /proc/sys/net/bridge/bridge-nf-call-ip6tables address 192.168.0.253 netmask 255.255.255.0 gateway 192.168.0.254 post-down brctl delbr br0 auto eth0 iface eth0 inet manual up ip link set $IFACE up up brctl addif br0 $IFACE down brctl delif br0 $IFACE || true down ip link set $IFACE down auto eth1 iface eth1 inet manual up ip link set $IFACE up up brctl addif br0 $IFACE down brctl delif br0 $IFACE || true down ip link set $IFACE down ...
That way you create br0 with: ifup br0, and you can add/remove individual interfaces to the bridge with ifup eth0, ifdown eth0.
Setup Encryption
Edit /etc/hostapd/hostapd.wpa_psk and insert the following, replacing PASSPHRASE with the WPA_PSK key you would like to use (remove keys that you don't want to use):
00:00:00:00:00:00 PASSPHRASE
Setup hostapd
Edit /etc/hostapd/hostapd.conf and replace entries that need to be such as interface, bridge, driver, ssid, etc. Example file below:
interface=wlan0 bridge=br0 driver=hostap logger_syslog=-1 logger_syslog_level=2 logger_stdout=-1 logger_stdout_level=2 debug=0 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 ssid=SecureSSID #macaddr_acl=1 #accept_mac_file=/etc/hostapd/accept auth_algs=3 eapol_key_index_workaround=0 eap_server=0 wpa=3 wpa_psk_file=/etc/hostapd/hostapd.wpa_psk wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP
If you wish to use MAC address filtering, uncomment the lines starting with macaddr_acl and accept_mac_file, create /etc/hostapd/accept (with 600 permissions) and add the allowed clients' MAC address to the file.
Start hostapd.
/etc/init.d/hostapd start
Associate clients
Associate a few different clients to test.