• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to footer

The Geek Diary

HowTos | Basics | Concepts

  • Solaris 11
  • Solaris
    • SVM
    • ZFS
    • Zones
    • LDOMs
    • Hardware
  • Linux
    • CentOS/RHEL 7
    • RHCSA notes
    • SuSE Linux Enterprise
    • Linux Services
  • VxVM
  • VCS
  • Interview Questions
  • oracle
    • ASM
    • mysql
    • RAC
    • oracle 12c
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting

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. CentOS / RHEL : How to Set up SFTP to Chroot Jail only for Specific Group
  2. CentOS / RHEL : How to set up chroot jail SFTP
  3. How to Configure Interface bonding (NIC Teaming) on Oracle Linux 6
  4. UNIX/Linux : Access control lists (ACLs) basics
  5. How to install and Configure VNC (TigerVNC) server in CentOS / RHEL 7
  6. How to use “xfs_admin” command to change parameters of an XFS filesystem
  7. CentOS / RHEL : How to convert volume group metadata between LVM1 and LVM2
  8. Linux “shutdown”, “poweroff”, “halt”, “reboot” Commands
  9. CentOS / RHEL 7 : How to configure cache-only nameserver
  10. RHEL 7 – RHCSA Notes – Set enforcing and permissive modes for SELinux

You May Also Like

Primary Sidebar

Recent Posts

  • Oracle SQL script to Show current Users and SQL being Executed
  • How to use qperf to measure network bandwidth and latency performance in Linux
  • How to Password Protect GRUB2 in Oracle Enterprise Linux 7
  • How to move or rename a datafile in the same ASM diskgroup (Using ASM alias)
  • How to monitor Disk health with smartd (S.M.A.R.T.)

Footer

Cheat Sheets

  • LDOMs (OVM for SPARC) Command line reference
  • Solaris Volume Manager (SVM) command line reference
  • Solaris ZFS command line reference
  • RHEL 7 – RHCSA Notes (Cheat Sheets)
  • CentOS / RHEL 7 : firewalld Cheat Sheet
  • systemd command line reference (cheat sheet)

Solaris interview questions

  • The ultimate Solaris Volume Manager (SVM) interview questions
  • The ultimate Solaris zones (containers) interview questions
  • The ultimate Solaris networking interview questions
  • The ultimate ZFS interview questions
  • Archives
  • Contact Us
  • Copyright

© 2018 · The Geek Diary