IPQ40xx Switch Config "Strangeness" (swconfig)

Is it possible to use WAN port as another LAN port? Need the DSA support patch?

Yes, you can. You can bridge eth1 with eth0.

Cannge in /etc/config/network

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'

to

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0 eth1'

I guess vlans 1 and 2 are not needed in this case, but that requires testing.

And you obviously need to remove wan and wan6 interfaces if they are using eth1.

No.

1 Like

Should be

list ports 'eth0'
list ports 'eth1'
3 Likes

That's correct. I forgot the syntax. Couldn't find it in the docs easily.

2 Likes

That's great, I already had interfaces WAN and WAN6 disabled, so I only had to add eth1 to bridge br-lan as per your advice, Thank you

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'
	list ports 'eth1'

Thank you for the syntax

Thanks for this. I had a strange issue with a Linksys ea6350 where mDNS traffic wasn't being propagated between the lan and wan ports, even though I'd combined them with swconfig. I'll see if this fixes it.

This won't fix anything with wan port. This setting is for a case where there is no wan interface.

Yes, that's my use case.

I wasted my time porting DSA configuration back to swconfig to make it work with a router with IPQ4019 chipset. It took me another hour of headache only to find that the switch had serious problem and it did not follow the configuration file at all.

Tested on 22.03.0.

The DSA PR was merged to master, it will be included in a future release :slight_smile:

3 Likes

From what I have heard, DSA cannot support devices with 2 physical interfaces. Mine is the MobiPromo CM520-79F which has eth0 (CPU port) and eth1 (dedicated WAN port). I don't know if it will be in the list of DSA.

Are you sure that's the case? I believe all ipq40xx boards reported two interfaces due to how the driver is written. They have hardcoded VLANs for each interface which is what causes the "strangeness". With DSA you are going to see one interface and multiple ports. Also no more hardcoded VLANs. I suggest you open an issue in GitHub and get it converted, it should be rather easy!

After a fresh install of OpenWrt 22.03.0, here is what it reports:

root@OpenWrt:~# swconfig dev switch0 show
[...]
VLAN 1:
    vid: 1
    ports: 0 3 4

VLAN 2:
vid: 2
ports: 0t 5
  • Port 0 is the switch port connected to eth0
  • Port 3 is the switch port labeled LAN2
  • Port 4 is the switch port labeled LAN1
  • Port 5 is nowhere to be found. I suspect it to be a hidden, internal, unused port.
  • WAN port is reported as eth1

I've found a workaround. The router completely freezes if I try to add option vlan '2' to /etc/config/network. Avoiding VLAN 2 and it will work properly. I can still configure VLAN 3 with option vid '2' without making it freeze, but I don't have time to test if VID 2 actually works or not.

I believe all ipq40xx boards reported two interfaces due to how the driver is written. They have hardcoded VLANs for each interface which is what causes the "strangeness".

With your suggestion, now I am suspecting Port 5 is actually the WAN port with a separated hardcoded VLAN 2 (probably with VID 2 as well). I am now using the WAN port for my local network, and 2 LAN ports for 2 remote sites. One of the 2 remote sites has a VLAN with VID=2. I don't know if trying to create a VLAN with VID=2 on the LAN port (connected to remote site) will mix that L2 network with my local network (WAN port of the router) or not.

Yes, port 5 is the WAN port and also its not shown in the UI. You can specify it in the config manually and it will work. Do not use VLAN 1 and 2 and you should be fine.

Here's mine with 22.03.0 (non DSA!):

VLAN 1:
        vid: 1
        ports: 0 1 2 3 4
VLAN 2:
        vid: 2
        ports: 0t 5
VLAN 20:
        vid: 20
        ports: 0t 3t 4t
VLAN 40:
        vid: 40
        ports: 0t 3t 4t
VLAN 50:
        vid: 50
        ports: 0t 3t 4t

Alternatively, just port it to DSA. Much simpler, works like charm and no hidden magic.

This looks exactly like my GL.iNET GL-B1300, before the DSA:

root@GL-B1300-078 ~ # swconfig dev switch0 show|tail
TxLateCol   : 0

	pvid: 2
	link: port:5 link:down
VLAN 1:
	vid: 1
	ports: 0 3 4 
VLAN 2:
	vid: 2
	ports: 0t 5 

GL-B1300 is converted, so you could get a hint.

ipq40xx physically only has a single CPU port, what you're seeing is just the fake port invented by the old swconfig driver - so no regression here (for ipq40xx, ipq806x would have a real second CPU port).

Do not use VLAN 1 and 2 and you should be fine.

By avoiding VLAN 2, I was able to get the router working instead of freezing. I still tried to use VID 1 on my router because I need to connect to VLAN/VID 1 of a Cisco switch. At first it seemed alright. However I could connect to some address on the Cisco side, while some just gave no responses.

All IP addresses I tried to connect are in the same subnet. Further investigation showed that ARP just failed on some IP, randomly, with the result being 00:00:00:00:00:00. I configured the Cisco to output VLAN 1 untagged, to receive it on my router as VLAN 751 untagged (can be any random VLAN number) and it works now.

The conclusion is: VID 1 and VLAN 2 should be avoided. VLAN 1 and VID 2 are still good to use. Although I've encountered no problem so far, I need some more testing on VID 2.

1 Like

38 posts were split to a new topic: Ipq40xx / dsa: switch issues

Is there any new progress in bridging LAN and WAN?