Sunday, 24 November 2019

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



By default route command is not available in CentOS8 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 CentOS8 minimal installation.

This article describes How to resolve “-bash: route: command not found” on CentOS8.

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

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

[root@linuxcnf ~]# dnf install net-tools
CentOS-8 – AppStream
…………………….
Installed:
  net-tools-2.0-0.51.20160912git.el8.x86_64

Complete!
[root@linuxcnf ~]#

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

[root@linuxcnf ~]# which netstat
/usr/sbin/route
[root@linuxcnf ~]#

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

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

No comments:

Post a comment