Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 07-12-2003, 11:55 AM   #1
Registered: Jan 2003
Posts: 50

Rep: Reputation: 15
how to permanently add route?

how to permanently add route to routing table?
I use "ip route add via"
and each time I reboot it's gone.
Old 07-12-2003, 11:59 AM   #2
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 : ).

Old 07-12-2003, 12:02 PM   #3
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 65
Redhat reads a file called:

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

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

Rep: Reputation: 49
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, 07:39 AM   #6
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


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 27 07-27-2015 05:59 PM
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 05:34 AM
ip route add ducati620 Linux - Networking 0 06-06-2004 07:11 AM
How to permanently add localhost via xhost? h00chman Linux - Newbie 1 04-24-2004 12:57 AM
Permanently set "route add" -host and default gw sacants Linux - Newbie 1 07-18-2003 05:04 AM

All times are GMT -5. The time now is 12:26 AM.

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