Pankaj Agarwal
2005-Feb-07 14:50 UTC
please guide me ...with regard to multipath dynamic routing in case of link failure
Hi, There''s some very silly mistake i''ve done in my configuration. I did by reading material on web. I''m enclosing my configuration script below. The problem is its not routing the trafic from other interface in case the first interface is down....which should be the wright case. Kindly please guide me what i can do to make it work..dynamically.. Also there is a very common situation which many of you might have face...the interface which is gateway for my device is my local router interface...and there''s almost no chance of that''s being down ever...How can one configure ip route to consider the ISP ends IP as the gateway when deciding on link status... Thanks, Pankaj Agarwal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~The Script~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #!/bin/sh #script written by Pankaj Agarwal <pankaj@netedgecomputing.com> #defining location of ip binary IP=/sbin/ip #flushing all the IP/Routing cache echo "removing old rules" $IP rule del prio 50 table main $IP rule del prio 201 from 61.11.104.0/24 table 201 $IP rule del prio 202 from 220.227.153.48/28 table 202 $IP rule del prio 222 table 222 echo "flushing tables" $IP route flush table 201 $IP route flush table 202 $IP route flush table 222 echo "removing tables" $IP route del table 201 $IP route del table 202 $IP route del table 222 #setting loop interface $IP link set lo up $IP addr flush dev lo $IP addr add 127.0.0.1/8 brd + dev lo #setting up the private device $IP link set eth1 up $IP addr flush dev eth1 $IP addr add 192.168.2.5/24 brd + dev eth1 $IP rule add prio 50 table main $IP route del default table main #setting up the public devices $IP link set eth0 up $IP addr flush dev eth0 $IP addr add 61.11.104.63/24 brd 61.11.104.255 dev eth0 $IP link set eth2 up $IP addr flush dev eth2 $IP addr add 220.227.153.61/28 brd 220.227.153.63 dev eth2 #configuring route $IP rule add prio 222 table 222 $IP route add default table 222 proto static nexthop via 61.11.104.1 dev eth0 weight 1 nexthop via 220.227.153.51 dev eth2 weight 3 #configuring for static routes for one connection $IP rule add prio 201 from 61.11.104.0/24 table 201 $IP route add default via 61.11.104.1 dev eth0 src 61.11.104.63 proto static table 201 $IP route append prohibit default table 201 metric 1 proto static $IP rule add prio 202 from 220.227.153.48/28 table 202 $IP route add default via 220.227.153.51 dev eth2 src 220.227.153.61 proto static table 202 $IP route append prohibit default table 202 metric 1 proto static $IP route flush cache while : ; do /bin/ping -c 1 220.227.153.51 >> /dev/null /bin/ping -c 1 61.11.104.1 >>/dev/nyll sleep 60 done _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Nguyen Dinh Nam
2005-Feb-08 12:55 UTC
Re: [LARTC] please guide me ...with regard to multipath dynamic routing in case of link failure
So you have to write a daemon to ping the remote gateway, and if ping fails, the daemon will remove that nexthop from the multipath route. The dead gateway detection patch can''t help you in this case. That''s why I created this project, download and run it, and everything solved, it''s lack of documentation, so you''re welcome to write it in the Wiki. http://selab.edu.ms/twiki/bin/view/Networking/RoutesKeeperProject Pankaj Agarwal wrote:> Hi, > > There''s some very silly mistake i''ve done in my configuration. I did > by reading material on web. I''m enclosing my configuration script > below. The problem is its not routing the trafic from other interface > in case the first interface is down....which should be the wright > case. Kindly please guide me what i can do to make it > work..dynamically.. Also there is a very common situation which many > of you might have face...the interface which is gateway for my device > is my local router interface...and there''s almost no chance of that''s > being down ever...How can one configure ip route to consider the ISP > ends IP as the gateway when deciding on link status... > > Thanks, > > Pankaj Agarwal- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html