LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] multiple IP on same NICs

To: "LinuxVirtualServer.org users mai" <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] multiple IP on same NICs
From: "wlx" <wlx@xxxxxxxxx>
Date: Mon, 9 Jul 2007 10:16:39 +0800
thanks joe!you are so great!^=^
I had thought that maybe my pool english that nobody could understand my means.
I had used two vips to implement our reqirement.it running well now.






发件人: Joseph Mack NA3T
发送时间: 2007-07-06 22:08:45
收件人: LinuxVirtualServer.org users mailing list.
抄送: 
主题: Re: [lvs-users] multiple IP on same NICs

On Tue, 26 Jun 2007, wlx wrote:

I don't see any replies to this. In case your question 
hasn't been answered, sorry for the delay....

> hi,all.
>    my lvs is tunnel,realservers run squid ,all work 
> well.but now i want a realserver run two squid 
> process(such as squid and squid2)with two ip seperately. 
> For the time being, I'm using one director and just one 
> real-server.
>
> The setup is as follows:
>
> director RIP = 192.168.100.122
> LVS VIP = 192.168.100.203
> real server RIP = 192.168.100.124(eth0)
>                RIP = 192.168.100.200(eth0:0)
>
> [root@LAN-122 linux]# ipvsadm -ln
> IP Virtual Server version 1.2.0 (size=1048576)
> Prot LocalAddress:Port Scheduler Flags
>  - > RemoteAddress:Port           Forward Weight ActiveConn InActConn
> TCP  192.168.100.203:80 wrr
>  - > 192.168.100.200:80           Tunnel  1      0          0
>  - > 192.168.100.124:80           Tunnel  1      0          0

the ":80" are ignored in the last two lines, since you can't 
redirect ports with LVS-Tun.

> realserver:
> eth0      Link encap:Ethernet  HWaddr 00:0D:61:6B:C0:F2
>          inet addr:192.168.100.124  Bcast:192.168.100.255  Mask:255.255.255.0
>          inet6 addr: fe80::20d:61ff:fe6b:c0f2/64 Scope:Link
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>          RX packets:177497722 errors:0 dropped:0 overruns:1 frame:1
>          TX packets:151769553 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:1000
>          RX bytes:1613863993 (1.5 GiB)  TX bytes:3776001903 (3.5 GiB)
>
> eth0:0    Link encap:Ethernet  HWaddr 00:0D:61:6B:C0:F2
>          inet addr:192.168.100.200  Bcast:192.168.100.255  Mask:255.255.255.0
>          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

This isn't going to get you exactly what you want. Since you 
only have one VIP on the realserver, then there is only one 
instance of the server running on it. The director will send 
ipip packets to both x.x.x.200 and x.x.x.124, but both 
streams will arrive at the lo==VIP.

I can't see how to do what you want with LVS-Tun. You can do 
it with LVS-NAT.

>
> lo        Link encap:Local Loopback
>          inet addr:127.0.0.1  Mask:255.0.0.0
>          inet6 addr: ::1/128 Scope:Host
>          UP LOOPBACK RUNNING  MTU:16436  Metric:1
>          RX packets:14352327 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:14352327 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:0
>          RX bytes:2971562342 (2.7 GiB)  TX bytes:2971562342 (2.7 GiB)
>
> tunl0     Link encap:IPIP Tunnel  HWaddr
>          inet addr:192.168.100.203  Mask:255.255.255.255
>          UP RUNNING NOARP  MTU:1480  Metric:1
>          RX packets:458 errors:0 dropped:0 overruns:0 frame:0
>          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>          collisions:0 txqueuelen:0
>          RX bytes:29063 (28.3 KiB)  TX bytes:0 (0.0 b)
> squid's squid.conf
> http_port 192.168.100.124:80 transparent
> squid2's squid.conf
> http_port 192.168.100.200:80 transparent

the service has to listen on the VIP, not the RIPs. The 
client is sending its requests to the VIP.

> now i telnet 192.168.100.203 80 from a client,it display:
>
> [root@linuxtelnet 192.168.100.203 80
> Trying 192.168.100.203...
> telnet: connect to address 192.168.100.203: Connection refused
> telnet: Unable to connect to remote host: Connection refused

Joe

-- 
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!

_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users
_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users
<Prev in Thread] Current Thread [Next in Thread>