The 4 lan ports are working correctly with your sugestions and some tweak in ucidef_set_interfaces_lan_wan https://github.com/openwrt/openwrt/compare/main...juampe:openwrt:WR3000H?diff=unified&w=
But the wan port, as you say, is not trivial, appear as eth1 but not work with the compatible values proposed
root@OpenWrt:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc mq state UP qlen 1000
link/ether 80:af:ca:5f:2f:8c brd ff:ff:ff:ff:ff:ff
inet6 fe80::82af:caff:fe5f:2f8c/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 80:af:ca:5f:2f:8d brd ff:ff:ff:ff:ff:ff
4: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
link/ether 80:af:ca:5f:2f:8c brd ff:ff:ff:ff:ff:ff
5: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
link/ether 80:af:ca:5f:2f:8c brd ff:ff:ff:ff:ff:ff
6: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
link/ether 80:af:ca:5f:2f:8c brd ff:ff:ff:ff:ff:ff
7: lan4@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
link/ether 80:af:ca:5f:2f:8c brd ff:ff:ff:ff:ff:ff
8: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether 80:af:ca:5f:2f:8c brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
valid_lft forever preferred_lft forever
inet6 fd3f:c60c:4154::1/60 scope global noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::82af:caff:fe5f:2f8c/64 scope link
valid_lft forever preferred_lft forever
root@OpenWrt:~# dmesg|grep "mdio\|soc_eth"
[ 1.782697] mtk_soc_eth 15100000.ethernet eth0: mediatek frame engine at 0xffffffc081300000, irq 75
[ 1.792644] mtk_soc_eth 15100000.ethernet eth1: mediatek frame engine at 0xffffffc081300000, irq 75
[ 1.956607] mt7530-mdio mdio-bus:1f: configuring for fixed/2500base-x link mode
[ 1.965330] mt7530-mdio mdio-bus:1f: Link is Up - 2.5Gbps/Full - flow control rx/tx
[ 1.976860] mt7530-mdio mdio-bus:1f lan1 (uninitialized): PHY [mt7530-0:00] driver [MediaTek MT7531 PHY] (irq=79)
[ 1.999118] mt7530-mdio mdio-bus:1f lan2 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7531 PHY] (irq=80)
[ 2.021155] mt7530-mdio mdio-bus:1f lan3 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7531 PHY] (irq=81)
[ 2.043205] mt7530-mdio mdio-bus:1f lan4 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7531 PHY] (irq=82)
[ 2.054759] mtk_soc_eth 15100000.ethernet eth0: entered promiscuous mode
[ 2.390759] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/2500base-x link mode
[ 2.399262] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[ 2.430204] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
[ 5.304474] mt7530-mdio mdio-bus:1f lan1: Link is Up - 1Gbps/Full - flow control rx/tx
[ 6.603072] mt7530-mdio mdio-bus:1f lan1: Link is Down
[ 16.380219] mtk_soc_eth 15100000.ethernet eth0: Link is Down
[ 16.401194] mtk_soc_eth 15100000.ethernet eth0: configuring for fixed/2500base-x link mode
[ 16.411527] mtk_soc_eth 15100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[ 16.420429] mt7530-mdio mdio-bus:1f lan1: configuring for phy/gmii link mode
[ 16.442155] mt7530-mdio mdio-bus:1f lan1: entered allmulticast mode
[ 16.448425] mtk_soc_eth 15100000.ethernet eth0: entered allmulticast mode
[ 16.458025] mt7530-mdio mdio-bus:1f lan1: entered promiscuous mode
[ 16.477609] mt7530-mdio mdio-bus:1f lan2: configuring for phy/gmii link mode
[ 16.499342] mt7530-mdio mdio-bus:1f lan2: entered allmulticast mode
[ 16.507534] mt7530-mdio mdio-bus:1f lan2: entered promiscuous mode
[ 16.523877] mt7530-mdio mdio-bus:1f lan3: configuring for phy/gmii link mode
[ 16.545207] mt7530-mdio mdio-bus:1f lan3: entered allmulticast mode
[ 16.553493] mt7530-mdio mdio-bus:1f lan3: entered promiscuous mode
[ 16.569447] mt7530-mdio mdio-bus:1f lan4: configuring for phy/gmii link mode
[ 16.590732] mt7530-mdio mdio-bus:1f lan4: entered allmulticast mode
[ 16.599316] mt7530-mdio mdio-bus:1f lan4: entered promiscuous mode
[ 19.350494] mt7530-mdio mdio-bus:1f lan1: Link is Up - 1Gbps/Full - flow control rx/tx
[ 177.404017] mtk_soc_eth 15100000.ethernet eth1: configuring for fixed/2500base-x link mode
[ 177.413932] mtk_soc_eth 15100000.ethernet eth1: Link is Up - 2.5Gbps/Full - flow control rx/tx