• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to make ethtool settings persistent across reboots in CentOS / RHEL 6,7

By admin

Any change made with the ethtool program does not persist across reboots or network module (driver) reloads by default. Follow the steps given below to add the changes in such a way that they apply automatically at boot. Before setting the persistent options for ethtool, make sure you have the latest version of the package ‘initscripts‘.

# yum update initscripts
Note: We have assumed that the NetworkManager is off when you apply the steps given below.

1. Set the ETHTOOL_OPTS parameter in the interface’s ifcfg file found in the /etc/sysconfig/network-scripts/ directory. The network service scripts will run the ethtool program every time the interface is brought up. ethtool can be invoked multiple times by separating the values with a semicolon:

For example, the command :

# ethtool -s eth0 speed 100 duplex full autoneg off

will set the eth0 device to 100Mbs, full duplex, with the auto negotiation off. To have the initialization scripts set this every time the eth0 device is brought up, add a line to the /etc/sysconfig/network-scripts/ifcfg-eth0 like this:

# vi /etc/sysconfig/network-scripts/ifcfg-eth0
ETHTOOL_OPTS="speed 100 duplex full autoneg off"

Below is another exaple where you can set single option and multiple options persistently.

## Setting a single option (running ethtool once)
ETHTOOL_OPTS="-G ${DEVICE} rx 4096"

## Setting multiple options (running ethtool multiple times)
ETHTOOL_OPTS="-G ${DEVICE} rx 4096; -G ${DEVICE} -A autoneg on"

Here ${DEVICE} is the variable taken from the ifcfg configuration file, so you are not required to mention the actual device.

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. How to enable IPv6 on CentOS / RHEL 6
  2. How to Enable Debug Mode for Chronyd Service in CentOS/RHEL 8
  3. How to Configure Persistent Names for Tape Devices in CentOS/RHEL
  4. How to create sparse files in Linux using ‘dd’ command
  5. Beginners Guide to Udev in Linux
  6. How to change the number of commands stored in Bash History
  7. How to Create a Custom Log File Rotation by logrotate in Linux
  8. Understanding rsyslog Templates
  9. Linux OS Service ‘vncserver’
  10. RHEL 7 – RHCSA Notes – Create and manage Access Control Lists (ACLs)

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ACPI in CentOS/RHEL 7
  • How to Use real-time query to access data on a physical standby database
  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary