Link to home
Start Free TrialLog in
Avatar of marcr69
marcr69

asked on

CLI method to add static routes to RH ES 4

Hello,

I only have command line access to my Red Hat server running ES 4 and I'm looking for the method to add static routes.  There is no static-routes file in the /etc/sysconfig/ directory, and I tried creating one, but that failed to work.  Can anyone help?

Cheers,
Marc
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Create  /etc/sysconfig//static-route file with the following line (or similar syntax):
eth0 net 224.0.0.0 netmask 255.0.0.0

For default gateway, you can add
GATEWAY=192.168.0.1 (or the default router IP address)
into /etc/sysconfig/network.

Then restart the network service:
# service network restart
Woo..... according to
/usr/share/doc/initscripts-*/sysconfig.txt
 that it's not /etc/sysconfig//static-route but /etc/sysconfig/network-scripts//route-<interface>, which Tintin mentioned which the following syntax:
 192.168.2.0/24 dev eth0

Sorry for the previous post.
Avatar of Tintin
Tintin

/etc/sysconfig/static-route

was for Redhat versions <8.0