LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   persistent static routes, not so persistent (https://www.linuxquestions.org/questions/linux-networking-3/persistent-static-routes-not-so-persistent-549217/)

Hewson 04-26-2007 11:50 AM

persistent static routes, not so persistent
 
I have observed a strange behavior for my static routes. As of late afternoon my static routes where fine. I came in today and they were gone. I checked uptime. The machine has not rebooted yet all of the routes I had manually configured are gone. Does the kernel after a while reread some file?

Apart from a reboot or some one logging in as root, why else would my static routes disappear from the routing table. (I have 3 network interfaces, all of which are set manually. no DHCP)

Your Thoughts?

-steve

This is on FC6 if that helps at all.
kernel: 2.6.18-1.2798.fc6

MensaWater 04-27-2007 10:14 AM

What did you do to make them "persistent"?

You can setup routing at command line as you already know with the route command but that doesn't make them "persistent".

I've not seen this dropout myself but my coworker says he has.
If something happened to the interface (e.g. eth1) that you'd tied the route to (e.g. someone did and ifconfig eth1 down then an ifconfig eth1 up) then the route would drop. If the NIC burped on its own you'd have the same issue.

You can insure the routes are reestablished at boot (or restart of networking) by adding to /etc/sysconfig/network-scripts/route-<interface>
(e.g. route-eth1). Example would be:
GATEWAY0=10.0.52.54
NETMASK0=255.0.0.0
ADDRESS0=10.0.0.0

That would be the equivalent of the command line:
route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.0.52.54 metric 1

Tap-Out 04-27-2007 10:20 AM

I also think there's a way through the command line to make it persistant.

route add -p I believe it is.

As for why they dropped in the first place I'm not sure what would be causing that. Did all of your persistant routes dissapear or just one or two?

MensaWater 04-27-2007 10:46 AM

"man route" lists no "persistent" option on my FC4 box.

-p on my HP-UX box sets pmtu.

Hewson 04-27-2007 05:09 PM

bad word 'persistent' i meant just static routes that are manually configured.

e.g /sbin/route add -host 192.168.12.12 gw 192.168.1.1


sorry about the confusion.


All times are GMT -5. The time now is 01:25 AM.