LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Accessing from Load Balancer with virtual IP-Address

To: linux-virtualserver@xxxxxxxxxxxx
Subject: Accessing from Load Balancer with virtual IP-Address
From: jacob.rief@xxxxxx
Date: Thu, 7 Oct 1999 16:53:01 +0200
Hi,
how can I configure the Load Balancer so that I can access
any service with the virtual IP from the Load Balancer itself.
If the Load Balancer is configured for example:
(eth0=195.96.23.250 eth1=172.16.0.1)
# ipvsadm -A -t 195.96.23.250:80 -s wlc
# ipvsadm -a -t 195.96.23.250:80 -r 172.16.0.10:80 -m
I can access the Real Server with
# lynx 172.16.0.10:80
but I can't with
# lynx 195.96.23.250:80
Alert!: Unable to connect to remote host.


Something else...
ipvsadm.c version1.1 should be patched,
I think there is a small bug in there. For example:
(eth0=195.96.23.250 eth1=172.16.0.1)
# ipvsadm -A -t 195.96.23.250:82 -s wlc
# ipvsadm -a -t 195.96.23.250:82 -r 172.16.0.10:80 -m

I can't delete this entry with
# ipvsadm -d -t 195.96.23.250:82 -r 172.16.0.10:80
setsockopt failed: No such file or directory
No such destination

However, if I create a rule with the same port, everything works fine
# ipvsadm -A -t 195.96.23.250:82 -s wlc
# ipvsadm -a -t 195.96.23.250:82 -r 172.16.0.10:82 -m
# ipvsadm -d -t 195.96.23.250:82 -r 172.16.0.10:82
everything works fine
This patch would solve the problem:
--- ipvsadm.c   Thu Oct  7 11:04:19 1999
+++ ipvsadm.c.orig      Tue Sep  7 14:50:46 1999
@@ -198,6 +198,7 @@
        if (mc.m_target == IP_MASQ_TARGET_VS && mc.m_cmd == IP_MASQ_CMD_ADD
            && strlen(mc.m_tname) == 0) {
                strcpy(mc.m_tname,DEF_SCHED);
+       }

         /*
          * Set the default weight 1
@@ -212,8 +213,7 @@
         if ((mc.u.vs_user.masq_flags == IP_MASQ_F_VS_TUNNEL)
             || (mc.u.vs_user.masq_flags == IP_MASQ_F_VS_DROUTE))
                 mc.u.vs_user.dport = mc.u.vs_user.vport;
-       }
-
+
        sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
        if (sockfd==-1) {
                perror("socket creation failed");

Regards, Jacob



<Prev in Thread] Current Thread [Next in Thread>