Hello,
I'm running a snapshot build on a BPI r4.
This device has an eth0 "ethernet switch" that spawns the "lan1", "lan2", "lan3" and "wan" "switch port" devices.
Is there a way to rename the "wan" switch port device to "lan0"?
Thank you.
Hello,
I'm running a snapshot build on a BPI r4.
This device has an eth0 "ethernet switch" that spawns the "lan1", "lan2", "lan3" and "wan" "switch port" devices.
Is there a way to rename the "wan" switch port device to "lan0"?
Thank you.
Yes, but you need to compile the image yourself after editing the dts file.
Usually more effort than it is worth, but if you need this change, it is certainly possible.
Do you want yo bridge it to the br-lan or you want to put a sticker on the router case?
A rose by any other name
You can do it with iputils after boot.
But yeah best to change your device tree if it's just DSA and you don't have to rename a physical device first and have overlapping names etc.
I'm also interested in this as I'm trying something similar on the firebox m300 to get the ports named properly.
root@OpenWrt:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:96 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br-lan state UP mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:97 brd ff:ff:ff:ff:ff:ff
4: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:98 brd ff:ff:ff:ff:ff:ff
5: conduit1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:99 brd ff:ff:ff:ff:ff:ff
6: conduit0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:9a brd ff:ff:ff:ff:ff:ff
7: eth5@conduit0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:9a brd ff:ff:ff:ff:ff:ff
8: eth6@conduit0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:9b brd ff:ff:ff:ff:ff:ff permaddr 00:90:7f:d2:cd:9a
9: eth7@conduit0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:99 brd ff:ff:ff:ff:ff:ff permaddr 00:90:7f:d2:cd:9a
10: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:97 brd ff:ff:ff:ff:ff:ff
root@OpenWrt:~# ip link set eth5 down
root@OpenWrt:~# ip link set dev eth5 name sweth5
root@OpenWrt:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:96 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br-lan state UP mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:97 brd ff:ff:ff:ff:ff:ff
4: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:98 brd ff:ff:ff:ff:ff:ff
5: conduit1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:99 brd ff:ff:ff:ff:ff:ff
6: conduit0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:9a brd ff:ff:ff:ff:ff:ff
7: sweth5@conduit0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:9a brd ff:ff:ff:ff:ff:ff
8: eth6@conduit0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:9b brd ff:ff:ff:ff:ff:ff permaddr 00:90:7f:d2:cd:9a
9: eth7@conduit0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:99 brd ff:ff:ff:ff:ff:ff permaddr 00:90:7f:d2:cd:9a
10: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 00:90:7f:d2:cd:97 brd ff:ff:ff:ff:ff:ff
root@OpenWrt:~#
Further onto this, I don't bother renaming the ports on my AP's. Just change the config so they're all in the same bridge: And obviously delete the wan config and other stuff.
config device
option type 'bridge'
option name 'br-lan'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
list ports 'wan'
editing the dts file.
I don't mind compiling my own image, as a matter of fact, I'm already doing it with snapshot.
Can you give me a pointer of where is that DTS file or some docs around it?
Thank you!
Hope I got the right device?
target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi
Else anothher option is to try the board.d file as that renames things in preinit.
This one just has switch as status:okay. Normally I've also seen a section where it is describing the ports. I guess ccheck another mediatek or ramips target with a dsa switch? Or it's further up in the includes?
OK for completeness as this is what I'm doing to fix the network device naming on firebox m300. If you edit uci-defaults.sh and 10_indicate_preinit you can add the ability to do a relabel pass from your board.json, which is created from board.d/02_network.