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?