GL-AX1800 Switch versus eth[01234]

What is the relationship between the Switch in the GL-AX1800
and the 5 ethernet ports eth[0-4] I can see from the command line? Is there a physical switch between the CPU and the RJ45 ports or is the switch a virtual device created by the linux kernel on top of the 5 regular ethernet ports/interfaces that it can see directly? Or something else? Asking because I'd really rather understand what I'm doing when I am configuring it because that makes it less likely I will create huge security holes by copy-pasting stuff I don't understand.

This depends per router, since i could not check it let me give some info:

Often if you navigate to luci -> network -> interfaces and then click the interfaces tab if you edit them you can view which devices they use.

Often wan uses either eth0 or eth1.

Lan ports often use eth2-ethx or lan1-lanx which is reflected if you edit br-lan via luci -> network -> interfaces -> devices (tab) this may be different located if older luci when editing a interface.

Currently you have two types of switch architectures.

for older routers likely also the flint 1 it is swconfig although i have seen firmware images which had both swconfig and DSA (this is not usual btw perhaps it is a bug), but i remember back then i used DSA i think this also highly depends if the firmware is based on wlanap or qsdk.

if it is swconfig you will see a switch entry on luci -> network -> switch, if not you will have a option for bridge vlan filtering when editing the br-lan bridge.

For DSA the newer one, the cpu port is there but it is advised not to use, DSA already simplify cpu tagging it does it automatically where swconfig doesn't.

So based on what is reflected between the wan port and the lan ports, this how you know which port is bound to the cpu, and you can know if it is DSA or swconfig based on the switch luci entries.

Well I can see a switch (switch0), with the CPU indicated as eth0, when I do that so presumably I have swconfig. However it also says Switch switch0 has an unknown topology - the VLAN settings might not be accurate. If there's actual hardware connected to eth0 implementing a switch what are the eth[1234] I can see that appear to be configured as part of br-lan?

These must be the lan ports.

however eth0 must be wan, i have my doubts it is the cpu port, hence why you get to see this warning.

The reason is because otherwise wan would be eth1 but the flint counts 4 lan ports, i count 3, not seeing a appearance of eth5.

can you check if you also have DSA settings?

Then maybe the road is to use DSA vlans.

I remember a few years ago I also had swconfig but also DSA which is by OpenWrt standards not correct, it's one of the two, I went the DSA road and that worked for me.

It doesn't look like it has DSA. I grepped for DEVTYPE=dsa as suggested here https://openwrt.org/docs/guide-user/network/dsa/dsa-mini-tutorial and nothing came back. ip addr shows br-lan is the only thing with an ip address and is comprised of eth[1-4] and wlan[01]. I don't have anything plugged in (accessing over WiFi) and all of the eth[0-4] ports show as NO-CARRIER which suggests that it is really the WAN port and not an uplink from a switch implemented in hardware. I should probably update the firmware to the latest version. Maybe it will add DSA.

I'm now thinking it does have DSA based on the presence of the 4 ethernet ports and the OpenWRT version it displays on login (21.02-SNAPSHOT). There is both a switch entry under luci-> network-> switch and a bridge vlan filtering option on the br-lan bridge. Configuring with swconfig seems like a poorly defined option when I can see 5 ethernet ports.

1 Like

Jup, they use a weird impl for flint 1, usually under normal circumstances a openwrt router only has one of the 2 options swconfig (the switch tab) or DSA with the bridge vlan filtering checkbox :slight_smile: