WAN tagging for GL-B1300 (ipq40xx)

I need to apply a VLAN tag to the WAN interface and I cannot figure out how to make it work for this router. My config is below and it is not working. The same approach works fine for R7800. I must be missing something for gl-b1300. Any advice?

config interface 'wan'
	option ifname 'eth1.35'
	option ipv6 '0'
	option peerdns '0'
	option dns '9.9.9.9'
	option holdoff '5'
	option persist '1'
	option proto 'pppoe'
	option username 'XXXXXXXXXXXXX'
	option password 'XXXXXXXXXXXXX'
	option keepalive '2 5'

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

config switch_vlan
	option device 'switch0'
	option vlan '3'
	option vid '3'
	option ports '3 0t'

config switch_vlan
	option device 'switch0'
	option vlan '4'
	option vid '4'
	option ports '4 0t'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '5t 0t'
	option vid 35

I spent ages figuring this one out.
As far as I can see, the b1300 switch driver is hard coded by default as unmanaged switch
To configure the switch as manageable we must not use vlan/vid 1 and 2 as they are hard coded.
It functions as a 4 port switch and a single ethernet port.

Ports 1 and 2 do not have ethernet sockets.
With the sockets facing you:

  • port 3 is the leftmost (nearest the usb, marked as lan)
  • port 4 is the middle (marked as lan)
  • unswitched ethernet is on the right (marked as wan)

A working switch configuration would be:

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

config switch_vlan 'ethport3'
	option device 'switch0'
	option vlan '103'
	option vid '103'
	option ports '0t 3'

config switch_vlan 'ethport4'
	option device 'switch0'
	option vlan '104'
	option vid '104'
	option ports '0t 4'

giving:

  • eth0=cpu
  • eth0.103=3rd port from right with ports towards you
  • eth0.104=2nd port from right with ports towards you
  • eth1="wan" port

So you cannot apply a vlan tag to the port marked as "wan" but you can on either of the other two. Make port 3 your actual "wan" port.

Thank you. I did not realize the WAN port is unmanaged. I have made eth1 into LAN, the middle port remained an IoT network, and the most left one is now WAN.

Interestingly enough, this router is topping up at ~300Mbps with one core at 100% CPU: LAN to WAN (PPPoE with VLAN tagging). I was expecting to get more from it.

Here is the config for anyone interested:

config interface 'wan'
	option ifname 'eth0.35'
	option ipv6 '0'
	option peerdns '0'
	option holdoff '5'
	option persist '1'
	option proto 'pppoe'
	option username 'XXXXXXXXXX'
	option password 'XXXXXXXXXX'
	option keepalive '2 5'

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

config switch_vlan
	option device 'switch0'
	option vlan '3'
	option vid '35'
	option ports '3t 0t'

config switch_vlan
	option device 'switch0'
	option vlan '4'
	option vid '4'
	option ports '4 0t'

What version of OpenWrt are you running?
I just tested a large file transfer gigabit ethernet wan to lan and it averaged ~750Mb/s with average less than 5% on any cpu looking at htop. I am on current Snapshot. How are you measuring your bits per second?

19.07-SNAPSHOT & I am using fast.com and connected wired to router.

Yes, I get that with DHCP and no VLAN tagging. Once PPPoE is added with VLAN, I seem to get half of that.

Try development snapshot. The 19.07-snapshot was frozen 7 months ago and there have been many changes since ....
https://downloads.openwrt.org/snapshots/targets/ipq40xx/generic/openwrt-ipq40xx-generic-glinet_gl-b1300-squashfs-sysupgrade.bin

If your 300Mb/s is downlink from the Internet, I am envious :wink:
I'm in the Highlands of Scotland with 4Mb/s and impatiently waiting for a few more Starlink launches!

Thx, maybe later. This is my experimental/backup router and it can already get close to the line limit, so no rush for me. My R7800 is using ~50..60% of each core; there seems to be some room left there.

Well, it is a very recent development here as well.

Thx for your advice on WAN tagging. Saved me a lot of grief.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.