Link to home
Start Free TrialLog in
Avatar of ConnieCA
ConnieCA

asked on

Creating static routes in RHL9

Newbie question...

Just got our routing tables set right in our lab. Need these routes to be static. Can you tell me how to set these routes to be permanent so that they won't go away during reboot?

Our routing tables for our two RHL9 servers look like this...

GOLDCOIN

207.192.10.0 * 255.255.255.0 U 0 0 0 eth1
207.192.75.0 * 255.255.255.0 U 0 0 0 eth1
192.168.10.0 trojan.thompson 255.255.255.0 UG 0 0 0 eth1
192.168.75.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0 0 * 255.255.0.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default goldcoin.thompson 0.0.0.0 UG 0.0.0 eth1

TROJAN

207.192.10.0 * 255.255.255.0 U 0 0 0 eth1
207.192.75.0 * 255.255.255.0 U 0 0 0 eth1
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
192.168.75.0 goldcoin.thompson 255.255.255.0 UG 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default Trojan.thompson 0.0.0.0 UG 0 0 0 eth1

Thanks in advance...
ASKER CERTIFIED SOLUTION
Avatar of paullamhkg
paullamhkg

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
SOLUTION
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
Avatar of lazykoder
lazykoder

you can store all the commands that you used to setup this whole routing table in a bash script, like:

---code----
#!/bin/bash

route add ....
route add ....

----code----

and then call this script from your /etc/rc.d/rc.local script. This is an easier way to do it if u r not comfortable with modifying the system config files.
you can just put the commands in /etc/rc.local and the routes will be there just add lines like these
/sbin/route add ......
at the end of rc.local