Show vlan (lan and wan port ) up or down

hi
i want a command to see now the lan port and wan port is up or down
i want a command that show ethernet cable wan in or not in the lan and wan port
vwry thanks

swconfig or an equivalent ubus call

thanks
you know command for port 6t status ?

If a CPU port, it will always be up, as it is "hard-wired" to the CPU.

i dont understand . i have a wan port in moden and want know when connect nad dissconnect

Ports 0 and 6 are typically associated with the MACs on the SoC. There is no socket or cable involved. They are always "up" as there is always connectivity to the MAC, for those that are connected to an active MAC.

but .i config switch and set port 0 and 6t in vlan 1 . thsi port now on the vlan 1 and i connect in a cable

can get me command for port 1 for sample ?

Ports are physical, is there electrical connectivity or not. VLANs are packet contents. VLANs aren’t “up” or “down”, they’re either configured or not.


$ swconfig dev switch0 show | fgrep 'link: port:1 ' | cut -d ' ' -f 3 | cut -d ':' -f 2
up

very thanks . i will check it