Google
  Web www.spinics.net

Re: multigateway routing with adsl and dynamic ip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


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

_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Bugtraq]     [Fedora Legacy]     [GCC Help]     [Yosemite News]     [Yosemite Photos]     [IP Tables]     [Netfilter Devel]     [Fedora Users]

Powered by Linux