LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   how to permanently add route? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-permanently-add-route-72138/)

rob99 07-12-2003 10:55 AM

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

andrew001 07-12-2003 10:59 AM

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

david_ross 07-12-2003 11:02 AM

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.

rob99 07-12-2003 02:23 PM

thanks guys,
It looks like it work. I use mandrake.

ppuru 07-19-2003 02:13 AM

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.

Thetargos 07-19-2003 06:39 AM

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


All times are GMT -5. The time now is 11:20 PM.