Bridging access point
From FBSD_tips
Here is a very simple way to build a bridge between a wireless card and a wired NIC. In this case neither of them have an IP.
First, allow forwarding by this host by putting gateway_enable="YES" in the file /etc/rc.conf This will set the sysctl net.inet.ip.forwarding=1 on boot, you can also set it now by hand if you don't want to reboot now.
echo gateway_enable=\"YES\" >> /etc/rc.conf
Next set up your bridge group in the kernel. In this case we are bridging ath0 and fxp0.
sysctl net.link.ether.bridge_cfg=fxp0:1,ath0:1
And enable bridging.
sysctl net.link.ether.bridge.enable=1
Optionally you can firewall on the bridge, loading ipfw.ko if it is not yet loaded, enabling firewalling on the bridge and adding rules to suit your specific goals.
kldload ipfw sysctl net.link.ether.bridge.ipfw=1 ipfw add allow all from any to any via fxp0 ipfw add allow all from any to any via ath0
Now put the wireless 'on the air'
ifconfig ath0 mediaopt hostap channel 11 ssid bridge2 up
Now any host that associates with the wireless NIC ath0 will be on the ethernet via fxp0. This does not include any security.
Gongo 06:54, 11 October 2007 (UTC)
