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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a static route

Status
Not open for further replies.

warmongr

MIS
Mar 17, 1999
214
US
I need to add a static route using IP ROUTE 2 such as

ip route add 10.0.0.0/24 dev eth0 mtu 1340 advmss 1300 via 10.0.4.1

How do I make that static so that if I need to do a service network restart, that route is automagically restored.

Thanks,
Nate
 
The first two Google hits for "linux static route" seem to cover RedHat, Debian and Gentoo pretty well.

Another, fairly universal, option is to add it to rc.local.
 
It's GOOGLE for christ's sake. How many PhD's do they have over there. They should have known what I meant when I entered any one of my search criteria (just not that one lgarner). :)

Thanks, I knew you could put static routes in /etc/sysconfig/network-scripts/route-eth0 for example. What I didn't know was that you could also use advanced routing qualifiers such as mtu and advmss. Using vi I added

10.0.0.0/24 dev eth0 mtu 1340 advmss 1300 via 10.0.4.1

and it worked.

Sorry to waste your time. I would rather not use rc.local in the event someone enters service network restart.

Again thanks.
Nate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top