Switch configuration

In the 02_network switch configuration I often stumble upon
ucidef_set_interfaces_lan_wan "eth0.1" "eth1"

Now I've wondered that the WR841N v9 as a ar71xx-device uses
ucidef_set_interfaces_lan_wan "eth0.1" "eth1", but as a ath79-device it uses ucidef_set_interfaces_wan "eth0"

Thus the interface names of WAN and LAN have been swapped and furthermore the switch ports are using pvid 0 now exactly as port 0 which is the SoC's ethernet controller.

Why was this device using pvid 1 before? Why is any device using pvid 1 and creating a VLAN for the br-lan at all? Why did the names of eth0 and eth1 have been swapped?

The hardware initialization via DTS works differently than via mach-files, resulting in a different probing order.

That's why general purpose distros have been moving away from the eth%d namespace and push for https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ instead (and that is far from perfect as well, as BIOS updates can still result in a different ordering - or adding PCIe cards with PCI bridges, etc. pp.).


(Bump) I still like to know why OpenWrt sometimes uses VLAN/PID 1 for LAN and sometimes leaves everything untagged. Tagging costs CPU, doesn't it?

Tagging is pretty lightweight, setting a byte in the packet if not unloaded to hardware.

VLAN 1 & 2 tagged on a dual-phy device is likely a vestige of single-phy devices where they were needed to split the LAN and WAN traffic into two sub-interfaces.

A default configuration that is VLAN-aware makes it simpler to add another VLAN to the switch later.

1 Like

Hi @jeff does my ar150 gl.inet based on atheros soc9331 need PHY to work ?

In normal config kernel shows loading PHY driver but in my modded one where I’ve got only the switch (SW_ONLY_MODE in openwrt/target/linux/ar71xx/image/lzma-loader/src/ar71xx_regs.h:

 #define AR933X_ETH_CFG_SW_ONLY_MODE BIT(6) 

Kernel dmesg doesnt says anything about PHY?

Is PHY a physical device ? If needed it is handled by switch driver in my second case ?


Please open your own thread for your question as it seems off-topic and not relevant to this thread.

Thank you for your answers. I thought that it was relevant for Luci's switch configuration form or something. Now I assume that the switch configuration handling using swconfig is completely independent of the initial switch configuration set in 02_network.

1 Like

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