Wireless Point-To-Point Bridge
Photos courtesy Rick Nash
Currently, I’m setting this up on a Soekris 4511-30 board, with a 128MB CF flash card. The system is using HostAP drivers for the prism2 NL-2511 MP Plus 802.11b miniPCI card.
There are two phases I’m going to go through: Manual creation, and Automatic creation.
- Create a local bridge (br0) on each AP of wlan0 and eth0.
- Successfully bridge each AP together using WDS (Wireless Distribution System)Network1: eth0 <-> wlan0 = br0 <—–> br0 = wlan0 <-> eth0 :Network2(eth0 on each AP is connected to a network, in turn, they get bridged together once both APs have been bridged)
PHASE 1: MANUAL
Step 1: Local Bridge Creation
# brctl addbr br0
# brctl addif br0 eth0
# brctl addif br0
# brctl addif wlan0
I have now created a bridge (br0) device and added eth0 interface to it along with (wlan0) interface. Now, I’m ready to move on.
To create the AP to AP bridge, I’ll need both MAC address of the radio cards, and then I can issue a command that will tell wlan0 to only allow the other AP’s wlan0 interface access via it’s MAC address.
# iwpriv wlan0 wds_add 00:02:6F:37:FB:DA
# brctl addif br0 wlan0wds0
I have now added the MAC address of the other AP radio card to it’s list of APs. Being this is a point-to-point AP bridge, I’ll only add one. I’ve also added the newly created wlan0wds0 interface to my bridge (br0). Now, I can tell it I only want one WDS point.
# iwpriv wlan0 max_wds 1
(NOTE: I have done this on both APs at this point)
Now, I need to assign the interfaces IPs.
# ifconfig eth0 0.0.0.0
# ifconfig wlan0 0.0.0.0
# ifconfig wlan0wds0 0.0.0.0
# ifconfig br0 10.0.0.100 netmask 255.255.255.0 broadcast 0 up
# route add default gw 10.0.0.1
I have only assigned the bridge interface (br0) an IP of 10.0.0.100. On the second AP, I have assigned br0 an IP of 10.0.0.200. Also, the up portion of the last command there tells the interface to come “up”, e.g., start-up now.
At this point, I am able to now ping 10.0.0.200 from 10.0.0.100, e.g., AP1 to AP2!
PHASE 2: AUTOMATIC
Phew, that was fun. Now, I don’t want to have to do that everytime the AP is turned off then back on! So, what I am going to do is add a start-up script. I have done it this way, via /etc/rcS.d/, instead of /etc/network/interfaces because I had some issues MYSELF. You DON’T have to do it this way if you know what you’re doing — but I don’t. =PI created a file called S99network.
#!/bin/sh echo "MAC FILTERING: 00:02:6F:37:FB:DF" iwpriv wlan0 wds_add 00:02:6F:37:FB:DF echo "Creating bridge..." brctl addbr br0 echo "Adding eth0 to bridge" brctl addif br0 eth0 echo "Adding wlan0 to bridge" brctl addif br0 wlan0 echo "Adding wlan0wds0 to bridge" brctl addif br0 wlan0wds0 echo "Configuring eth0 IP: 0.0.0.0" ifconfig eth0 0.0.0.0 echo "Configuring wlan0 IP: 0.0.0.0" ifconfig wlan0 0.0.0.0 echo "Configuring wlan0wds0 IP: 0.0.0.0" ifconfig wlan0wds0 0.0.0.0 echo "Bringing bridge UP" ifconfig br0 220.127.116.11 netmask 255.255.255.192 broadcast 18.104.22.168 up ifdown eth0 ifdown wlan0 ifup eth0 ifup wlan0 ifup br0 sleep 20
I now have a script that will automatically configure my interfaces for me so I don’t have to manually do it.
The last step for me is to edit my /etc/resolv.conf to reflect my nameservers, and that’s it!
Tue Apr 8 22:35:48 EDT 2008