Is it possible to have a route stick in the kernel, even if device it points to goes to roller coaster up and down drive. For example. I have an ADSL modem and am doing VPN over it. There's a route needed for VPN added like this: ip route add 192.168.1.0/24 via 1.2.3.4 src 192.168.2.1 There are two problems with it: a) if ADSL link is down when above command is executed, the route command will fail (ppp0 is down, so there's no 1.2.3.4) b) if ADSL link is up when above command is executed, but it goes down (and up again) later, the route is removed from kernel routing tables So, if there are any problems with ADSL link, I need to manually reset my VPN setup. I could write some monitoring script (and call it from cron) that would check if route is present and attempt to readd it if needed, but I'd rather be able to have the route either sticky (not removed when interface goes down) or automatically reenabled by the kernel when interface goes up again. Thanks, Aleksandar Milivojevic ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
Yes, /etc/sysconfig/static-routes Regards, Dan On Aug 5, 2005, at 8:06 AM, Aleksandar Milivojevic wrote:> Is it possible to have a route stick in the kernel, even if device > it points to > goes to roller coaster up and down drive. > > For example. I have an ADSL modem and am doing VPN over it. > There's a route > needed for VPN added like this: > > ip route add 192.168.1.0/24 via 1.2.3.4 src 192.168.2.1 > > There are two problems with it: > > a) if ADSL link is down when above command is executed, the route > command will > fail (ppp0 is down, so there's no 1.2.3.4) > > b) if ADSL link is up when above command is executed, but it goes > down (and up > again) later, the route is removed from kernel routing tables > > So, if there are any problems with ADSL link, I need to manually > reset my VPN > setup. > > I could write some monitoring script (and call it from cron) that > would check if > route is present and attempt to readd it if needed, but I'd rather > be able to > have the route either sticky (not removed when interface goes down) or > automatically reenabled by the kernel when interface goes up again. > > Thanks, > Aleksandar Milivojevic > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >
Am Fr, den 05.08.2005 schrieb Aleksandar Milivojevic um 17:06:> Is it possible to have a route stick in the kernel, even if device it points to > goes to roller coaster up and down drive. > > For example. I have an ADSL modem and am doing VPN over it. There's a route > needed for VPN added like this: > > ip route add 192.168.1.0/24 via 1.2.3.4 src 192.168.2.1 > > There are two problems with it: > > a) if ADSL link is down when above command is executed, the route command will > fail (ppp0 is down, so there's no 1.2.3.4) > > b) if ADSL link is up when above command is executed, but it goes down (and up > again) later, the route is removed from kernel routing tables > > So, if there are any problems with ADSL link, I need to manually reset my VPN> Aleksandar MilivojevicThe network scripts are prepared for this. Create a file called /etc/sysconfig/network-scripts/route-<devicename> with content "192.168.1.0/24 via 1.2.3.4 src 192.168.2.1" (the ip route add is executed by the network script automatically). You can read about that in /usr/share/doc/initscripts*/sysconfig.txt. Alexander -- Alexander Dalloz | Enger, Germany | GPG http://pgp.mit.edu 0xB366A773 legal statement: http://www.uni-x.org/legal.html Fedora Core 2 GNU/Linux on Athlon with kernel 2.6.11-1.35_FC2smp Serendipity 17:27:11 up 15:30, 19 users, 0.10, 0.08, 0.06 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: Dies ist ein digital signierter Nachrichtenteil URL: <http://lists.centos.org/pipermail/centos/attachments/20050805/51c6b55c/attachment-0002.sig>
Aleksandar Milivojevic wrote:> Is it possible to have a route stick in the kernel, even if device it points to > goes to roller coaster up and down drive. > > For example. I have an ADSL modem and am doing VPN over it. There's a route > needed for VPN added like this: > > ip route add 192.168.1.0/24 via 1.2.3.4 src 192.168.2.1 > > There are two problems with it: > > a) if ADSL link is down when above command is executed, the route command will > fail (ppp0 is down, so there's no 1.2.3.4) > > b) if ADSL link is up when above command is executed, but it goes down (and up > again) later, the route is removed from kernel routing tables > > So, if there are any problems with ADSL link, I need to manually reset my VPN > setup. > > I could write some monitoring script (and call it from cron) that would check if > route is present and attempt to readd it if needed, but I'd rather be able to > have the route either sticky (not removed when interface goes down) or > automatically reenabled by the kernel when interface goes up again.no need. create /etc/ppp/ip-up.local and /etc/ppp/ip-down.local to handle these. When ADSL goes up, the pppd daemon can run ip-up.local to setup the routes needed and when it goes down, the pppd daemon can run ip-down.local to fix things or remove those routes. However, ADSL and VPN may imply move than one ppp interface (pptp based vpns) and if that is the case you want to add logic to differentiate whether you are handling the ADSL ppp interface or the VPN interface.
>>ip route add 192.168.1.0/24 via 1.2.3.4 src 192.168.2.1> The network scripts are prepared for this. Create a file called > /etc/sysconfig/network-scripts/route-<devicename> with content > "192.168.1.0/24 via 1.2.3.4 src 192.168.2.1" (the ip route add is > executed by the network script automatically). You can read about that > in /usr/share/doc/initscripts*/sysconfig.txt.ADDRESS0=192.168.1.0 NETMASK0=255.255.255.0 PREFIX=255.255.255.0 GATEWAY0=1.2.3.4
} Is it possible to have a route stick in the kernel, even if device it } points to } goes to roller coaster up and down drive. } } For example. I have an ADSL modem and am doing VPN over it. There's a } route } needed for VPN added like this: } } ip route add 192.168.1.0/24 via 1.2.3.4 src 192.168.2.1 } } There are two problems with it: } } a) if ADSL link is down when above command is executed, the route command } will } fail (ppp0 is down, so there's no 1.2.3.4) } } b) if ADSL link is up when above command is executed, but it goes down } (and up } again) later, the route is removed from kernel routing tables } } Thanks, } Aleksandar Milivojevic off topic may i ask what brand and model of adsl modem you are using? i am guessing it is an internal unit and works with Linux and specifically CentOS :) -- Robert Hanson Abba Communications http://www.abbacomm.net