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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

ifrename: command not found

by admin

Using ifrename is the easiest way to make sure your network cards keep the correct configurations on Linux systems. Usually, interfaces will come up in the same order, and the kernel will assign them the same names, but sometimes this can change (e.g., after a kernel upgrade or adding another network card). Your nice Linux firewall won’t work with the network interfaces mixed up, so it is best to nail them down. An additional bonus is you can easily name your interfaces anything you want with ifrename. You might give them descriptive names like “lan” and “wan,” instead of eth0 and eth1.

If you encounter below error:

ifrename: command not found

you may try installing below package as per your choice of distribution.

Distribution Command
Debian apt-get install ifrename
Arch Linux pacman -S ifrename
Kali Linux apt-get install ifrename
CentOS yum install ifrename
Fedora dnf install wireless-tools-1
Raspbian apt-get install ifrename

To get more help on the ifrename command, refer to the man page:

$ man ifrename

The ifrename utility can be used to rename a network interface. The -i option specifies the old interface name, and -n sets the new name. To rename wlan0 to eth1, for example:

# ifrename -i wlan0 -n eth1

ifrename Command Examples

1. To set the configuration file:

# ifrename -c /path/config 

2. To probe kernel modules before renaming interface:

# ifrename -p 

3. To rename specific interface:

# ifrename -i eth1

4. To specify the new name:

# ifrename -i eth1 -n eth8 

5. To enable takeover support:

# ifrename -t 

6. To enable udev output mode:

# ifrename -u 

7. To dry-run mode:

# ifrename -D 

8. To set to verbose mode:

# ifrename -V 

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to allow or deny telnet login to specific users only in CentOS/RHEL
  2. Linux OS Service ‘avahi-daemon’
  3. Time goes out of sync on a node running CentOS/RHEL 7
  4. check-language-support Command Examples in Linux
  5. How to Remove/Delete All Packages from Channel(s) in SpaceWalk
  6. Basic “chmod” Command examples in Linux
  7. check-support-status: command not found
  8. pi Command Examples in Linux
  9. exrex: Generate all/random matching strings for a regular expression
  10. numactl: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright