Static route in linux getting flushed from the routing table

I have added a persistant static route in my RHEL5 machine by configuring a /etc/sysconfig/network-scripts/route-bond0 file. The entry in the file is as below 172.23.38.170/32 via 172.23.31.203 dev ppp0 (I am using a USB CDMA modem to connect to another server). The kernel IP table output is given below -
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.23.31.203   *               255.255.255.255 UH    0      0        0 ppp0
172.23.38.170   172.23.31.203   255.255.255.255 UGH   0      0        0 ppp0
192.168.3.0     *               255.255.255.0   U     0      0        0 bond0
169.254.0.0     *               255.255.0.0     U     0      0        0 bond0
default         192.168.3.3     0.0.0.0         UG    0      0        0 bond0

Now the problem is, the static route to 172.23.38.170 gets flushed from the table from time to time. What could be the reason and how do I make this route?
Meru_ITAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bouguiCommented:
Probably that youre route get flush when ppp goes down and up again could that be ?

If this is the case put your route in a file like this one /etc/ppp/ip-up.local.

Bye
0
Meru_ITAuthor Commented:
Thanks bouqui...I have added the route in the /etc/ppp/ip-up.local file as /sbin/route add -host x.x.x.x gw x.x.x.x.
Hope the syntax is fine.
0
uaynebCommented:
The "time to time" thing usually I check cron jobs.  Have you noticed it happening at a regular time of the day / day of the week?   Perhaps there's a cron job that does it.

Otherwise I haven't heard of this before

You could try it by grepping for "route" in your cron directories to see if something comes up.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Meru_ITAuthor Commented:
Hi bouqui, adding the route in ip-up.local helped and it adds the route in the kernel routing table every time my CDMA USB modem reconnects automatically. However, I found something which may be the route cause of the problem and I am still clueless why this is happening.
I had run a continuous ping to the remote server through the ppp connection and this is what I got -
64 bytes from 172.23.38.170: icmp_seq=54 ttl=121 time=2146 ms
64 bytes from 172.23.38.170: icmp_seq=55 ttl=121 time=1194 ms
64 bytes from 172.23.38.170: icmp_seq=56 ttl=121 time=322 ms
64 bytes from 172.23.38.170: icmp_seq=57 ttl=121 time=448 ms
64 bytes from 172.23.38.170: icmp_seq=58 ttl=121 time=164 ms
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available

At this moment when I check my kernel routing table, I can see the route there, have a look -
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.23.31.203   *               255.255.255.255 UH    0      0        0 ppp0
172.23.38.170   172.23.31.203   255.255.255.255 UGH   0      0        0 ppp0
192.168.3.0     *               255.255.255.0   U     0      0        0 bond0
169.254.0.0     *               255.255.0.0     U     0      0        0 bond0
default         192.168.3.3     0.0.0.0         UG    0      0        0 bond0

In /var/log/messages I see this -
Apr 22 13:26:03 vtmscsws1 pppd[23145]: Connect time 11.2 minutes.
Apr 22 13:26:03 vtmscsws1 pppd[23145]: Sent 1659 bytes, received 374 bytes.
Apr 22 13:26:03 vtmscsws1 pppd[23145]: CHAP authentication succeeded: CHAP authentication success, unit 47441704
Apr 22 13:26:03 vtmscsws1 pppd[23145]: CHAP authentication succeeded
Apr 22 13:26:04 vtmscsws1 pppd[23145]: not replacing existing default route via 192.168.3.3
Apr 22 13:26:04 vtmscsws1 pppd[23145]: local  IP address 172.23.201.254
Apr 22 13:26:04 vtmscsws1 pppd[23145]: remote IP address 172.23.31.203
Apr 22 13:47:18 vtmscsws1 pppd[23145]: Connect time 21.3 minutes.
Apr 22 13:47:18 vtmscsws1 pppd[23145]: Sent 653 bytes, received 482 bytes.
Apr 22 13:47:18 vtmscsws1 pppd[23145]: CHAP authentication succeeded: CHAP authentication success, unit 55391000
Apr 22 13:47:18 vtmscsws1 pppd[23145]: CHAP authentication succeeded
Apr 22 13:47:19 vtmscsws1 pppd[23145]: not replacing existing default route via 192.168.3.3
Apr 22 13:47:19 vtmscsws1 pppd[23145]: local  IP address 172.23.201.254
Apr 22 13:47:19 vtmscsws1 pppd[23145]: remote IP address 172.23.31.203
Apr 22 14:41:32 vtmscsws1 pppd[23145]: Connect time 54.3 minutes.
Apr 22 14:41:32 vtmscsws1 pppd[23145]: Sent 67435 bytes, received 73159 bytes.
Apr 22 14:41:33 vtmscsws1 pppd[23145]: CHAP authentication succeeded: CHAP authentication success, unit 47426240
Apr 22 14:41:33 vtmscsws1 pppd[23145]: CHAP authentication succeeded
Apr 22 14:41:34 vtmscsws1 pppd[23145]: not replacing existing default route via 192.168.3.3
Apr 22 14:41:34 vtmscsws1 pppd[23145]: local  IP address 172.23.201.254
Apr 22 14:41:34 vtmscsws1 pppd[23145]: remote IP address 172.23.31.203

