VLAN tagging on ipq40xx (GL-B1300) no longer works

It was all working just until a few days ago in 19.07 with the switch configuration below, but now I can not connect to any LAN port with the latest build. There is this commit which might have something to do with this, but I do not know how that would have impacted things. Does anyone have any suggestions?

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'

Your device does not automagically flash newer firmware images. Are you building your own 19.07 images, or did you get a recent image somewhere else? If so, you might be using an image including that commit. If not, there's no way you have that code in your firmware. It's a commit from July 14th. OpenWrt hasn't released anything past 19.07.3 AFAIK and that was on May 20th. So that would mean there's something in your configuration that changed.

I spin up my own images periodically, so I do have that commit. I just downloaded that latest image openwrt-19.07-snapshot-r11144-2ca5a386ee-ipq40xx-generic-glinet_gl-b1300-squashfs-sysupgrade, flashed it via the recovery interface, and it booted fine. I changed the switch config, updated the LAN interface as per below, rebooted the router, and no LAN client can get an IP address any more.

uci set network.lan.ifname='eth0.3 eth0.4'
uci commit network

That's important information which you shouldn't leave out :slightly_smiling_face:. First thing I'd try would be a build with that single commit reverted. If that works, then you know where the issue is. The commit fixes other things than what's breaking here, and VLANs have always been iffy on ipq40xx AFAIK. You can ping blogic once you narrowed it down, maybe he can help (he authored the commit).

If you don't mind giving it a shot I got linked a potential fix for the VLAN issues on ipq40xx by someone on IRC, you can find the code on Github:

I have been meaning to test this myself on my EA6350 v3, but haven't had time yet. I'm sure the author would be happy to hear if it fixes it for you.

That fix is 16 days old while the commit I referenced is newer. Why would the older commit fix this issue?

It works without the commit I referenced.

@blogic can you comment on my VLAN issues? Until a few days ago, my gl-b1300 was working fine with VLAN tagging. To eliminate my config, I downloaded the latest gl-b1300 sysupgrade file from openwrt.org, uploaded the file via the recovery UI, and made the changes below. Once the router is rebooted, no LAN client could obtain an IP address. I built the firmware without the file target/linux/ipq40xx/patches-4.14/716-essedma-vlan-double-tag.patch that you recently authored, and everything is working again. Has the VLAN configuration changed?

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'

uci set network.lan.ifname='eth0.3 eth0.4'
uci commit network

I've faced the same issue, but in my case I do use a patched VLAN code to expose the real "topology". I've done an announcement here:

Can you, please, kindly test if this patch solves you problem too?

1 Like

Indeed, he did what I've done in my repo, but since the switch broke, I gave myself the task of purging the ESS EDMA driver from the default VLAN code, in my latest commit that goes along with the fix of the problem that @fantom-x is facing (at least is a fix for my device in my use case, more testing needed). It works both with the purged driver and with the blogic patch (the patch in master, not the one you linked in your post since I don't own that device), and also with the patched VLAN :wink:

1 Like

Thx, but cannot use your patch, because it is against master. I will have to wait until the issue is fixed in 19.07.

The ipq40xx ethernet vlan double tagging patch from July 14 in the latest snapshot may have fixed something else, but I too can report it has broken the vlan I have assigned to physical port 4 of my EA6350 AP to segregate my Ooma VOIP box from the home lan. A wireless interface using the same VLAN on this router works, but not the physical port. Oh well - such are the risks of flashing the latest snapshot. I'll be dropping back to 19.07.3 stable. I've added my switch configuration below for reference.

Edit: Plugging the Ooma into physical port 3 (assigned to the default lan interface) and power cycling got the Ooma back on the internet. I think I'll find trusting the Ooma on my home lan easier than flashing 19.07.3 to get the vlan back on port 4 for now.

config switch                                                                   
        option name 'switch0'                                                   
        option reset '1'                                                        
        option enable_vlan '1'                                                  
                                                                                
config switch_vlan                                                              
        option device 'switch0'                                                 
        option vlan '1'                                                         
        option ports '1 2 3 0'                                                  
                                                                                
config switch_vlan                                                              
        option device 'switch0'                                                 
        option vlan '3'                                                         
        option ports '0t 1t'                                                    
        option vid '10'                                                         
                                                                                
config switch_vlan                                                              
        option device 'switch0'                                                 
        option vlan '4'                                                         
        option ports '0t 1t'                                                    
        option vid '20'                                                         
                                                                                
config switch_vlan                                                              
        option device 'switch0'                                                 
        option vlan '5'                                                         
        option ports '0t 1t 4'                                                  
        option vid '30'                                                         
                                                                                
config switch_vlan                                                              
        option device 'switch0'                                                 
        option vlan '6'                                                         
        option ports '0t 1t'                                                    
        option vid '40'                                                         
                                                                                
config interface 'GST'                                                          
        option proto 'dhcp'                                                     
        option ifname 'eth0.20'                                                 
        option type 'bridge'                                                    
                                                                                
config interface 'IOT'                                                          
        option proto 'dhcp'                                                     
        option ifname 'eth0.30'                                                 
        option type 'bridge'                                                    

Add port 5 to the config.

I am using this config to bridge port 4 to wan.

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

What is port 5? Is it possible to make my config work? I just need to isolate my two LAN ports.

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

So add port 5 there.

option ports '3 0t 5'

See IPQ40xx Switch Config "Strangeness"

1 Like

Can elaborate on what that would do? Do you suggest I add port 5 to both VLAN's?

I don't remember exactly how it works, because I was struggling with that long ago. Try to add to one first. I gave a link to the old discussion.

See also Setting up VLAN on AVM Fritz!Box 4040 not working

1 Like

But as soon as you try to change something in Luci, port 5 will be removed.

1 Like

Maybe try my build for FB4040 ? (19.07.3)

Or build your own, based on the information provided ...
I'm glad to got it working on 19.07 but I have no idea where kernel 5.x will lead us to.

Cheers,
Thomas

Adding port 5 to one or both ports did not fix the issue.

Thx, but I am trying to get out of business of building my own firmware. I am hoping that the issue will be fixed. I can wait.