Changes between Version 1 and Version 2 of BridgedNetwork
- Timestamp:
- Feb 6, 2011, 7:11:22 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BridgedNetwork
v1 v2 1 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 1 This page describes the Network configuration of DebWRT after setting Debian to use the /etc/network/interfaces.lan-wlan-bridge by creating a symlink: 2 {{{ 3 ln -snf /etc/network/interfaces.lan-wlan-bridge /etc/network/interfaces 4 }}} 2 5 3 6 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. 4 7 5 8 Resulting into the following IP/routing/wireless setup: 9 {{{ 6 10 IP 10.0.2.1 7 11 Netmask 255.255.2550 … … 10 14 WiFi WPA1/WPA2 passphrase angelangel 11 15 Firewall Minimal firewall Masquarading LAN/WLAN traffic to the Internet(WAN) 16 }}} 12 17 13 18 Basicaly configuring the network should not be more then setting the symlink to the correct Debian network config file and reboot. That’s it! 14 19 15 20 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. 16 debwrt-network-config17 21 18 DebWRT Network Config (click to enlarge) 22 [[Image(debwrt-network-config.png)]] 19 23 20 Programmable switch (et0) 24 = Programmable switch (et0) = 21 25 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. 22 26 23 Receiving packets 27 = Receiving packets = 24 28 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). 25 29 26 Trasmiting packets 30 = Trasmiting packets = 27 31 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). 28 32 29 Init scripts and configuration files involved 30 tc/init.d/robocfg Integrated switch & VLAN configuration31 /etc/init.d/firewall basic firewall with masquarading32 /etc/init.d/nas 2.4 WEP/WPA deamon33 /etc/init.d/hostapd-mini 2.6 WEP/WPA/wireless deamon34 /etc/init.d/dnsmasq DNS-server for LAN/WAN35 /etc/network/interfaces* Debian networking – 3 example setup’s36 interfaces.firstboot All switch ports in one VLAN, IP 10.0.2.1, WLAN disabled37 interfaces.lan-wlan-bridge LAN/WLAN bridge, WAN DHCP, LAN/WLAN bridge masqueraded over WAN38 interfaces.seperate-wlan-lan WAN, LAN, WLAN in separate VLAN’s39 /etc/nas NAS config40 /etc/hostapd-mini hostapd-mini config33 = Init scripts and configuration files involved = 34 * /etc/init.d/robocfg Integrated switch & VLAN configuration 35 * /etc/init.d/firewall basic firewall with masquarading 36 * /etc/init.d/nas 2.4 WEP/WPA deamon 37 * /etc/init.d/hostapd-mini 2.6 WEP/WPA/wireless deamon 38 * /etc/init.d/dnsmasq DNS-server for LAN/WAN 39 * /etc/network/interfaces* Debian networking – 3 example setup’s 40 * interfaces.firstboot All switch ports in one VLAN, IP 10.0.2.1, WLAN disabled 41 * interfaces.lan-wlan-bridge LAN/WLAN bridge, WAN DHCP, LAN/WLAN bridge masqueraded over WAN 42 * interfaces.seperate-wlan-lan WAN, LAN, WLAN in separate VLAN’s 43 * /etc/nas NAS config 44 * /etc/hostapd-mini hostapd-mini config 41 45 42 Available Network Interfaces 43 eth0 no IP all incoming packets from the switch (normaly with VLAN-ID)44 eth0_wan DHCP vlan interface – VLAN-ID 10045 eth0_lan no IP vlan interface – VLAN-ID 10146 wl0 no IP Wireless interface when using kernel 2.4 (Broadcom driver)47 wlan0 no IP Wireless interface when using kernel 2.6 (b43 driver)48 mon.wlan0 no IP Wireless interface when using kernel 2.6 (b43 driver) – not directly used49 wmaster0 no IP Wireless interface when using kernel 2.6 (b43 driver) – not directly used50 lanbridge 10.0.2.1 bridge interface – eth0_lan and wl0 or wlan0 are bridged46 = Available Network Interfaces = 47 * eth0 no IP all incoming packets from the switch (normaly with VLAN-ID) 48 * eth0_wan DHCP vlan interface – VLAN-ID 100 49 * eth0_lan no IP vlan interface – VLAN-ID 101 50 * wl0 no IP Wireless interface when using kernel 2.4 (Broadcom driver) 51 * wlan0 no IP Wireless interface when using kernel 2.6 (b43 driver) 52 * mon.wlan0 no IP Wireless interface when using kernel 2.6 (b43 driver) – not directly used 53 * wmaster0 no IP Wireless interface when using kernel 2.6 (b43 driver) – not directly used 54 * lanbridge 10.0.2.1 bridge interface – eth0_lan and wl0 or wlan0 are bridged