16
Copyright © 2000 - 2005 KEMP Technologies, Inc. All Rights Reserved.
Figure above: Sample Direct Server Return configuration
This feature should be implemented only if the real servers need to respond to the clients directly, without
going through the LoadMaster. In this configuration the real servers should have a path to the clients without
going through the balancer, i.e. additional routes bypassing the LoadMaster.
Note: This mode is only available when not using any persistency options.
DSR uses a combination of MAT (MAC address translation) and a special RS configuration. The RS is
configured with an IP address as normal but it is also given the IP address of the VIP. Normally you cannot
have two machines on a network with the same IP address. To get around this, the VIP address on the Real
Server should be configured so that they do not respond to arp requests. For Linux with a recent 2.4 kernel,
this can be done by creating the VIP as an IP alias on the loopback interface.
When you create the VS and assign the respective real servers to it, select “route” as the forwarding method
to the real servers. This means that the balancer just routes the packets from a client to a RS without
modifying the IP addresses. The real server accepts requests for the VIP destination address because it has
configured the VIP as an IP alias. The real server will then reply to the IP address of the requesting client with
the source IP address of the reply set to the VIP.
Step Source IP
Destination IP
MAC Address
1
216.139.43.10
195.30.70.200
Dest: 00:00:00:00:00:aa
2
216.139.43.10
195.30.70.200
Dest: 00:00:00:00:00:bb
3
195.30.70.200
216.139.43.10
Source: 00:00:00:00:00:bb
Configuring a VIP on the loopback interface on Linux
On a linux machine the “ifconfig –a” command will look something like this:
root@RS1 $ ifconfig –a
eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:bb inet addr: 195.30.70.11 Bcast: 195.30.70.255
Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:96561817
errors:526 dropped:0 overruns:5 frame:0 TX packets:97174301 errors:0 dropped:0 overruns:0
carrier:0 collisions:0 txqueuelen:100 Interrupt:10 Base address:0x4000
lo
Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:3924
Metric:1 RX packets:3985923 errors:0 dropped:0 overruns:0 frame:0 TX packets:3985923 errors:0
dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0
To create an additional loopback interface with an IP alias use the “ifconfig” command like this:
root@RS1 $ ifconfig lo:1 195.30.70.200 broadcast 195.30.70.200 \ netmask 255.255.255.255
root@RS1 $ ifconfig lo:1
lo:1
Link encap:Local Loopback inet addr:195.30.70.200 Mask:255.255.255.255 UP LOOPBACK RUNNING
MTU:3924 Metric:1
D. Miscellaneous Networking Issues
1. S-NAT
When using a two-armed or multi-armed balancer configuration, it is sometimes useful for the real servers to
have access to the Internet. The default route for the real servers is through the balancer. If however the real
servers do not have routable addresses i.e. private addresses, this is not possible.
Using S-NAT, the balancer will map all connections originating on a real server so that they appear to come
from the balancer itself. The real servers can thus use the Internet as if directly connected but with the extra
security protection that they cannot be addressed directly from the Internet.