OpenWRT and Cisco Trunking

Article Index

 

How to create a trunk port on an OpenWRT or Gargoyle Router to use with a Cisco switch or other ‘trunking’ device


This may be self explanatory to many people, but I could not find straightforward information on this topic. It may be around and, if so, this post will be for me the next time I need this information.

For example, if you have a Cisco switch configured with multiple vlans and a trunk port running to another trunk port on a Cisco Router, you can remove the Cisco router and use the OpenWRT/Gargoyle Router. If you don’t know why you would want to use the cheaper router, it’s ok. This post is for those that do.

To get this done, you’ll need to edit the following three files:
‘/etc/config/network’
‘/etc/config/dhcp’
‘/etc/config/firewall’

 

First: ‘/etc/config/network’
Create the VLAN IDS that match the same VLAN IDS of the Cisco Switch. You’ll only need to configure the interface as a bridge if you plan on attaching it to a wifi interface.

config interface 'lan'
option ifname 'eth1.5'
option type 'bridge'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.5.1'
option dns '192.168.5.1'

config interface 'vlan6'
option ifname 'eth1.6'
option proto 'static'
option ipaddr '192.168.6.1'
option netmask '255.255.255.0'
option dns '192.168.6.1'

config interface 'vlan7'
option ifname 'eth1.7'
option proto 'static'
option ipaddr '192.168.7.1'
option netmask '255.255.255.0'
option dns '192.168.7.1'