--which means the modem is continuously disconnecting on its own and reconnection for some reason (note the same modem runs fine when I connect from a WinXP host)

Another strange observation is from the dmesg output -
bond0: no IPv6 routers present
bonding: bond0: Removing slave eth0
bonding: bond0: Warning: the permanent HWaddr of eth0 - 00:25:B3:E6:B4:A8 - is still in use by bond0. Set the HWaddr of eth0 to a different address to avoid conflicts.
bonding: bond0: releasing active interface eth0
bonding: bond0: Removing slave eth1
bonding: bond0: releasing active interface eth1
ADDRCONF(NETDEV_UP): bond0: link is not ready
bonding: bond0: Adding slave eth0.
bnx2: eth0: using MSIX
bonding: bond0: enslaving eth0 as an active interface with a down link.
bonding: bond0: Adding slave eth1.
bnx2: eth1: using MSIX
bonding: bond0: enslaving eth1 as an active interface with a down link.
bnx2: eth0 NIC Copper Link is Up, 100 Mbps full duplex
bonding: bond0: link status definitely up for interface eth0.
bonding: bond0: making interface eth0 the new active one.
bonding: bond0: first active interface up!

-- this is continuously getting logged.
I am relatively new to linux and not been able to relate these events and find the root cause. My RHEL support also couldn't help asking me to check with the ISP, whereas I am pretty sure the ISP has nothing to do here since there is no issue when I connect from the XP box.

Sorry for the long post...wanted to give as much info as possible.

Thanks all in advance.
0
Meru_ITAuthor Commented:
P.S. uayneb, there is nothing in the cron directories which can be the culprit
0
bouguiCommented:
Hi,

your bond config seem to be problematic .....

bond is using ethtool for interface status and maybe your interface are not well supported.

I would first delete the bond config and just used eth0 or eth1 for your lan.

Maybe this will stabilise your env

let me know
0
bouguiCommented:
Hu is this a 2 netword card PC ?

Bye
0
Meru_ITAuthor Commented:
Yes, this is a HP server with 2 NICs
0
bouguiCommented:
Just to be sure ..

Your ppp link is with a usb port not with one of your networfk card.

Have you try to unbond your card and see if your server ir more stable ?

Bye
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Meru_ITAuthor Commented:
The issue was partially solved
0
konnieCommented:
Adding a static route

O centOS 5.4 I have configured route-bond0.105 with route addresses
Then run the follwoing

modprobe bonding
service network restart

yet, the new addresses are not reflected in the kernel.  How wlse can I make adding static route persistent.  The last three line in the file are not being picked up by the kernel. Help anybody. thanks

Below is the configuration of my route-bond0.105 file

default via 10.155.242.65
10.123.46.0/24 via 10.155.242.65 table main
10.123.51.0/24 via 10.155.242.65 table main
10.77.74.0/23 via 10.155.242.65 table main
10.155.242.0/24 via 10.155.242.65 table main
208.4.121.0/24 via 10.155.242.65 table main
10.31.128.0/24 via 10.155.242.65 table main
10.155.244.0/24 via 10.155.242.65 table main
10.155.245.0/24 via 10.155.242.65 table main
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.