One of the default packages for the GL-AR300M is swconfig. But under the Network menu there is no switch entry. Why?
It does not have switch hardware so does not use swconfig. It is probably default by accident.....
it use swconfig because GL use older kernel
Sorry @anon4457646 it does not use swconfig because it does not have a switch. Nothing to do with the kernel age.
yes sorry it's the small device
The kernel log tells me:
switch0: Atheros AR8229 rev. 1 switch registered on mdio.0
The firmware is pure latest stable OpenWRT with kernel 5.10.X:
cat /etc/openwrt_release DISTRIB_ID='OpenWrt' DISTRIB_RELEASE='22.03.3' DISTRIB_REVISION='r20028-43d71ad93e' DISTRIB_TARGET='ath79/nand' DISTRIB_ARCH='mips_24kc' DISTRIB_DESCRIPTION='OpenWrt 22.03.3 r20028-43d71ad93e' DISTRIB_TAINTS=''
let's see the network config file (ideally default or near-default).
Please copy the output of the following commands and post it here using the "Preformatted text
</> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
I'd have to look deeper to know what the situation is for your device, but some 2-port devices actually do have a switch, others don't and have 2 independently routed ports. Oddly, IIRC the TL-WR902AC
v3 has a switch even though it is only a single port device, which is obviously unusual. If your device has a swtich, I'd expect it to be swconfig, not DSA, since only a very few (if any) ath79 devices have moved to DSA. The details in the network file should give us all the clues, though.
This is the initial/default network config file:
config interface 'loopback' option device 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0' config globals 'globals' option ula_prefix 'fd59:3ed8:2c55::/48' config device option name 'br-lan' option type 'bridge' list ports 'eth0' config interface 'lan' option device 'br-lan' option proto 'static' option ipaddr '192.168.1.1' option netmask '255.255.255.0' option ip6assign '60' config interface 'wan' option device 'eth1' option proto 'dhcp'
Yeah, looks like this is 2 independently routed ports (eth0 and eth1). There is no evidence of any switch related configuration elements.
What is it that you would like to achieve?
The QCA9531 SoC is made for a 4+1 desktop router as the chip includes an internal 4 port Fast Ethernet switch, and an additional CPU port directly to a PHY for the WAN port. In this pocket router, three of the switchable ports are not wired to anything. But there is always a switch between eth0 and the lan port.
The only time this is a concern is if you want to pass VLAN tags on the lan port.
Defining several VLANs.
This is just what I'd like to achieve.
swconfig dev switch0 show
swconfig dev switch0 show Global attributes: enable_vlan: 0 ar8xxx_mib_poll_interval: 500 ar8xxx_mib_type: 0 enable_mirror_rx: 0 enable_mirror_tx: 0 mirror_monitor_port: 0 mirror_source_port: 0 arl_table: address resolution table Port 0: mib: MIB counters RxGoodByte : 11298355 (10.7 MiB) TxByte : 1100593 (1.0 MiB) pvid: 0 link: port:0 link:up speed:1000baseT full-duplex txflow rxflow Port 1: mib: MIB counters RxGoodByte : 1100273 (1.0 MiB) TxByte : 11295205 (10.7 MiB) pvid: 0 link: port:1 link:down Port 2: mib: No MIB data pvid: 0 link: port:2 link:down Port 3: mib: No MIB data pvid: 0 link: port:3 link:down Port 4: mib: No MIB data pvid: 0 link: port:4 link:down
if you attempt to define a VLAN as eth0.x, does that not work? If so, it would suggest that @mk24 is right that the switch needs to be configured to pass the VLAN. However, if the switch is transparent in this regard, such a VLAN config may just work.
I'll test it and report back.
It appears there is no cable plugged into the lan port, as one of the other ports should be up at 100 Mb.
I'm not sure what happens sending VLAN tagged packets through the switch while it is configured in non-vlan mode as this one is.
In vlan mode there must be a vlan defined for each tag that should pass through. Also I think all the FE chips are limited to 16 VLAN definitions.
Of course another approach is to use the other port which doesn't go through the switch, that can handle unlimited VLANs directly with the notation eth0.N.
I'm wondering the same thing
If it behaves like an unmanaged switch, hopefully it is such that it is predictable and either works outright or doesn't at all. We know that some unmanaged switches will pass VLAN tags transparently, even though it is obviously not best practice. And of course, some don't pass them, or worse really misbhave with the tags and cause major network problems.
Earler you had said that the switch is connected to eth0, so I'm guessing that the OP would need to swap the wan (eth1) and lan (eth0) ports to make this possible, right? Or is there a way to bypass the switch in this case?
I don't think the switch can be bypassed, though if it reports no external ports up with both cables plugged in, it must have been bypassed.
The eth0 vs eth1 assignment would depend on the dts definition. One of the eth ports definitely leads direct to an RJ45 without a switch.