Setting ethtool options when using NetworkManager

Due to a strange and unresolved issue discussed in this thread I need to set the ethernet adapter to default to 10mpbs as it works much faster than 100mbps. This is an old Acer Travelmate 2410 in case that matters.

I found this info and created this script:


# cat /etc/NetworkManager/dispatcher.d/set-10mpbs 
#!/bin/sh


ACTION=$2


if  "$ACTION" = "up" ]; then
   /sbin/ethtool -s enp6s7 speed 10 duplex full
   echo "Set to 10mpbs full duplex"
fi

However it seems not to do anything although the ownership and permissions are as explained on the link by Novell, i.e.


# l /etc/NetworkManager/dispatcher.d/set-10mpbs
-rwxr-x--x 1 root root 139 Jan 19 15:13 /etc/NetworkManager/dispatcher.d/set-10mpbs*

So what would be the way to set 10mpbs to be active by default?

You should be able to set speed with “speed” property of 802-3-ethernet setting. You will probably need to edit configuration file directly, unless there is some frontend that exposes it.

bor@bor-Latitude-E5450:~$ nmcli c show c7a81999-53d8-382b-af27-c2f77a49b696...
802-3-ethernet.port:                    --
802-3-ethernet.speed:                   0

Could you please explain in a little more detail as I really don’t understand what you are talking about. Thanks!

See “man nm-settings”. You can modify individual settings using e.g. nmcli, here is tutorial for doing it: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Using_the_NetworkManager_Command_Line_Tool_nmcli.html

Thank you, I have done some reading but it seems impossible to set speed using nmcli:

# nmcli connection edit LAN


===| nmcli interactive connection editor |===


Editing existing '802-3-ethernet' connection: 'LAN'


Type 'help' or '?' for available commands.
Type 'describe <setting>.<prop>]' for detailed property description.


**You may edit the following settings: connection, 802-3-ethernet (ethernet), 802-1x, dcb, ipv4, ipv6**
nmcli> describe 802-3-ethernet.speed


=== [speed] ===
[NM property description]
If non-zero, request that the device use only the specified speed.  In Mbit/s, ie 100 == 100Mbit/s.


nmcli> set 802-3-ethernet.speed 10
**Error: failed to set 'speed' property: the property can't be changed**
nmcli>

Any other idea probably?

You can try to edit connection definition directly under /etc/NetworkManager/system-connections. You will need to stop NM, edit, start.

Ok, I added ‘speed=10’ in the [ethernet] section of the LAN connection and rebooted. But speed is still 100mbps.

BTW I just noticed the following in the journal:

nm-dispatcher[934]: /etc/NetworkManager/dispatcher.d/set-10mpbs: line 6: /sbin/ethtool: No such file or directory

After fixing the line to use /usr/sbin/ethtool everything works, no need for other gym :slight_smile:

Thank you for your time!