Today if one try to set speed or duplex and commit the changes you will end up with:
Speed/Duplex missmatch. Must be both auto or manually configured
The available settings for speed are:
vyos@vyos# set interfaces ethernet eth1 speed Possible completions: auto Auto negotiation (default) 10 10 Mbit/sec 100 100 Mbit/sec 1000 1 Gbit/sec 2500 2.5 Gbit/sec 5000 5 Gbit/sec 10000 10 Gbit/sec 25000 25 Gbit/sec 40000 40 Gbit/sec 50000 50 Gbit/sec 100000 100 Gbit/sec
and for duplex:
vyos@vyos# set interfaces ethernet eth1 duplex Possible completions: auto Auto negotiation (default) half Half duplex full Full duplex
However configuring it manually at for example "speed 1000" and "duplex full" will still have autoneg enabled (according to output of "ethtool eth1").
This is correct according to IEEE (anything at 1Gbps or higher using TP should have autoneg enabled which also keeps auto mdi/mdix enabled which otherwise gets disabled if autoneg is off).
I would like to propose following changes to speed/duplex settings:
It should be possible to turn off autoneg but also be possible to use autoneg enabled but limit which speeds and duplex combos shall be available to the other side of the connected interface.
Various vendors have solved this differently.
Personally I would prefer to have "autoneg" as a configuration option which defaults to "on" but can be set to "off".
Like so:
set interface ethernet eth1 autoneg off
or (defaults to "on" if not set):
set interface ethernet eth1 autoneg on
And for speed setting be able to select multiple speeds (if autoneg is default or "on"), like so:
set interface ethernet eth1 speed 10 100
Along with "duplex auto" the above would mean that following capabilities would be adveritised with autoneg enabled:
Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full
An even better solution would be to refactor and merge speed/duplex into a single setting where one can select like so:
Possible completions: auto Auto negotiation (default) 10-half 10 Mbps/Half Duplex 10-full 10 Mbps/Full Duplex 100-half 100 Mbps/Half Duplex 100-full 100 Mbps/Full Duplex 1000-half 1 Gbps/Half Duplex 1000-full 1 Gbps/Full Duplex 2500-half 2.5 Gbps/Half Duplex 2500-full 2.5 Gbps/Full Duplex 5000-half 5 Gbps/Half Duplex 5000-full 5 Gbps/Full Duplex 10G-half 10 Gbps/Half Duplex 10G-full 10 Gbps/Full Duplex 25G-half 25 Gbps/Half Duplex 25G-full 25 Gbps/Full Duplex 40G-half 40 Gbps/Half Duplex 40G-full 40 Gbps/Full Duplex 50G-half 50 Gbps/Half Duplex 50G-full 50 Gbps/Full Duplex 100G-half 100 Gbps/Half Duplex 100G-full 100 Gbps/Full Duplex
This way the administrator can choose combinations such as (disable autoneg, only support 100Mbps/Full Duplex - note since autoneg gets disabled auto mdi/mdix is disabled aswell so make sure if you use a straight or crossover TP-cable):
set interface ethernet eth1 autoneg off
set interface ethernet eth1 speed_duplex 100-full
or (enable autoneg, support both 10Mbps/Half Duplex, 100Mbps/Half Duplex and 1Gbps/Full Duplex (dont ask me why, this is just an example)):
set interface ethernet eth1 autoneg on
set interface ethernet eth1 speed_duplex 10-half 100-half 1000-full
The above comes handy for troubleshooting connections towards NBASE-T interfaces where a common workaround is to have autoneg enabled but only advertise the desired speed/duplex:
set interface ethernet eth1 autoneg on
set interface ethernet eth1 speed_duplex 10G-full
Also handy if you want to use 1Gbps/Full Duplex with auto mdi/mdix (select whatever cable you want straight or crossover) but not risking that the interface due to some errors would renegotiate and select a lower speed (since the VyOS interface through configuration only supports 1Gbps/Full Duplex there is nothing to renegotiate into which is lower).