OpenWrt Forum Archive

Topic: dot1q trunk and wrt54g

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

Hi all,

I have a WRT54G running OpenWRT distro. I have the ports 1-4 in 3 vlans and I would like to configure port 0 (Wan interface) to transport 2 of them to a switch using dot1q trunk. Is it possible to do it? If yes do you have any idea how can be done?

Thank you,
Iulian

dapyx wrote:

I have a WRT54G running OpenWRT distro. I have the ports 1-4 in 3 vlans and I would like to configure port 0 (Wan interface) to transport 2 of them to a switch using dot1q trunk. Is it possible to do it? If yes do you have any idea how can be done?

Sure, just use robocfg to config the wan port (usually port 0) to tag the vlans. On your remote switch set the ports for the appropriate vlans. What I haven't figured out yet is how to get them QOS tagged, but I can do that at the next device so probably won't worry about it.

- DL

Hmmm it seems I am doing something wrong. This is the setup I use. Any idea what am I doing wrong?

The script I used to create VLANs:
--- cut here ---
/sbin/robocfg switch disable
/sbin/robocfg vlans enable reset
/sbin/robocfg vlan 0 ports "1 5t"
/sbin/robocfg vlan 7 ports "0t 2 3 5t"
/sbin/robocfg vlan 8 ports "0t 4 5t"
/sbin/robocfg switch enable

/sbin/ifconfig eth0 0.0.0.0 up
/sbin/vconfig add eth0 0
/sbin/vconfig add eth0 7
/sbin/vconfig add eth0 8
/sbin/ifconfig vlan0 hw ether 00:01:11:11:11:00
/sbin/ifconfig vlan7 hw ether 00:01:11:11:11:07
/sbin/ifconfig vlan8 hw ether 00:01:11:11:11:08
--- and here ---

And the output of robocfg show and ifconfig:
--- cut here ---
root@OpenWrt:~# robocfg show
Switch: enabled
Port 0(W): 100FD enabled stp: none vlan: 6 mac: 00:00:00:00:00:00
Port 1(4):  DOWN enabled stp: none vlan: 0 mac: 00:00:00:00:00:00
Port 2(3):  DOWN enabled stp: none vlan: 7 mac: 00:00:00:00:00:00
Port 3(2):  DOWN enabled stp: none vlan: 7 mac: 00:00:00:00:00:00
Port 4(1):  DOWN enabled stp: none vlan: 8 mac: 00:00:00:00:00:00
Port 5(C): 100FD enabled stp: none vlan: 0 mac: 00:00:00:00:00:00
VLANs: BCM5325/535x enabled mac_check mac_hash
vlan0: 1 5t
vlan7: 0t 2 3 5t
vlan8: 0t 4 5t

root@OpenWrt:~# ifconfig -a
br0       Link encap:Ethernet  HWaddr 00:14:BF:36:25:EA
          inet addr:192.168.10.11  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:68 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5484 (5.3 KiB)  TX bytes:7725 (7.5 KiB)

eth0      Link encap:Ethernet  HWaddr 00:14:BF:36:25:EA
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:5 Base address:0x2000

eth1      Link encap:Ethernet  HWaddr 00:14:BF:36:25:EA
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:67 errors:0 dropped:0 overruns:0 frame:462
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6416 (6.2 KiB)  TX bytes:8039 (7.8 KiB)
          Interrupt:4 Base address:0x1000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

vlan0     Link encap:Ethernet  HWaddr 00:01:11:11:11:00
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

vlan7     Link encap:Ethernet  HWaddr 00:01:11:11:11:07
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

vlan8     Link encap:Ethernet  HWaddr 00:01:11:11:11:08
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
--- and here ---

That all looks fine. Are you ifup'ing the vlans after configuring them, although I believe the traffic should pass strictly on the switch without this.

- DL

(Last edited by dl on 28 Sep 2005, 19:10)

The traffic passes through the switch even if I don't configure the vlan interface with an IP (it's enough to run ifconfig vlanX up).

Using tcpdump I found out that the packets from the ports 2/3/4 (vlans 7 and 8) are directed to the WAN port but there are no vlan tags. Probably the Broadcom chip uses vlans only internally and is unable to use .1q trunk on an ethernet port. I'll dig into this to find more. BTW: is there a Linux distro for ARM based routers (eg: BEFSR81).


Thanks,
Iulian

dapyx wrote:

Probably the Broadcom chip uses vlans only internally and is unable to use .1q trunk on an ethernet port.

I'm doing this fine on linksys v3 hw. Packets are properly tagged.

- DL

Do you, by any chance, have a sample config?

My setup is a little different than yours in that I'm trunking the wireless and lan on different vlans out the wan, and my lan is on the default (untagged) vlan. But in any case your config looks similar to mine except I've broken br0 and created a new bridge from eth1 (wifi) to wan because of my requirements.

I just tried a quick test changing one of my lan ports to a different vlan and it appears to not be tagging the packets. I'm fairly certain this -can- be done as I think I did it as part of my "head bashing" a couple weeks ago. There are a couple possibilities here. One is that the packets are being routed in which case the vlan tags would be lost (or wrong). I'd experiment a bit trying to get the cpu out of the loop and try (a) breaking the bridge or (b) trunking over a lan port rather than the wan port. I don't have time now but will experiment a bit more this evening.

ps another possibility (maybe the best) might be to create a bridge between each vlan and wan, similar to what I did for the wifi.

- DL

(Last edited by dl on 28 Sep 2005, 23:39)

The discussion might have continued from here.