RHEL 7 doesn't support "route" command?

Latest response

I found "route" command is not include in RHEL 7 beta release. Although, we should use "ip route" instead of "route" as much as possibles, there are still old code and scripts using the command "route".

The question is whether the command will be removed or not.

Responses

Hi Yue,

First - try a install if the rpm named "net-tools" and/or see if it exists: If you get no output from the rpm command, it is not installed. The rpm 'net-tools' provides the route command (in rhel 6).

rpm -q net-tools
yum install net-tools

I can't answer (right now, not near my rhel 7 system) if the command will ba removed or not (hopefully someone else can address this), but if you wanted to create a route for a system, another method is
1) create a file called /etc/sysconfig/network-scripts/route-eth0 # make the "eth0" part the name of the interface you want a route for a different subnet...
2) To use the /etc/sysconfig/network-scripts/route-ethX bit, follow the instructions at this link

It looks like you are familiar with the '/sbin/ip r s' (aka '/sbin/ip route sho' , and the ip command can be used to add routes as well), and probably netstat -rn just for queries.

Again, hopefully someone will address if the 'route' command itself, but check to see if yum install net-tools will install it for you (I would suspect net-tools would be on most installations...)

Hello Yue and Remmele,

Looking at the release-notes, I see no plans to mark net-tools as deprecated. However, even the rpm itself notes that most of the binaries in there are obsolete and that we should be looking to the iproute package as much as possible.

I also see some very recent package updates on my RHEL 7 testing system.

That the package is not called out in the Beta Release Notes for deprecation and that I see the package being updated in the latest RHEL 7 composes, is a strong indication that this package will be around for the life of RHEL 7.

Obviously, I'll drop a note to Product Management to confirm my understanding, but at this time, I see no risk to scripts relying on net-tools for the forseeable future, but we would recommend that you investigate updating the scripts to make use of iproute at the earliest opportunity.

Thanks Mark, I've been using /sbin/ip more and more and keep reminding my coworkers of that command's existance and use... I remember hearing in classes that the ip command is a good way to go...

Wandering into the conversation late?

$ sudo -i
[root@gondola ~]# rpm -qf /etc/issue
centos-release-7-7.1908.0.el7.centos.x86_64
[root@gondola ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.2.2        0.0.0.0         UG    0      0        0 eth0
10.0.2.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0

Some common commands were provided for RHEL7; and yes, this one is in the net-tools RPM.

Apple can get away with sweeping UI changed whenever the wind blows. RH should strongly consider the value of a consistent interface with commands valid for 25 years and counting. At least until systemd eats this too ! :-D

The net-tools have been saying they are deprecated on their man pages since about 2010 iirc. Upstream is dead. They don't support any modern stuff like policy routing or namespaces.

Train yourself to not use these anymore. The replacement tools are in the iproute suite, such as ip link and ip addr and ip route and ss and nstat and so on.

[deleted]