OpenWrt Forum Archive

Topic: vlan trunking with Cisco IOS and openwrt?

The content of this topic has been archived on 24 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Is it possible, and is there an example configuration anywhere, of VLAN trunking with a Cisco IOS based switch? I have KAMIKAZE (7.07) running on a Linksys WRT54GL v1.1 (BCM5352 rev0).

I have three VLAN's (100/200/300) on my Cisco 3750 and I'd like to configure one port on it as a trunk to my Openwrt  -I don't use the WAN interface on the Openwrt, so that'd be a handy trunk port for me?

A quick initial look seems like I might need the following on my IOS switch for the designated trunk interface:

switchport mode trunk
switchport nonegotiate
switchport trunk encapsulation dot1q
switchport trunk allowed vlan add 100
switchport trunk allowed vlan add 300

Anything else? Do I need to set the default vlan (switchport access vlan X) and the native vlan (switchport trunk native vlan X)?

What about the Openwrt side? It looks like the webif only allows vlans 0-9, and not anything greater? Is that a web interface limitation or must my VLAN number really be in that range? Can I just edit /etc/config/network, something like this:

#### VLAN configuration
config switch eth0
        option vlan0    "0 1 5*"
        option vlan100   '3 4 5*'
        option vlan300   '2 4 5*'

Would this make Port 4 (WAN?) able to trunk vlan100 and 300, and port 3 as a member of just vlan100, and port 2 as a member of vlan 300?

Any help appreciated.

(Last edited by fihzy on 8 Dec 2007, 15:51)

Well a couple of hours of experimenting (and learning how to use the failsafe mode) and I finally figured it out myself. I renumbered my VLANs; it seemed required at the time but now I see that probably wasn't necessary. I also turned off the firewall S45 script. Again I don't know if that was strictly necessary but I don't need the firewall anyway.  My IOS switch has an interface configured to trunk vlan 7 & 9 to the WAN port on the WRT54GL. The 54G then has port 4 configured to tag for vlan 7/8/9, ports 1,2,3 configured for vlan 7, and port 0 configured for vlan 9. It appears to work well. If anyone can spot any potential issues please let me know. Do I need to do anything about MTU?

Hope this helps someone.

Here are my configurations:

IOS:

interface FastEthernet1/0/7
description Trunk to WRT54GL
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 7,9
switchport mode trunk
switchport nonegotiate
!

54GL:

config switch eth0
        option vlan0    '5*'
        option vlan1    '5*'
        option vlan2    '5*'
        option vlan3    '5*'
        option vlan4    '5*'
        option vlan5    '5*'
        option vlan6    '5*'
        option vlan7    '1 2 3 4t 5*'
        option vlan8    '4t 5*'
        option vlan9    '0 4t 5*'


#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0


#### LAN configuration
config interface lan
        option type     bridge
        option ifname   "eth0.7"
        option proto    static
        option ipaddr   '192.168.0.3'
        option netmask  255.255.255.0
        option dns      '192.168.0.1'
        option gateway  '192.168.0.1'


#### WAN configuration
config interface        wan
        option ifname   "eth0.8"
        option proto    'none'

The discussion might have continued from here.