Attention FritzBox 7530 users/developers - LUCI LAN port ordering reversed

How to reverse the port order from those defined?

The 7530 I flashed has

Physical LUCI Switch/software
LAN1 LAN4
LAN2 LAN3
LAN3 LAN2
LAN4 LAN1

I ran into this because in factory firmware LAN1 can be dual personality: WAN or LAN. This is used when e.g. going from ADSL to Fibre. I was confused when setting VLANs didn't seem to work.

Specs:

Hostname FRITZBox
Model AVM FRITZ!Box 7530
Architecture ARMv7 Processor rev 5 (v7l)
Target Platform ipq40xx/generic
Firmware Version OpenWrt 22.03.5 r20134-5f15225c1e / LuCI openwrt-22.03 branch git-23.093.57104-ce20b4a
Kernel Version 5.10.176

Relevant config to get Physical LAN1 VLAN tagged separately from LAN2-4

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option vid '20'
	option ports '0t 2 3 4'

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

Appears to be in order.

Now LUCI:

02_network in main branch:

	avm,fritzbox-7530)
		ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
		;;

02_network in 22.03.5

	avm,fritzbox-7530)
		ucidef_add_switch "switch0" \
			"0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
		;;

board.json from 22.03.5

{
	"model": {
		"id": "avm,fritzbox-7530",
		"name": "AVM FRITZ!Box 7530"
	},
	"led": {
		"wlan": {
			"name": "WLAN",
			"sysfs": "green:wlan",
			"trigger": "phy0tpt"
		}
	},
	"switch": {
		"switch0": {
			"enable": true,
			"reset": true,
			"ports": [
				{
					"num": 0,
					"device": "eth0",
					"need_tag": false,
					"want_untag": true
				},
				{
					"num": 1,
					"role": "lan",
					"index": 4
				},
				{
					"num": 2,
					"role": "lan",
					"index": 3
				},
				{
					"num": 3,
					"role": "lan",
					"index": 2
				},
				{
					"num": 4,
					"role": "lan",
					"index": 1
				}
			],
			"roles": [
				{
					"role": "lan",
					"ports": "1 2 3 4 0",
					"device": "eth0"
				}
			]
		}
	},
	"network": {
		"lan": {
			"device": "eth0",
			"protocol": "static"
		}
	}

Is the port ordering in 'master' correct?

Could you check if this is already fixed in 23.05 RC builds and/or on snapshot? This device will be converted to DSA with the next release, so there are/were changes. Make sure to start with a fresh configuration, you cannot keep settings.

Won't be able to for a while - but that's the first thing I thought I'd try.

Also the new Port overview PR which landed might affect things?

In any case, this looks more like just a LUCI thing. Embedded in the HTML is data-port="1" for LAN 4 and so on for the other ports :confused:

At this point, this is unlikely to be touched for swconfig (so 22.03.x) anymore - as it would break the ordering for everyone, just for it to be changed with the DSA migration again/ anyways. So if you care, please do test DSA (23.05~/ master snapshots) soon (now).

Has anyone else using DSA builds noticed this? Testing should be trivial.

This seems to have been fixed with the switch to DSA. I just tested 23.05.0-rc3 on my Fritzbox 7530 to verify, and the LAN interface names match the labels on the device.

2 Likes