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

The Geek Diary

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

“-bash: route: command not found” on CentOS/RHEL 7

by admin

The route command is used to show/manipulate the IP routing table. The simplest command with ‘route’ is to run it without any options or arguments which will return the IP routing table. The equivalent command with ip is as follows:

$ ip r

where r stands for route.

The route command was deprecated in CentOS 7 minimal installation and most of the Linux distributions. The ip command can be used instead of route command. The following steps describes installation of route command on CentOS/RHEL 7.

# route -n
-bash: route: command not found
#

Step 1. Route command binary installation: Run the following command to install route command:

# yum install net-tools
Loaded plugins: fastestmirror
.....
Installed:
  net-tools.x86_64 0:2.0-0.24.20131004git.el7

Complete!
#

Step 2. Verify the installation: Run the following commands to verify the installation:

# which route
/usr/sbin/route
#

Display the routing table using below command:

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.43.1    0.0.0.0         UG    100    0        0 ens33
192.168.43.0    0.0.0.0         255.255.255.0   U     100    0        0 ens33
#

Final Thoughts

As mentioned in the previous section, the ip utility is a replacement for several utilities including ifconfig and ‘route’, it is included in the iproute2 package. Routes can be seen by running ip route or ip r for short. There are additional route commands for adding or deleting such as ip route del unreachable 10.1.0.0/24, where “unreachable” is the route name and “10.1.0.0/24” is the route.

Filed Under: CentOS/RHEL, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. lynis: command not found
  2. How to Migrate virtual machines from one host to another in the Red Hat Virtualization environment
  3. Why CentOS / RHEL 7 have many tmpfs (6 tmpfs filesystem), and what is their purpose
  4. Changing the IPset rules from IPtables to Firewalld in CentOS/RHEL 7
  5. CentOS / RHEL : How to Enable SSL For Apache
  6. htpdate : command not found
  7. How to Install NTP Service and Client in CentOS/RHEL 8
  8. “cannot install the best update candidate for package” – error on running dnf update
  9. lvdisplay Command Examples in Linux
  10. chattr: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright