Make Host AP a Layer 2 Bridge
Make a simple Ethernet bridge with Host AP and one other network interface.
So far, we have seen how to set up your Host AP machine as a routed or NAT’d network appliance. But what if you want to bridge directly to your Ethernet network or another wireless card?
Bridging is very straightforward to implement. You need a copy of the bridge utilities from http://bridge.sourceforge.net/, as well as a kernel with 802.1d Ethernet bridging enabled. The basic procedure for configuring a bridge is to remove any existing IP configuration on the devices you want to bridge, then create a logical bridge device with the interfaces you want to bridge together. Finally, you configure an IP address and routes for the logical bridge device, so you can still use the network from the bridge device itself (as well as access any services provided by the bridge device from the rest of the network).
Suppose we want to bridge a Prism card running Host AP (wlan0) with the first Ethernet device (eth0). Try this, preferably from the console:
pebble:~#ifconfig eth0 0.0.0.0pebble:~#ifconfig wlan0 0.0.0.0pebble:~#brctl addbr br0pebble:~#brctl addif br0 eth0pebble:~#brctl addif br0 wlan0pebble:~#ifconfig br0 10.15.6.2pebble:~#route add default gw 10.15.6.1
When you first create the bridge device, it takes a moment or two for the bridge to “learn” the layout of your network. It can take several seconds for traffic to begin to pass through the bridge when first brought up, ...