Search My Techie Guy

Wednesday, August 20, 2014

ip route add - rhel 6.2 and making the route persistent through server reboots

Here is how to add an ip route on the rhel 6.2 command line.

ip route add prefix dev interface src interface_ip via gateway

For example:

ip route add dev eth3 src via

To make this change persistent after server reboots, add the command to the /etc/rc.local script.

# more /etc/rc.local 
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
ip route add dev eth3 src via
Post a Comment