* [LARTC] multigateway routing with adsl and dynamic ip
@ 2007-10-29 12:44 sonu chouhan
2007-10-29 13:15 ` Ben Scott
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: sonu chouhan @ 2007-10-29 12:44 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 479 bytes --]
hi
currently i am using redhat enterprise linux 5 for multi gateway routing with 5 internet connection on static ip and all is working fine, now i want to use 5 adsl lines with dynamic ip but there is no doc. in lartc and in nano's how to for dynamic ip, so can u plz help me out
thanks in advance
nilesh chouhan
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[-- Attachment #1.2: Type: text/html, Size: 554 bytes --]
[-- Attachment #2: Type: text/plain, Size: 143 bytes --]
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LARTC] multigateway routing with adsl and dynamic ip
2007-10-29 12:44 [LARTC] multigateway routing with adsl and dynamic ip sonu chouhan
@ 2007-10-29 13:15 ` Ben Scott
2007-10-29 22:17 ` Grant Taylor
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Ben Scott @ 2007-10-29 13:15 UTC (permalink / raw)
To: lartc
On 10/29/07, sonu chouhan <hi100nu@yahoo.com> wrote:
> now i want to use 5 adsl lines with dynamic ip ...
You'll probably have to use a script with variables for all the IP
addresses, and have that script be called by whatever software manages
the dynamic IP address configuration.
Most distributions have a mechanism for doing "custom" things after
an interface comes up. For example, Red Hat and it's derivatives will
call /sbin/ifup-local and /sbin/ifdown-local if they exist.
> can u plz help me out
Can you please use real words? :)
-- Ben
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LARTC] multigateway routing with adsl and dynamic ip
2007-10-29 12:44 [LARTC] multigateway routing with adsl and dynamic ip sonu chouhan
2007-10-29 13:15 ` Ben Scott
@ 2007-10-29 22:17 ` Grant Taylor
2007-10-31 11:18 ` sonu chouhan
2007-10-31 16:34 ` Grant Taylor
3 siblings, 0 replies; 5+ messages in thread
From: Grant Taylor @ 2007-10-29 22:17 UTC (permalink / raw)
To: lartc
On 10/29/07 07:44, sonu chouhan wrote:
> currently i am using redhat enterprise linux 5 for multi gateway routing
> with 5 internet connection on static ip and all is working fine, now i
> want to use 5 adsl lines with dynamic ip but there is no doc. in lartc
> and in nano's how to for dynamic ip, so can u plz help me out
> thanks in advance
Like Ben said, you will need to run a script to manage your dynamic IPs.
One thing to keep in mind is that you will need to run a script that
is aware of each interface's IP address so that it can manage the
multipath nexthop route(s). Thus you can not have a generic script that
is called for each interface in such a way that it is unaware of the
state of the other interfaces.
Grant. . . .
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LARTC] multigateway routing with adsl and dynamic ip
2007-10-29 12:44 [LARTC] multigateway routing with adsl and dynamic ip sonu chouhan
2007-10-29 13:15 ` Ben Scott
2007-10-29 22:17 ` Grant Taylor
@ 2007-10-31 11:18 ` sonu chouhan
2007-10-31 16:34 ` Grant Taylor
3 siblings, 0 replies; 5+ messages in thread
From: sonu chouhan @ 2007-10-31 11:18 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 4080 bytes --]
Thanks ben & Grant,
i am not so much expert in linux and don't have a proper knowledge of script writing, i am showing my problem again in detail below.
i am using 4 adsl lines of an same isp, my adsl modem is working as a nat router so i can get static private ip on my linux multigateway router, all is working fine
but my adsl router's wan port hang sometime in 4 to 5 days, and my linux router don't find that one line is down bcoz gateway is still up (i.e. adsl modem's lan port is working). i have try many different modem of different make but problem is same and when i use adsl modem as a bridge, there is no problem in modem, so i have desided to
change my adsl modem in bridge mode, but my isp only provide dynamic ip and also getting many problem which i am showing you below with my rules which is working fine
IFI=eth1 # local lan card
IPI=172.16.1.1 # local network's ip
NMI=16 # local network's subnet
IFE1=eth0 # adsl internet lan card
IFE2=eth2 # adsl internet lan card
IFE3=eth3 # adsl internet lan card
IFE4=eth4 # adsl internet lan card
IPE1=192.168.1.2 # adsl internet ip
IPE2=10.10.10.2 # adsl internet ip
IPE3=10.10.16.2 # adsl internet ip
IPE4=10.10.1.2 # adsl internet ip
NWE1=192.168.1.0
NWE2=10.10.10.0
NWE3=10.10.16.0
NWE4=10.10.1.0
NME1=24
NME2=24
NME3=24
NME4=24
BRD1=192.168.1.255
BRD2=10.10.10.255
BRD3=10.10.16.255
BRD4=10.10.1.255
GWE1=192.168.1.1
GWE2=10.10.10.1
GWE3=10.10.16.1
GWE4=10.10.1.1
/sbin/ip addr flush dev lo
/sbin/ip addr flush dev $IFI
/sbin/ip addr flush dev $IFE1
/sbin/ip addr flush dev $IFE2
/sbin/ip addr flush dev $IFE3
/sbin/ip addr flush dev $IFE4
/sbin/ip link set lo up
/sbin/ip addr add 127.0.0.1/8 brd + dev lo
/sbin/ip link set $IFI up
/sbin/ip addr add $IPI/$NMI brd + dev $IFI
/sbin/ip rule add prio 50 table main
/sbin/ip route del default table main
/sbin/ip link set $IFE1 up
/sbin/ip addr flush dev $IFE1
/sbin/ip addr add $IPE1/$NME1 brd $BRD1 dev $IFE1
/sbin/ip link set $IFE2 up
/sbin/ip addr flush dev $IFE2
/sbin/ip addr add $IPE2/$NME2 brd $BRD2 dev $IFE2
/sbin/ip link set $IFE3 up
/sbin/ip addr flush dev $IFE3
/sbin/ip addr add $IPE3/$NME3 brd $BRD3 dev $IFE3
/sbin/ip link set $IFE4 up
/sbin/ip addr flush dev $IFE4
/sbin/ip addr add $IPE4/$NME4 brd $BRD4 dev $IFE4
/sbin/ip rule add prio 201 from $NWE1/$NME1 table T1 # problem 1 : how to know the subnet each time ip change
/sbin/ip route add default via $GWE1 dev $IFE1 src $IPE1 proto static table T1 # problem 2 : how to add gw, it's already added. Problem 3 : how to know IPE, it's dynamic
/sbin/ip route append prohibit default table T1 metric 1 proto static
/sbin/ip rule add prio 202 from $NWE2/$NME2 table T2
/sbin/ip route add default via $GWE2 dev $IFE2 src $IPE2 proto static table T2
/sbin/ip route append prohibit default table T2 metric 1 proto static
/sbin/ip rule add prio 203 from $NWE3/$NME3 table T3
/sbin/ip route add default via $GWE3 dev $IFE3 src $IPE3 proto static table T3
/sbin/ip route append prohibit default table T3
/sbin/ip rule add prio 204 from $NWE4/$NME4 table T4
/sbin/ip route add default via $GWE4 dev $IFE4 src $IPE4 proto static table T4
/sbin/ip route append prohibit default table T4
/sbin/ip rule add prio 222 table T6
/sbin/ip route add default table T6 proto static nexthop via $GWE4 dev $IFE4 weight 1 nexthop via $GWE3 dev $IFE3 weight 1 nexthop via $GWE2 dev $IFE2 weight 1 nexthop via $GWE1 dev $IFE1 weight 1
/sbin/ip rule add fwmark 0x11 table T1
/sbin/ip rule add fwmark 0x12 table T2
/sbin/ip rule add fwmark 0x13 table T3
/sbin/ip rule add fwmark 0x14 table T4
/sbin/ip route flush cache
so plz help me out that how can i make a script, and i don't want to run any script manuly bcoz ip does change in every few hours
sorry for my poor english
thanks in advance.
Nilesh..........
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[-- Attachment #1.2: Type: text/html, Size: 4973 bytes --]
[-- Attachment #2: Type: text/plain, Size: 143 bytes --]
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LARTC] multigateway routing with adsl and dynamic ip
2007-10-29 12:44 [LARTC] multigateway routing with adsl and dynamic ip sonu chouhan
` (2 preceding siblings ...)
2007-10-31 11:18 ` sonu chouhan
@ 2007-10-31 16:34 ` Grant Taylor
3 siblings, 0 replies; 5+ messages in thread
From: Grant Taylor @ 2007-10-31 16:34 UTC (permalink / raw)
To: lartc
On 10/31/07 06:18, sonu chouhan wrote:
> i am not so much expert in linux and don't have a proper knowledge of
> script writing, i am showing my problem again in detail below.
Eh, sounds like a good time to learn something with the help of others. ;)
> i am using 4 adsl lines of an same isp, my adsl modem is working as a
> nat router so i can get static private ip on my linux multigateway
> router, all is working fine but my adsl router's wan port hang
> sometime in 4 to 5 days, and my linux router don't find that one line
> is down bcoz gateway is still up (i.e. adsl modem's lan port is
> working). i have try many different modem of different make but
> problem is same and when i use adsl modem as a bridge, there is no
> problem in modem, so i have desided to change my adsl modem in bridge
> mode, but my isp only provide dynamic ip and also getting many
> problem which i am showing you below with my rules which is working
> fine
<snip>
> so plz help me out that how can i make a script, and i don't want to
> run any script manuly bcoz ip does change in every few hours
I will say that based on what I know and have experienced, you are
biting off more than you realize. First there is the fact that with
your modems in bridging mode you will have multiple IPs from the same
provider, probably all on the same subnet and thus all having the same
upstream gateway, which Linux can not (directly) use like you are
wanting to. If your modems are not bridging but rather routing Linux
will indeed not detect that the modem acting as a router has a defunct
out bound connection because it can communicate with the router its self.
Based on my experience, I think you will be better off having some
system handle the routing for each modem. I don't care if you have the
modems act as a router, or bridge them and put a router behind them, or
bridge them and do some VERY fancy stuff with Linux. How ever you do
it, I'd suggest that you use a router that is capable of informing the
other router(s), say your Linux box, when it's ADSL connection is down
and as such to not use said router. Usually this is done with routing
protocols.
With these multiple (physical or virtual) routers Linux will see
different IP addresses for them and as such be able to use them as
'nexthop' gateways thus be able to use them for load balancing / equal
cost multi-path routing. Even if all the modems and your Linux box
share one common small subnet, the fact that the routers have different
IPs make them something that Linux can work with.
(Granted you could do some dastardly things with bridging and the likes
so that Linux thinks that it really does have multiple routers one one
subnet when it really does not, but I think that is more than a bit
beyond what you are asking. For now avoid doing this.)
The reason that Linux is trying to use the modems (acting as a router)
is because it is not aware that the modem (acting as a router) has a bad
connection. Linux's "Dead Gateway Detection" algorithms detect when
they can not reach the immediate upstream gateway on the MAC layer (2).
Thus if Linux can talk to the modem (acting as a router) at all, say
ping it, ARP it, what ever to it, Linux believes the router (a.k.a.
gateway) is very much a live and thus available for use.
(Granted you may be able to do something with ICMP redirects to
encourage the Linux box to use a different router, but this is so far
out of the norm I will not even speculate on the viability. For now
avoid doing this.)
> thanks in advance.
Does this at least help you know what you are up against?
Grant. . . .
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-10-31 16:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-29 12:44 [LARTC] multigateway routing with adsl and dynamic ip sonu chouhan
2007-10-29 13:15 ` Ben Scott
2007-10-29 22:17 ` Grant Taylor
2007-10-31 11:18 ` sonu chouhan
2007-10-31 16:34 ` Grant Taylor
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.