Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Routing table

Status
Not open for further replies.

aceed

Technical User
Apr 20, 2003
18
IN
Hi All

I'm running a Fedora box. I want to add a new routing table line using command
route add -net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx dev eth1
no problem, I can ping the other end.

Problem occured when i rebooting the machine. When i run netstat -rn , the line disapeared.

My question, how to create permanent routing table?

Thanks

 
Yup either stick the line at the bottom of the /etc/rc.local file or add a S99Staticroute file in /etc/init.d/rc2.d

"NOTE" interfaces must be up for the routing to take so if you have any High Avalibility fail-over config that shuts down any interface you need to name the script so it starts
before the HA starts.

Good Luck
Laurie
 
Or do it the right way and add it to the /etc/sysconfig/network-scripts config files, which is what the system-config-network gui does.
 
Quite Correct ericbrunson :)

But with *nix theres "allways more than one ways to skin an Elephant" :¬)

L.
 
Well, there's the way the os is set up to boot and you can basically ignore it and leave the next admin behind you to try to figure out what the hell you did, or embrace the infrastructure the vendor created.

Do you bother using the init scripts that come with each of your installed packages or do you delete them and add the startup commands to an rc.local file? Same principle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top