Re[2]: 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 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, 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 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 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 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 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 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 here------------------------------------------



-- 
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