LuCi reports different port numbers in network/switch than the labels on the board itself/swconfig numbers. That makes administration confusing:
Swconfig port numbers:
also as physici0al port numbers on device:
1 2 3 4 5
| | | | | LuCI
| | | | | label
| | | | |
| | | | +- LAN4 (should be LAN5)
| | | +--- LAN3 (should be LAN4)
| | +----- LAN2 (should be LAN3)
| +------- LAN1 (should be LAN2)
+--------- WAN (ok.)
I tried to see if mucking around with /etc/board.d/02_network could help, but i don't think that this file gets even executed from overlay: i added a logger output and nothing shows up in syslog. Aka: i fear its only executed from underlay.
02_network is only executed if there is no etc/config/network. If there is one, the file has no impact. And it only creates the config into etc/config/network, so you can directly edit switch config there.
Yes but i don't think this particular setting is controlled from there.
the 02_network file invokes functions from /lib/functions/uci-defaults.sh, which all dump to board.json files.
And would be surprised if LuCI didn't do it similarly. But i am just guessing here, and will stand corrected by LuCI gurus.
So my suggestion still stands @toerless. Edit /etc/board.json and see what happens.
And if that fixes it, then a patch should be sent to Openwrt to change this mapping permanently.
Thanks. Have to try next year, off now, but my main concern is that my board.json does not assign logical numbers, but only what looks like the physcial numbers, so i fear that the local numbers shown by LuCI are just in numerical order.
@lantis1008
You are right, LuCI uses /etc/board.json for that functionality. I overlooked that. My bad.
@toerless
You are also right, the change to /etc/board.d/02_network needs to be in the flashed firmware as it is evaluated early in the preinit phase before overlay is mounted. (I noticed that also in a PR discussion in July: https://github.com/openwrt/openwrt/pull/1130 )
But for testing purposes, the suggestion by @lantis1008 works ok: you can edit /etc/board.json and after refreshing the LuCI switch page, the new numbering should be visible. (Just tested with my wrt3200acm...) But that chage only lives until the next reboot.
For permanent changes you will need to make the change to 02_network source, compile firmware and flash it.
EDIT:
But I am not sure if the shown numbering can start from 2. It may need to start from 1.
Is there still an (easy) way to install OpenWrt without overlay ? Thats what i did years ago with CC, but i don't remember how. Woul aleviate the pain to have to jump through hoops when trying to fixup stuff (hoops = build another flash image).
Btw: can not renumber/rename ports except permutation because the LuCI code does simply assigns the names sequentially with the name being the role (LAN, WAN).
Improving LuCI output looks like a feature request.