• 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 8

by admin

The old command to set the default route is route. If no options are used, it will display a list of all routes that are currently defined on this host. When using the route command without options, it will always try to resolve the name for a given IP address, which takes some time. If you don’t want any name resolution to be performed, use the option -n, which makes the command a lot faster. The equivalent command with ip is as follows:

$ ip r

where r stands for route.

By default route command is not available in CentOS/RHEL 8 minimal installation and other Linux distributions. route command is available by installing package net-tools. ip route show command can be used instead of route command to check listening ports and services on CentOS/RHEL 8 minimal installation.

This post describes How to resolve “-bash: route: command not found” on CentOS/RHEL 8.

The error below shows that the route command is not installed on the system.

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

Step 1. Package Installation: Run the following command to install net-tools package:

# dnf install net-tools
CentOS-8 – AppStream
…………………….
Installed:
  net-tools-2.0-0.51.20160912git.el8.x86_64

Complete!
#

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

# which netstat
/usr/sbin/route
#

To display the routing table, use the 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 eth0
0.0.0.0         192.168.43.1    0.0.0.0         UG    101    0        0 eth1
192.168.43.0    0.0.0.0         255.255.255.0   U     100    0        0 eth0
192.168.43.0    0.0.0.0         255.255.255.0   U     101    0        0 eth1
#

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 8, Linux

Some more articles you might also be interested in …

  1. How to use command redirection under Linux
  2. ebuild Command Examples in Linux
  3. CIFS Share Filesystem Is Not Mounted after Reboot on CentOS/RHEL 7
  4. groupmems Command Examples in Linux
  5. id Command Examples in Linux
  6. How to uninstall ssh software package from Ubuntu
  7. EMC PowerPath Powermt Commands (Cheat Sheet)
  8. ceph: command not found
  9. Swapon Fails To Mount Swap – Gives Invalid Argument Error
  10. How to show line numbers in Gedit

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