added permanent ethtool settings also for fedora or modern rhel

This commit is contained in:
2025-07-25 15:34:31 +02:00
parent 92648bf5bb
commit f74bc36984

View File

@@ -202,15 +202,54 @@ Receiver PC Tuning Options
ethtool -K xth1 gro
* for persistent settings after reboot
.. code-block:: bash
* **permanent ethtool settings**
# edit /etc/sysconfig/network-scripts/ifcfg-[ethernet interface name]
# add or modify the following lines
ETHTOOL_OPTS="-K ${DEVICE} gro on;-G ${DEVICE} rx 4096;-L ${DEVICE} combined 4;-C ${DEVICE} rx-usecs 100;-C ${DEVICE} adaptive-rx on"
There are two main methods.
# restart interface ethernet interface
ifdown xth1 && ifup xth1
1. ``systemd service`` (recommended for Fedora and modern RHEL)
This is the preferred method on systems using systemd and NetworkManager, such as Fedora and RHEL 8+.
Create a systemd service template:
.. code-block:: ini
# /etc/systemd/system/ethtool@.service
[Unit]
Description=Set RX buffer size with ethtool
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/sbin/ethtool -G %i rx 8192
Type=oneshot
[Install]
WantedBy=multi-user.target
Enable the service for a specific interface:
.. code-block:: bash
sudo systemctl enable ethtool@xth1.service
This ensures the setting is applied at every boot once the network is online.
2. ``ETHTOOL_OPTS in ifcfg scripts`` (legacy method for RHEL 7 and earlier)
This method applies only to systems using the legacy network-scripts backend, typically RHEL 7 and earlier. It will not apply on systems using NetworkManager, such as modern Fedora or RHEL 8+.
.. code-block:: bash
# edit the corresponding ``ifcfg-*`` file
# file: /etc/sysconfig/network-scripts/ifcfg-eth0
# add or modify the following line:
ETHTOOL_OPTS="-K ${DEVICE} gro on; -G ${DEVICE} rx 4096; -L ${DEVICE} combined 4; -C ${DEVICE} rx-usecs 100; -C ${DEVICE} adaptive-rx on"
# restart the interface
ifdown eth0 && ifup eth0
#. Disable power saving in CPU frequency scaling and set system to performance