Base-files ucidef_add_switch

In 02_network, when stating:

                ucidef_add_switch "switch0" \
                        "0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"

WHat the "0@eth6" refer to ?
what 2 and 4 in "2:lan:4" refer to ?


The first number refers to the port number on the switch.
The second part (eth0 or lan) refers to the interface.
The last number (if present) refers to the physical port labels on the device.

E.g. if you plug into LAN port 4 on the router, switch0 port 2 will be receiving the traffic.

1 Like

What exactly is "switch port" ? Is that the PHY number on MDIO ?

Here mdio is missing ?!


Here is even more confusing ?!

Here the version:

PHY at

Tried to understand PHY starting from openwrt code but never able to get anything from it. Need a map to the openwrt complex design !


To clarify ( to me mainly):

Management Data Input/Output ( MDIO ), also known as Serial Management Interface ( SMI ) or Media Independent Interface Management ( MIIM ), is a serial bus defined for the Ethernet family of IEEE 802.3 standards for the Media Independent Interface, or MII . The MII connects Media Access Control (MAC) devices with Ethernet physical layer (PHY) circuits. The MAC device controlling the MDIO is called the Station Management Entity (SME)

Excerpt from Wikipedia

Mdio on wikipedia