LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 07-12-2003, 10:55 AM   #1
rob99
Member
 
Registered: Jan 2003
Posts: 50

Rep: Reputation: 15
how to permanently add route?


Hi,
how to permanently add route to routing table?
I use "ip route add 192.168.0.9 via 192.168.1.5"
and each time I reboot it's gone.
thanks
 
Old 07-12-2003, 10:59 AM   #2
andrew001
Member
 
Registered: Nov 2002
Distribution: Slackware 9.0
Posts: 321

Rep: Reputation: 30
I used to have to do something like that too, and what I ended up doing was just putting a line in /etc/rc.d/rc.local to do it.

I know that's not the most elegant solution, but it works : ).

~Andrew
 
Old 07-12-2003, 11:02 AM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Redhat reads a file called:
/etc/sysconfig/static-routes

If you have redhat you can use that if you don't then your distro may have something similar.
 
Old 07-12-2003, 02:23 PM   #4
rob99
Member
 
Registered: Jan 2003
Posts: 50

Original Poster
Rep: Reputation: 15
thanks guys,
It looks like it work. I use mandrake.
 
Old 07-19-2003, 02:13 AM   #5
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 46
Starting 8.0, atleast on Redhat, static-routes is not being used anymore.

You have to add the entry to /etc/sysconfig/networking/devices/ifcfg-eth0.route .... bit flaky here.
 
Old 07-19-2003, 06:39 AM   #6
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Rep: Reputation: 45
Or use the non elegan solution of the /etc/rc.d/rc.local

I use (in that file) this:

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
permanently add static route glock19 Linux - Networking 26 04-08-2013 04:07 AM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM
ip route add ducati620 Linux - Networking 0 06-06-2004 06:11 AM
How to permanently add localhost via xhost? h00chman Linux - Newbie 1 04-23-2004 11:57 PM
Permanently set "route add" -host and default gw sacants Linux - Newbie 1 07-18-2003 04:04 AM


All times are GMT -5. The time now is 04:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration