• 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

CentOS / RHEL 7 : How to modify Network Interface names

By admin

On CentOS / RHEL 7, a new naming scheme is introduced.
For instance:

# ip addr show
.....
eno1: [BROADCAST,MULTICAST,UP,LOWER_UP] mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 6c:0b:84:6c:48:1c brd ff:ff:ff:ff:ff:ff
inet 10.10.10.11/24 brd 10.10.10.255 scope global eno1
inet6 2606:b400:c00:48:6e0b:84ff:fe6c:481c/128 scope global dynamic
valid_lft 2326384sec preferred_lft 339184sec
inet6 fe80::6e0b:84ff:fe6c:481c/64 scope link
valid_lft forever preferred_lft forever

This post describes how to revert to the legacy naming scheme with Network Interface names as eth0, eth1, etc.

1. Edit kernel boot parameter.

Edit file /etc/default/grub and add net.ifnames=0 biosdevname=0 to line GRUB_CMDLINE_LINUX, for instance:

GRUB_CMDLINE_LINUX=" crashkernel=auto net.ifnames=0 biosdevname=0 rhgb quiet"

Regenerate a GRUB configuration file and overwrite existing one:

# grub2-mkconfig -o /boot/grub2/grub.cfg

2. Correct ifcfg file configuration

Edit NAME and DEVICE parameters in ifcfg file to new Network Interface name.

# cat /etc/sysconfig/network-scripts/ifcfg-eno1
......
NAME=eth0
DEVICE=eth0
......

Edit ifcfg file name:

# mv /etc/sysconfig/network-scripts/ifcfg-eno1 /etc/sysconfig/network-scripts/ifcfg-eth0

3. Disable NetworkManager

Make sure you disable the NetworkManager as it may revert back the changes on reboot or network restarts.

# systemctl disable NetworkManager
rm '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service'

4. Reboot system

The last step is to reboot the system for the changes we made to take effect.

# shutdown -r now

Verify

Verify the change of device name to eth0 in ip addr show.

# ip addr show
.....
eth0: [BROADCAST,MULTICAST,UP,LOWER_UP] mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 6c:0b:84:6c:48:1c brd ff:ff:ff:ff:ff:ff
inet 10.10.10.11/24 brd 10.10.10.255 scope global eno1
inet6 2606:b400:c00:48:6e0b:84ff:fe6c:481c/128 scope global dynamic
valid_lft 2326384sec preferred_lft 339184sec
inet6 fe80::6e0b:84ff:fe6c:481c/64 scope link
valid_lft forever preferred_lft forever

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. How to use the “screen” command in Linux
  2. How to disable auto completion (tab completion) in bash shell
  3. How to change the path of the auditd log file /var/log/audit/audit.log
  4. CentOS / RHEL : How to delete LUKS encrypted device
  5. How to Customize Linux Password Expiration and Complexity Requirements
  6. Can’t start X11 applications after “su” or “su -” to another user
  7. Kernel Logs Warning Messages “kernel: Possible SYN flooding on port X. Sending cookies” is logged”
  8. CentOS / RedHat : Beginners guide to log file administration
  9. Replacing a Failed Mirror Disk in a Software RAID Array (mdadm)
  10. How to Ignore/Disable Specific auditd Logging Entries

You May Also Like

Primary Sidebar

Recent Posts

  • Failed to start LSB: Bring up/down networking – On restarting network service CentOS/RHEL (DHCP client)
  • How To Add Timestamps To dmesg Kernel Boot Log in CentOS/RHEL
  • How to disable ICMP redirects on CentOS/RHEL
  • What are Oracle Key Vault Roles
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary