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

[root@linuxcnf ~]#

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

[root@linuxcnf ~]# which netstat
[root@linuxcnf ~]#

[root@linuxcnf ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    100    0        0 eth0         UG    101    0        0 eth1   U     100    0        0 eth0   U     101    0        0 eth1
[root@linuxcnf ~]#

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

No comments:

Post a Comment