Ethernet interface speed/duplex manual settings?


Is there any way to manually control speed/duplex for physical ports/interfaces?

For LAN ports, you can use tool swconfig:

# swconfig dev switch0 show

See this post for documentation of which port is which.

For WAN port, the ethtool utility should work as on any other Linux.

1 Like

But ethtool will work on eth0|1|2 level without control on physical ports 0…6 right?

Yes and no. The eth1 is directly connected to the WAN port, so in this case, you are controlling the WAN socket.

Regarding eth0 and eth2, those are linked internally to the switch. So by using ethtool on them, you can control the speed of these internal links, but not the LAN sockets. That’s why you have to use swconfig tool for that.

By using swconfig I don’t see any options to set duplex/speed on port 1-3,5 level.

swconfig dev switch0 help
switch0: 10.mvsw61xx(MV88E6176), ports: 7 (cpu @ 5), vlans: 64
Attribute 1 (int): enable_vlan (Enable 802.1q VLAN support)
Attribute 2 (none): apply (Activate changes in the hardware)
Attribute 3 (none): reset (Reset the switch)
Attribute 1 (int): port_based (Use port-based (non-802.1q) VLAN only)
Attribute 2 (int): vid (Get/set VLAN ID)
Attribute 3 (ports): ports (VLAN port mapping)
Attribute 1 (string): mask (Port-based VLAN mask)
Attribute 2 (int): qmode (802.1q mode: 0=off/1=fallback/2=check/3=secure)
Attribute 3 (int): pvid (Primary VLAN ID)
Attribute 4 (string): link (Get port link information)

You are probably right. It looks like this switch driver does not support setting speed/duplex.

As I want trunking/bonding support, I’m currently messing around with the switch driver.
In comparison, speed/duplex setting should be easy to implement…

Will be nice to have some way to find MAC address table per switch port.
Tried to find it but my google fu is too low I guess.