How to Add Persistent Static Routes in CentOS 5.6

Share this Article :

This example will show you on how to configure the persistent static route in CentOS 5.6 server. This configuration may different with other version of CentOS but the basic is almost the same. Persistent static route will permanently stored the setting and will not be deleted after rebooted.

1. Go to /etc/sysconfig/network-scripts/

[[email protected] ~]# cd /etc/sysconfig/network-scripts/

2. Modify the original default route to your requirement.

[[email protected] network-scripts]# vi route-eth0 dev eth0 scope host
default via

Change to below : dev eth0 scope host
default via via dev eth0

3. Restart the network to apply the new routing table

[[email protected] network-scripts]# service network restart
[[email protected] network-scripts]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface   UG        0 0          0 eth0   U         0 0          0 eth0     U         0 0          0 eth0         U         0 0          0 eth0

Leave a Reply