Reconfigure VLANs for 802.1q Compatibility
From DD-WRT Wiki
Contents |
[edit] Introduction
VLAN trunking allows you to connect VLAN's across multiple devices without having to use a cable for each VLAN. For instance, if you had VLAN 1 and VLAN 3 on two different devices then you can create a trunk port on both devices to tag the Ethernet frames with an 802.1q header. Then devices in VLAN 1 on router 1 can communicate with devices in VLAN 1 on router 2 and devices in VLAN 3 on router 1 can communicate with devices in VLAN 3 on router 2.
Broadcom's 100mbit switches use VLAN 0 as the default LAN VLAN but 802.1q specifies that a tag of "0" means that the frame doesn't belong to any VLAN. This is the reason Broadcom's gigabit switches use VLAN 1 for their LAN and you should avoid using VLAN 0 in a 802.1q trunk to be compatible with others devices. This guide will explain how to reconfigure a device with a Broadcom 100mbit switch to use VLAN 1 for the LAN ports and VLAN 2 for the WAN port to lay the foundation for further configuration of 802.1q tagged ports.
[edit] Configuration
[edit] Reassign the WAN Port
Note: If you have a BCM4704 based device which have a separate internal interface for the WAN port (eth1 instead of vlan1) then you can skip this section.
- Open the Web Interface in a web browser.
- Navigate to the Setup -> VLAN page and move the WAN port (W) to VLAN 2.
- Press the Apply button and wait one minute before continuing.
- Navigate to the Setup -> Networking page and change the WAN Port Assignment from 'vlan1' to 'vlan2'. If there is no 'vlan2' in the list then reboot the router and try again.
- Press the Apply button.
[edit] Reassign the LAN Ports
- Navigate to the Setup -> VLAN page and move each of the LAN ports (1-4) from VLAN 0 to VLAN 1.
- Change the Assigned To Bridge setting for VLAN 0 to 'none' to remove it from the LAN bridge (br0).
- Change the Assigned To Bridge setting for VLAN 1 to 'LAN' to add it to the LAN bridge (br0).
- Press the Apply button and wait one minute before continuing.
- Navigate to the Setup -> Networking page and verify that the vlan1 interface is assigned to the br0 bridge.
[edit] Finishing Up
Before you go running off thinking that your configuration is fine, reboot the router to ensure that the settings all persist through a reboot. The DD-WRT firmware has some 'sanity checks' to restore VLAN settings to their default values when they are configured certain ways.
In my experience, DD-WRT will revert the WAN Port Assignment on some hardware. I've worked around this problem by navigating to the Administration -> Commands page and saving the script below to the Startup Script.
nvram set wan_ifname=vlan2 startservice wan
[edit] References
- VLAN Support - List of devices tested for VLAN support.
- Enabling VLAN Support for BCM4704 - Explains how to enable VLAN support on BCM4704 based devices.
- Switched Ports - Explains how to configure VLAN's using NVRAM variables.