I have configured a router using Ubuntu 12.04 server. One ethernet port (eth0) connects to the WAN. There is a second port (eth1) with its own local subnet (192.168.137.1/24). There is a WiFi card (wlan0) on 192.168.138.1/24. I use isc-dhcp-server for DHCP and iptables to provide NAT on eth0. Everything works flawlessly, so there don't appear to be any problems with the WiFi or NIC drivers nor configuration of the drivers, DHCP, or iptables.
The problem is that I would like wlan0 and eth1 to be on the same subnet, as I have a number of devices (wired and wifi) that want to be on the same LAN.
My current /etc/network/interfaces:
Code:
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
post-up iptables-restore < /etc/iptables.up.rules
# The local subnet
auto eth1
iface eth1 inet static
address 192.168.137.1
netmask 255.255.255.0
broadcast 192.168.137.255
network 192.168.137.0
auto wlan0
iface wlan0 inet static
address 192.168.138.1
netmask 255.255.255.0
broadcast 192.168.138.255
network 192.168.138.0
What I tried (/etc/network/interfaces):
Code:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
post-up iptables-restore < /etc/iptables.up.rules
# Bridge between eth1 and wlan0
auto br0
iface br0 inet static
address 192.168.137.1
netmask 255.255.255.0
broadcast 192.168.137.255
network 192.168.137.0
pre-up ip link set eth1 down
pre-up ip link set wlan0 down
pre-up brctl addbr br0
pre-up brctl addif br0 eth1 wlan0
pre-up ip addr flush dev eth1
pre-up ip addr flush dev wlan0
post-down ip link set eth1 down
post-down ip link set wlan0 down
post-down ip link set br0 down
post-down brctl delif br0 eth1 wlan0
post-down brctl delbr br0
On reboot, wlan0 doesn't activate nor show up with
brctl show. I can manually add wlan0 to br0 and bring up wlan0, but nothing routes to or from wlan0.
Anyone know of a good tutorial on this kind of bridging? When I've searched, I've found a lot of "kids! here's how you can share your internet connection" or descriptions of how to bridge two ethernet NICs, but nothing about bridging an ethernet and wifi interface.
Any clues would be welcome.
--twoprops