OLD STUFF - but useful for some background reading
This page describes the Network configuration of DebWRT after setting Debian to use the /etc/network/interfaces.lan-wlan-bridge by creating a symlink:
ln -snf /etc/network/interfaces.lan-wlan-bridge /etc/network/interfaces
Afer setting the symlink and rebooting the router ( or starting the correct /etc/init.d scripts in the correct order ;-) ) the router will be configured like OpenWRT’s default network config. A WAN interface, which uses DHCP to get it’s IP information. And the LAN and WLAN bridged together. To start the WLAN and bridging add the following symlinks
ln -snf /etc/init.d/hostapd /etc/rc0.d/K20hostapd ln -snf /etc/init.d/hostapd /etc/rc1.d/K20hostapd ln -snf /etc/init.d/hostapd /etc/rc2.d/S20hostapd ln -snf /etc/init.d/hostapd /etc/rc3.d/S20hostapd ln -snf /etc/init.d/hostapd /etc/rc4.d/S20hostapd ln -snf /etc/init.d/hostapd /etc/rc5.d/S20hostapd ln -snf /etc/init.d/hostapd /etc/rc6.d/K20hostapd ln -snf /etc/init.d/robocfg /etc/rcS.d/S38robocfg
At my device i did get an error bridging wlan0 and eth0_lan to lanbridge I had to do the following:
mv /etc/rcS.d/S40networking /etc/rcS.d/S42networking ln -snf /etc/init.d/hostapd /etc/rcS.d/S41hostapd
By default hostapd is enabled in /etc/default/hostapd Also here is the confif file for hostapd mentioned: etc/hostapd/hostapd-nokey.conf This is were you can change your WLAN config
The WLAN by default will be setup with ESSID Angel using WPA1/WPA2. A minimal firewall is installed which also does masquarading for LAN/WLAN traffic.
Resulting into the following IP/routing/wireless setup:
IP 192.168.1.1 Netmask 255.255.255.0 Gateway received from WAN DHCP WiFi ESSID Angel WiFi WPA1/WPA2 passphrase debwrtdebwrt Firewall No firewall Masquarading LAN/WLAN traffic to the Internet(WAN)
Basicaly configuring the network should not be more then setting the symlink to the correct Debian network config file and reboot. That’s it!
For people who want to know more about the networking setup, keep reading. The following figure shows the DebWRT network configuration. Read below for detailed explenation. I used the same figure style as is used by OpenWRT on their network interfaces wiki page.
Programmable switch (et0)
The ASUS WL-500’s are equiped with a programmable switch. On the back of the router, there are 5 – 100 Mbit/s Full Duplex – ethernet RJ45 sockets. These are all connected to the programmable switch et0. This switch can be configured using the robocfg command line tool. By default the RJ45 socket with the WAN(Port 0) description are tagged as vlan100 by the switch hardware. And LAN ports 1 t/m 4 are tagged as vlan101. Tagging of ethernet packets received by the switch happens by adding a VLAN-ID to each ethernet frame transmitted on whatever port. See http://en.wikipedia.org/wiki/802.1Q for more information on VLAN’s.
After the tagging all packets from whatever port received are copied to the kernel (via switch internal hardware port 5) and received on eth0. Remember, packets received by eth0, are containing ethernet frames with 802.1Q VLAN-ID set. Using the VLAN support in the kernel, the kernel now knows how to separate the packets on this VLAN-ID and virtuale routes the packets to vlan eth0_wan (VLAN-ID 100) and to vlan etho_lan(VLAN-ID 101).
When the kernel needs to transmit packets to the WAN or LAN, it will add the 802.1Q VLAN-ID to the ethernet frame. When packets are transmitted over eth0_wan, VLAN-ID 100 is added, when transmitted to eth0_lan, VLAN-ID 101 is added. The programmable switch receives all the packets and based on the VLAN-ID it knows to which RJ-45 ethernet port to sent the packet. (Note: based on the MAC address table, the switch knows on which LAN port it needs to transmit the packet).
Init scripts and configuration files involved
- /etc/init.d/robocfg Integrated switch & VLAN configuration
- /etc/init.d/ebtables not configured yet!
- /etc/init.d/hostapd 2.6 WEP/WPA/wireless deamon
- /etc/init.d/dnsmasq DNS-server for LAN/WAN - enable it in /etc/default
- /etc/network/interfaces* Debian networking – 3 example setup’s
- interfaces.firstboot All switch ports in one VLAN, IP 192.168.1.1, WLAN disabled
- interfaces.lan-wlan-bridge LAN/WLAN bridge, WAN DHCP, LAN/WLAN bridge masqueraded over WAN
- interfaces.seperate-wlan-lan WAN, LAN, WLAN in separate VLAN’s
- /etc/hostapd hostapd config
Available Network Interfaces
- eth0 no IP all incoming packets from the switch (normaly with VLAN-ID)
- eth0_wan DHCP vlan interface – VLAN-ID 100
- eth0_lan no IP vlan interface – VLAN-ID 101
- wlan0 no IP Wireless interface when using kernel 2.6 (b43 driver)
- mon.wlan0 no IP Wireless interface when using kernel 2.6 (b43 driver) – not directly used
- wmaster0 no IP Wireless interface when using kernel 2.6 (b43 driver) – not directly used
- lanbridge 192.168.1.1 bridge interface – eth0_lan and wl0 or wlan0 are bridged