Changes between Version 1 and Version 2 of BridgedNetwork


Ignore:
Timestamp:
Feb 6, 2011, 7:11:22 PM (9 years ago)
Author:
stappers
Comment:

Lay-out formatted

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
     1This page describes the Network configuration of DebWRT after setting Debian to use the /etc/network/interfaces.lan-wlan-bridge by creating a symlink:
     2{{{
     3ln -snf /etc/network/interfaces.lan-wlan-bridge /etc/network/interfaces
     4}}}
    25
    36Afer 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.
    47
    58Resulting into the following IP/routing/wireless setup:
     9{{{
    610IP      10.0.2.1
    711Netmask         255.255.2550
     
    1014WiFi WPA1/WPA2 passphrase       angelangel
    1115Firewall        Minimal firewall Masquarading LAN/WLAN traffic to the Internet(WAN)
     16}}}
    1217
    1318Basicaly configuring the network should not be more then setting the symlink to the correct Debian network config file and reboot. That’s it!
    1419
    1520For 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-config
    1721
    18 DebWRT Network Config (click to enlarge)
     22[[Image(debwrt-network-config.png)]]
    1923
    20 Programmable switch (et0)
     24= Programmable switch (et0) =
    2125The 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.
    2226
    23 Receiving packets
     27= Receiving packets =
    2428After 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).
    2529
    26 Trasmiting packets
     30= Trasmiting packets =
    2731When 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).
    2832
    29 Init scripts and configuration files involved
    30 tc/init.d/robocfg       Integrated switch & VLAN configuration
    31 /etc/init.d/firewall    basic firewall with masquarading
    32 /etc/init.d/nas         2.4 WEP/WPA deamon
    33 /etc/init.d/hostapd-mini        2.6 WEP/WPA/wireless deamon
    34 /etc/init.d/dnsmasq     DNS-server for LAN/WAN
    35 /etc/network/interfaces*        Debian networking – 3 example setup’s
    36 interfaces.firstboot    All switch ports in one VLAN, IP 10.0.2.1, WLAN disabled
    37 interfaces.lan-wlan-bridge      LAN/WLAN bridge, WAN DHCP, LAN/WLAN bridge masqueraded over WAN
    38 interfaces.seperate-wlan-lan    WAN, LAN, WLAN in separate VLAN’s
    39 /etc/nas        NAS config
    40 /etc/hostapd-mini       hostapd-mini config
     33= 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
    4145
    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 100
    45 eth0_lan        no IP   vlan interface – VLAN-ID 101
    46 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 used
    49 wmaster0        no IP   Wireless interface when using kernel 2.6 (b43 driver) – not directly used
    50 lanbridge       10.0.2.1        bridge interface – eth0_lan and wl0 or wlan0 are bridged
     46= 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