I want to serve wireless clients with two different networks -- an authenticated network (using WPA2-EAP) with unrestricted access to my local network, and an unauthenticated network (using WPA2-PSK) with heavily restricted access. Neither wireless network will be bridged to the wired LAN. Yes, this setup suggests that I am paranoid. The meat of this howto will be in setting up the physical networks; you can use them however you like, with whatever authentication and encryption systems you see fit, to meet whatever needs you may have. Moreover, the setup is extensible, allowing more wireless networks to be added easily. There are some hardware restrictions on the number of AP's a single WRT can serve; see the Kamikaze configuration page on the wiki for more details.
1. Set up virtual networks
This is the part that looks the most like voodoo. OpenWRT doesn't like to set up the virtual wireless networks without a physical network to bind them to, but we don't want to bridge our wireless and wired networks. Hence, we create some special vlans to serve our purposes.
/etc/config/network:
#### VLAN configuration
config switch eth0
option vlan0 "0 1 2 3 5*"
option vlan1 "5"
option vlan2 "5"
option vlan4 "4 5"
#### Loopback configuration
config interface loopback
option ifname "lo"
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
#### Wired LAN configuration
config interface wired
option type "bridge"
option ifname "eth0.0"
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0
option gateway 192.168.1.1
option dns 192.168.1.1
#### Wireless LAN configuration
config interface wlsec
option type "bridge"
option ifname "eth0.1"
option proto static
option ipaddr 192.168.2.1
option netmask 255.255.255.0
option gateway 192.168.2.1
option dns 192.168.2.1
config interface wlunsec
option type "bridge"
option ifname "eth0.2"
option proto static
option ipaddr 192.168.3.1
option netmask 255.255.255.0
option gateway 192.168.3.1
option dns 192.168.3.1
#### WAN configuration
config interface wan
option type "bridge"
option ifname "eth0.4"
option proto dhcp
Note that I've set up all four interfaces as bridges. This isn't necessary in the cases of 'wired' and 'wan', but it gives us some consistency in our nomenclature, which makes everything easier to keep track of. The two wireless interfaces must be configured as bridges for the magic to work.
However, this bridging means that all the networks will have new names; the WAN will be 'br-wan', the wired LAN will be 'br-wired', and so forth.
2. Set up the wireless interfaces
Now we just need to configure these wireless interfaces. This actually works exactly the way you'd expect, but I'll include a configuration example for clarity's sake:
/etc/config/wireless:
config wifi-device wl0
option type broadcom
option channel 11
config wifi-iface
option device wl0
option network wlsec
option mode 'ap'
option ssid 'openwrt-eap'
option encryption 'wpa2'
option key 'youreapsharedsecret'
option server '127.0.0.1'
option port '1812'
config wifi-iface
option device wl0
option network wlunsec
option mode 'ap'
option ssid 'openwrt-psk2'
option encryption 'psk2'
option key 'yourwpa2psk'
As you might guess, this will provide a WPA2-EAP-secured network with SSID 'openwrt-eap' and a WPA2-PSK-secured network with SSID 'openwrt-psk2'. (Hint: don't try to use this configuration verbatim unless you have a FreeRADIUS server set up already and know how to operate it.)
You can use the rest of the /etc/config files to configure these networks just as you normally would.
Don't forget to set up routing on your new networks.
To add more wireless networks, just add a new vlan and a new stanza each in /etc/config/network and /etc/config/wireless corresponding to the ones outlined above.
(Last edited by existentialhero on 16 Sep 2007, 07:15)