|Version 1 (modified by stappers, 2 years ago) (diff)|
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. 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 10.0.2.1 Netmask 255.255.2550 Gateway received from WAN DHCP WiFi? ESSID Angel WiFi? WPA1/WPA2 passphrase angelangel Firewall Minimal 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. debwrt-network-config
DebWRT Network Config (click to enlarge)
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 tagges 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 IEEE 802.1Q for more information on VLAN’s.
Receiving packets 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).
Trasmiting packets 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 tc/init.d/robocfg Integrated switch & VLAN configuration /etc/init.d/firewall basic firewall with masquarading /etc/init.d/nas 2.4 WEP/WPA deamon /etc/init.d/hostapd-mini 2.6 WEP/WPA/wireless deamon /etc/init.d/dnsmasq DNS-server for LAN/WAN /etc/network/interfaces* Debian networking – 3 example setup’s interfaces.firstboot All switch ports in one VLAN, IP 10.0.2.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/nas NAS config /etc/hostapd-mini hostapd-mini 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 wl0 no IP Wireless interface when using kernel 2.4 (Broadcom driver) 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 10.0.2.1 bridge interface – eth0_lan and wl0 or wlan0 are bridged