LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: 2.2.12 and tunneling Now way?

To: Dietmar Kling <dietmar.kling@xxxxxxxxxx>
Subject: Re: 2.2.12 and tunneling Now way?
Cc: linux-virtualserver@xxxxxxxxxxxx
From: Wensong Zhang <wensong@xxxxxxxxxxxx>
Date: Thu, 16 Sep 1999 23:21:36 +0800
Hi,

Sorry for the delay.

It is the ARP problem of kernel 2.2.xx that all devices do
ARP response except devices configured with the 127.x.x.x 
address.

I used to make a simple patch to make the tunnel device
of kernel 2.2.xx not to do ARP response. Apply the attached
patch to the kernel source on real servers, then rebuild
the kernel with tunneling support.

Hope it works,

Wensong


Dietmar Kling wrote:
> 
> Hello,
> 
> i trying to setup a vrtual server in 2.2.12
> 
> but i have problem (of understanding the docs?)
> 
> As far as I know you have to apply the VS-patch to the director box and
> to the real servers
> if all of them are 2.2 kernel . So ar mine.
> 
> I setup my RealServer box like this
> --------------------------------------
> #!/bin/sh
> SERVER=192.168.100.77
> BROADCAST=192.168.100.255
> /sbin/insmod ipip
> ifconfig -noarp tunl0 $SERVER netmask 255.255.255.255 broadcast
> $BROADCAST up
> route add -host $SERVER dev tunl0
> -------------------------------------------------------------------
> 
> the problem:
> this box responds to the configured 192.168.100.77 virtual address
> so all traffice goes directly to 192.168.100.77 (you see no entries in
> Director ipvsadm -L)
> 
> ping 192.168.100.77 reveals that the box does pass by the real server.
> What I am doing wrong ?
> 
> (if i turn of the real server box, the director box connects to
> 192.168.100.77)
> my setup for the directory:
> 
> Director Setup
> -----------------------------------------------------------------
> VIRTUAL_SERVER="192.168.100.77"
> #VIRTUAL_SERVER_POLICY="wlc"  # WLC scheduling used for this virtual
> service
> VIRTUAL_SERVER_POLICY="wlc"  # WLC scheduling used for this virtual
> service
> FORWARDING="i"
> REAL_SERVERS="192.168.100.1" # 192.168.100.3"
> PATH=$PATH:/sbin
> 
> echo 1 >/proc/sys/net/ipv4/ip_forward
> 
> case "$1" in
> start)
>  #  Add virtual ipaddr
> 
>  ifconfig eth0:2 $VIRTUAL_SERVER netmask 255.255.255.255 broadcast \
>    $VIRTUAL_SERVER up
>  route add -host $VIRTUAL_SERVER dev eth0:2
> 
>  ipvsadm -A -t $VIRTUAL_SERVER:80 -s $VIRTUAL_SERVER_POLICY
>  for SERVER in $REAL_SERVERS;
>  do
>   echo Adding $SERVER ...
>   ipvsadm -a -t $VIRTUAL_SERVER:80 -R $SERVER -$FORWARDING -w 1
>  done
>  ;;
> stop)
>  # Delete virtual ipaddr
>  route del -host $VIRTUAL_SERVER dev eth0:2
>  ifconfig eth0:2 down
> 
>  # Delete
>  for SERVER in $REAL_SERVERS;
>  do
>   echo Removing $SERVER ...
>   ipvsadm -d -t $VIRTUAL_SERVER:80 -r $SERVER
>  done
>  ipvsadm -D -t $VIRTUAL_SERVER:80
>  ;;
> list)
>  ipvsadm
>  ;;
> *)
>  echo "Usage: virtualserver {start|stop|list}"
>  exit 1
> esac
> exit 0
> .------------------------------------
> 
> Regards
> Dietmar
> 
--- linux/net/ipv4/arp.c        Sat Apr  3 17:56:26 1999
+++ linux-tunl/net/ipv4/arp.c   Sat Apr  3 21:08:54 1999
@@ -65,6 +65,7 @@
  *                                     clean up the APFDDI & gen. FDDI bits.
  *             Alexey Kuznetsov:       new arp state machine;
  *                                     now it is in net/core/neighbour.c.
+ *              Wensong Zhang   :       NOARP device (such as tunl) arp fix.
  */
 
 /* RFC1122 Status:
@@ -534,6 +535,7 @@
        struct rtable *rt;
        unsigned char *sha, *tha;
        u32 sip, tip;
+       struct device *tdev;
        u16 dev_type = dev->type;
        int addr_type;
        struct in_device *in_dev = dev->ip_ptr;
@@ -627,6 +629,13 @@
  *     addresses.  If this is one such, delete it.
  */
        if (LOOPBACK(tip) || MULTICAST(tip))
+               goto out;
+
+/* 
+ *      Check for the device flags for the target IP. If the IFF_NOARP
+ *      is set, just delete it. No arp reply is sent.    -- WZ
+ */ 
+       if ((tdev = ip_dev_find(tip)) && (tdev->flags & IFF_NOARP))
                goto out;
 
 /*
<Prev in Thread] Current Thread [Next in Thread>