All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pankaj Agarwal" <pankaj@toughguy.net>
To: lartc@vger.kernel.org
Subject: [LARTC] please guide me ...with regard to multipath dynamic routing in case of link failure
Date: Mon, 07 Feb 2005 14:52:26 +0000	[thread overview]
Message-ID: <003201c50d24$5e650670$8d00150a@dreammac> (raw)

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/

             reply	other threads:[~2005-02-07 14:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-07 14:52 Pankaj Agarwal [this message]
2005-02-08 12:55 ` [LARTC] please guide me ...with regard to multipath dynamic routing Nguyen Dinh Nam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003201c50d24$5e650670$8d00150a@dreammac' \
    --to=pankaj@toughguy.net \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.