Saturday, 14 September 2019

How to resolve “-bash: route: command not found” on CentOS 7



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

[root@linuxcloudy ~]# route -n
-bash: route: command not found
[root@linuxcloudy ~]#

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

[root@linuxcloudy ~]# yum install net-tools
Loaded plugins: fastestmirror
……………………………..
Installed:
  net-tools.x86_64 0:2.0-0.24.20131004git.el7

Complete!
[root@linuxcloudy ~]#

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

[root@linuxcloudy ~]# which route
/usr/sbin/route
[root@linuxcloudy ~]#

[root@linuxcloudy ~]# 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
[root@linuxcloudy ~]#

Done!!! Now the route command is available in the system.

No comments:

Post a Comment