|
|
|
|
|
|
|
|
|
|
|
|
[root@ns fore]# ping -c 4 206.55.157.7 PING 206.55.157.7 (206.55.157.7) from 206.55.157.2 : 56(84) bytes of data. 64 bytes from 206.55.157.7: icmp_seq=1 ttl=255 time=0.476 ms 64 bytes from 206.55.157.7: icmp_seq=2 ttl=255 time=0.456 ms 64 bytes from 206.55.157.7: icmp_seq=3 ttl=255 time=0.442 ms 64 bytes from 206.55.157.7: icmp_seq=4 ttl=255 time=0.436 ms --- 206.55.157.7 ping statistics --- 4 packets transmitted, 4 received, 0% loss, time 2997ms rtt min/avg/max/mdev = 0.436/0.452/0.476/0.026 ms [root@ns fore]# ip neigh show 206.55.157.1 dev eth0 lladdr 00:d0:79:ac:dc:00 nud reachable 206.55.157.7 dev eth0 lladdr 00:e0:18:6c:16:07 nud reachable
[root@ns fore]# ip neigh delete 206.55.157.7 dev eth0 [root@ns fore]# ip neigh show 206.55.157.1 dev eth0 lladdr 00:d0:79:ac:dc:00 nud reachable 206.55.157.7 dev eth0 nud failedNow ns has again forgotten where to find 206.55.157.7 and will need to send another ARP request the next time he needs to communicate with it. You may also see an output that an arp entry has been changed to the "stale" state. This means that the location shown is still valid, but it will have to be confirmed at the first transaction to that machine. Try the commands and record your results.
________
| |
| client |
|________|
|
|
(router)
|
|
| __________
| DIP | |
|------| director |
| VIP |__________|
|
|
|
------------------------------------
| | |
| | |
RIP1, VIP RIP2, VIP RIP3, VIP
______________ ______________ ______________
| | | | | |
| realserver1 | | realserver2 | | realserver3 |
|______________| |______________| |______________|
|
When the client requests a connection to the VIP, it must connect to the VIP on the director and not to the VIP on the realservers.
The director box acts as an IP router, accepting packets destined for the VIP and then sending them on to a realserver (where the real work is done and a reply is generated). When the client (or router) puts out the arp request "who has VIP, tell client", the client/router must receive the MAC address of the director for the LVS to work. After receiving the arp reply, the client will send the connect request to the director. (The director will update its ipvsadm tables to keep track of the connections that it's in charge of and then forward the connect request packet to the chosen realserver).
If instead, the client gets the MAC address of one of the realservers,
then the packets will be sent directly to that realserver,
bypassing the LVS action of the director and defeat the purpose
of clustering.
Getting the MAC address of the director (instead of the realservers) to
the client when the client/router does an arp request is the key to
solving the arp problem.
We shall use a hidden interface approach to solve the arp problem.