I have a Unielec U4019 and, on OpenWrt, it seems the WAN port is mislabelled on the outside of the device. The swich port labelled WAN is actually LAN1. The LAN4 port is functioning as the WAN port. I want to reverse this so the labels match up, just swap the position of the WAN port over to LAN 1. I have been making some changes to the switch configuration below but have been getting nowhere.
I just want to swap the functionality of the two ports
But are you sure that LAN1, LAN2, LAN3 are correct as well or are they swapped too?
Ideally try each port one by one by plugging a cable, then check the swconfig dev switch0 show output to see which external port corresponds to which internal swconfig port.
"0u@eth0" => swconfig port 0 is connected to netdev eth0, prefer untagged config
"5:lan:1" => swconfig port 5 is a lan port, but externally labelled as port 1
"1:lan:2" => swconfig port 1 is a lan port, but externally labelled as port 2
"2:lan:3" => swconfig port 2 is a lan port, but externally labelled as port 3
"3:lan:4" => swconfig port 3 is a lan port, but externally labelled as port 4
"0u@eth1" => swconfig port 0 is connected to netdev eth1, prefer untagged config "4:wan" => swconfig port 4 is a wan port
It doesn't actually make much sense that port 0 is assigned to both eth0 and eth1, I just blindly modified the existing example you quoted, maybe it is wrong to begin with.
@jow
IPQ40xx's essedma driver has its own implementation of VLAN, the "eth1" is actually "eth0.2".
That's why the swconfig of this target looks weird.
You can't change the WAN port without changing the dts or driver.