Re[4]: Two routing cache entries with different interface

Linux Advanced Routing and Traffic Control

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

 



Witaj Tushar,

W Twoim liście datowanym 11 stycznia 2004 (03:42:51) można przeczytać:


TT> hello,
TT> i have seen the script you sent,
TT> but i is for static load balancing,
TT> but i want to do automatic load balancing,

It is automatic load balancing. And it works for me with 3 uplinks
dynamically shared at about 8 Mbits traffic.

TT> allowing nodes to select the gateway dynamically,
TT> so i think tables 201 and 202 are not needed,

No, No, No! Please read the Nano-HOWTO Carefully. Those tables are
essential for proper operation. They take care of the subsequent
packets of the connection. After the first one is matched by
multipath route the gateway is selected and the output adress is
selected. Subsequent connection packets NEED to go through the SAME
interface. Without additional tables they may (and probably will) go out
through invalid interface with invalid source IP thus if there is
properly configured router on their way (eg. a provider which filters
packets not comming from their subnet) everything will die.
(Info taken from Nano currently at: http://www.ssi.bg/~ja/nano.txt ).
As you can see after reading my script is an adopted version of nano
proved to work.

TT> i want to use only 221 (table having nexthop),
TT> and my gateway itself allocates connections very correctly,
TT> but in case of requests from other nodes, it can not transfer,
TT> i hope you would help me in this regard,
TT> Thanx and regards,
TT> ----------------------------------------------------------------
TT> Tushar Thakker
TT> Elitecore Technologies Ltd.
TT> ----------------------------------------------------------------
TT> Life gives all that one deserves, but not all that one desires...
TT> ----------------------------------------------------------------
TT> ----- Original Message -----
TT> From: "Robert Kurjata" <rkurjata@xxxxxxxxxxxxx>
TT> To: "Julian Anastasov" <ja@xxxxxx>
TT> Cc: "Tushar Thakker" <tusharthakker@xxxxxxxxxxxxx>; <lartc@xxxxxxxxxxxxxxx>
TT> Sent: Saturday, January 10, 2004 5:03 AM
TT> Subject: Re[2]:  Two routing cache entries with different interface


>> Witaj Julian,
>>
>> W Twoim liście datowanym 10 stycznia 2004 (11:41:34) można przeczytać:
>>
>>
>> JA> Hello,
>>
>> JA> On Sat, 10 Jan 2004, Tushar Thakker wrote:
>>
>> >> hi all,
>> >> i am setting up a load balancing netwrok with failover,
>> >> i have applied julian patch,
>> >> but whenever i try to traceroute from any client node, it gives
>> >> me two entries for that destination, but i get different interface
>> >> for that entries,
>> >> so it doesn't forward my requests,
>> >> i have done masquerading for client nodes,
>> >>
>> >> the ip rule/route are as follows,
>> >>
>> >>         ip rule add prio 222 table 222
>> >>         ip route add default table 222 proto static \
>> >>                 nexthop via $GWE1 dev $IFE1 weight 1\
>> >>                 nexthop via $GWE2 dev $IFE2 weight 1
>> >>
>> >> Now after traceroute failure, if i see the routing cache for that ip,
TT> it shows following,
>>
>> JA> output route, probably created from -j MASQUERADE?:
>>
>> >> 205.158.62.141 via 203.88.135.213 dev eth1  src 203.88.135.212
>> >>     cache  mtu 1500 advmss 1460
>>
>> JA> input route:
>>
>> >> 205.158.62.141 from 192.168.1.51 via 203.88.135.205 dev eth2 src
TT> 192.168.1.242
>> >>     cache <src-direct>  mtu 1500 advmss 1460 iif eth0
>> >>
>> >> please see eth1 and eth2 in both entries,
>>
>> JA> Nothing strange so far, may be they are created from different
>> JA> connections. In fact, there should be more cache entries.
>>
>> >> now it does not forward this request,
>>
>> JA> Can you provide more information, in private mail if you
>> JA> prefer so, including:
>>
>> JA> - tcpdump output(s) for all interfaces during the traceroute
>> JA> - topology: are eth1 and eth2 connected to same hub?
>> JA> - ip rules and routes
>>
>> JA> I hope you really have the "routes" patch applied and
>> JA> running.
>>
>> >> what can be the reason behind this and please can anyone suggest me the
TT> solution,
>> >> thanx in advance,
>> >> Regards,
>> >>
>> >> ----------------------------------------------------------------
>> >> Tushar Thakker
>> >> Elitecore Technologies Ltd.
>>
>> JA> Regards
>>
>> JA> --
>> JA> Julian Anastasov <ja@xxxxxx>
>>
>> JA> _______________________________________________
>> JA> LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
>> JA> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>>
>> try this, after applying routes patch it works fine (for me it works
>> when I upgraded it to 3 uplinks):
>>
>> ---------------------------cut
TT> here------------------------------------------
>>
>> #!/bin/bash
>> # This script is done by : Robert Kurjata Sep, 2003.
>> # feel free to use it in any usefull way
>>
>> # CONFIGURATION
>> IP=/sbin/ip
>> PING=/bin/ping
>>
>> #--------------- LINK PART -----------------
>> # EXTIFn - interface name
>> # EXTIPn - outgoing IP
>> # EXTMn  - netmask length (bits)
>> # EXTGWn - outgoing gateway
>> #-------------------------------------------
>>
>> # LINK 1
>> EXTIF1=eth2
>> EXTIP1=
>> EXTM1=
>> EXTGW1=
>>
>> # LINK 2
>> EXTIF2=eth1
>> EXTIP2=
>> EXTM2=
>> EXTGW2=
>>
>> #ROUTING PART
>> # removing old rules and routes
>>
>> echo "removing old rules"
>> ${IP} rule del prio 50 table main
>> ${IP} rule del prio 201 from ${EXTIP1}/${EXTM1} table 201
>> ${IP} rule del prio 202 from ${EXTIP2}/${EXTM2} table 202
>> ${IP} rule del prio 221 table 221
>> echo "flushing tables"
>> ${IP} route flush table 201
>> ${IP} route flush table 202
>> ${IP} route flush table 221
>> echo "removing tables"
>> ${IP} route del table 201
>> ${IP} route del table 202
>> ${IP} route del table 221
>>
>> # setting new rules
>> echo "Setting new routing rules"
>>
>> # main table w/o default gateway here
>> ${IP} rule add prio 50 table main
>> ${IP} route del default table main
>>
>> # identified routes here
>> ${IP} rule add prio 201 from ${EXTIP1}/${EXTM1} table 201
>> ${IP} rule add prio 202 from ${EXTIP2}/${EXTM2} table 202
>>
>> ${IP} route add default via ${EXTGW1} dev ${EXTIF1} src ${EXTIP1} proto
TT> static table 201
>> ${IP} route append prohibit default table 201 metric 1 proto static
>>
>> ${IP} route add default via ${EXTGW2} dev ${EXTIF2} src ${EXTIP2} proto
TT> static table 202
>> ${IP} route append prohibit default table 202 metric 1 proto static
>>
>> # mutipath
>> ${IP} rule add prio 221 table 221
>>
>> ${IP} route add default table 221 proto static \
>>             nexthop via ${EXTGW1} dev ${EXTIF1} weight 2\
>>             nexthop via ${EXTGW2} dev ${EXTIF2} weight 3
>>
>> ${IP} route flush cache
>>
>> while : ; do
>>   ${PING} -c 1 ${EXTGW1}
>>   ${PING} -c 1 ${EXTGW2}
>>   sleep 60
>> done
>>
>> ---------------------------cut
TT> here------------------------------------------
>>
>>
>>
>> --
>> Pozdrowienia,
>>  Robert
>>
>>



-- 
Pozdrowienia,
 Robert

_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux