OpenWRT and Cisco Trunking - Trunking Page 3

Article Index

 

After these are configured, head back to ‘/etc/config/network’ to configure the switch ports for the VLANS. There should already be the first section ‘config switch’ below. Look at the ‘name’ of the switch (option name). In the example below, it is switch0, but it could differ. Use it in the ‘option device’ line of the vlans. Additionally, the switch port and port lines below don’t always match up, so test each one and use a sharpie to mark the port number on the router itself. For example, Port 1 on the router may be port 3 in the ‘option ports’ line below.

If I want to make vlan5 on port 3, vlan6, on port 2, vlan7 on port 1, and have a trunk port on port 4, I'll use the following configuration:

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'switch0'
option vlan '5'
option ports '0t 3 4t'

config switch_vlan
option device 'switch0'
option vlan '6'
option ports '0t 2 4t'

config switch_vlan
option device 'switch0'
option vlan '7'
option ports '0t 1 4t'


## If, for some reason, you need a Native VLAN added, you can add the following section.
## If VLAN 1 is the Native VLAN ID
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0t 4t'

Once you plug in the Cisco switch’s trunk port, you’ll see the logs bring up the vlans and ports. Plug a device into the Cisco switch port and it will grab the appropriate IP address from the OpenWRT/Gargoyle Router

Enjoy…