NetworkManager script not running

NethServer Version: NS7
Module: NetworkManager

This is not an NS issue per se, but I thought I’d ask here as folks will have a better idea of how the networking is configured.

I have a requirement to run the following when one of my ethernet interfaces comes up:

/sbin/ethtool -K enp0s25 gso off gro off tso off

Initially I added this to /etc/sysconfig/network-scripts/ifcfg-enp0s25:

ETHTOOL_OPTS="gso off gro off tso off"

Following the next re-boot, I checked, and the settings were still at the default values.

After doing more digging I tried creating this script: /etc/NetworkManager/dispatcher.d/75-ethtool

# Fix the broken e1000 driver

/bin/logger ethtool script called with $1 and $2

if [ "$1" = "enp0s25" ] && [ "$2" = "up" ]; then
        /sbin/ethtool -K $1 gso off gro off tso off

exit 0

Initially, I didn’t have the “logger” line there, but added it when again the settings weren’t updated on a re-boot. Searching /var/log/messages, I can’t see any lines output by that script, so I don’t think it’s being called.

What should I be doing to ensure that this command is run when the interface is brought up.

Side question: Is there an NS way of re-starting the networking without having to re-boot to work on/test this.


AFAIK, the right syntax is:
db networks setprop enp0s25 ethtool_opts "\"-K \${DEVICE} tso off\""
To apply the fix and restart the network:
signal-event interface-update

Ha, now I’m wondering exactly what I did put for ETHTOOL_OPTS, as I typed that line above from memory. In fact I probably put:

ETHTOOL_OPTS="-K enp0s25 gso off gro off tso off"

None of the examples I found when initially Googling this showed the “device” as part of ETHTOOL_OPTS, so let me try your version and report back.


I haven’t had the opportunity to re-boot yet, but I’m marking this as solved, based on this from sysconfig.txt:

   Deprecated, but supported:
      Any device-specific options supported by ethtool. For example,
      if you wanted to force 100Mb full duplex:
        ETHTOOL_OPTS="speed 100 duplex full autoneg off"
      Note that changing speed or duplex settings almost always
      requires disabling autonegotiation with 'autoneg off'.

      Multiple options can also be set like so :
      ETHTOOL_OPTS="-K ${DEVICE} tso on; -G ${DEVICE} rx 256 tx 256"

      Long term, this should be done by sysadmin-written udev rules.