4.2. Bridging Wireless to Wired
Problem
How do you integrate your wired and wireless clients so that they share an Internet connection and LAN services all in one big happy subnet? You know that when you have multiple Ethernet interfaces on the same box they cannot all be on the same subnet, but must all have addresses from separate subnets. You want everyone all in a single subnet, and don't want a lot of administration headaches, so how will you do this?
Solution
Your routerboard needs at least three network interfaces: your Atheros interface, plus two Ethernet interfaces. ath0 is your wireless interface, eth0 is the LAN interface, and eth1 is your WAN interface.
What we will do is build an Ethernet bridge between ath0 and
eth0. Copy this example
/etc/network/interfaces, substituting your own
LAN addresses and your own ESSID. Remember to run /sbin/rw first to make the Pyramid
filesystem writable:
pyramid:~# /sbin/rwpyramid:~# nano /etc/network/interfaces##/etc/network/interfaces ## wireless bridge configuration auto lo iface lo inet loopback auto br0 iface br0 inet static address 192.168.1.50 network 192.168.1.0 netmask 255.255.255.0 broadcast 192.168.1.255 bridge_ports ath0 eth0 post-down wlanconfig ath0 destroy pre-up wlanconfig ath0 create wlandev wifi0 wlanmode ap pre-up iwconfig ath0 essid "alrac-net" channel 01 rate auto pre-up ifconfig ath0 up pre-up sleep 3
You can test this now by networking with some LAN hosts that have static IP addresses. First restart networking on the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access