Setting port speed using swconfig


I used following command to set my port link speed

swconfig dev switch0 port 1 set link "duplex full speed 100 autoneg off"
swconfig dev switch0 apply

when i check via swconfig dev swtich0 port 1 show command, i can see it's applied well.

link: port:1 link:up speed:100baseT full-duplex

However, whenever i reboot my router, my settings are gone.

link: port:1 link:up speed:1000baseT full-duplex

like this.

is there any config file saved for this so my settings will be saved even after i reboot my router?
or are there any other ways to save my settings after rebooting my router?

I am not sure if you can add that to the network configuration, but you can place the commands in /etc/rc.local to be executed after boot.

Well, sometimes i need to change settings. it's annoying to change or type the commands that i want all the time even if i place those commands at rc.local

guess i need to figure out some other ways

As far as I know this speed is auto set at connection of devices and a cable. If both endpoints and cable are supporting Gbit then it gets Gbit. If one device is 100 or 10Mbit then that becomes max speed.

To change this manually doesn’t make much sense for the system. If you want to control max speed for the connection there are better ways.
Or buy a crap cable or hardware gets lower speed.

1 Like

Mind if I ask the usecase of changing the speed or duplex that often to be annoying?