[lvs-users] a question about interface vip lo:0 in realserver in lvs dr mode

Ferenc Wagner wferi at niif.hu
Wed Apr 29 20:10:54 BST 2015


寇善军 <fierceman at 163.com> writes:

> I have a question about interface vip lo:0 in realserver in lvs dr mode
>
> most people used the command below to handle route to the interface VIP
>
>  /sbin/route add -host $VIP dev lo:0 
>
> I wonder what the command is used  for?

If makes $VIP a local address without actually having it configured on
any interface.

> if i did't configure it, what is the influence for the packets back to
> client from realserver ?

Nothing.  But the packets from the director to the real server are not
processed by the latter unless their destination address (the VIP) is a
local address on the real server.  Either you configure it on some
interface and handle the "ARP problem", or you make the VIP(s) local via
routing.

Actually, you can add whole IPv4 subnets to your loopback interface with
equivalent effect: "ip addr add XXX.YYY.ZZZ.0/24 dev lo", which adds the
corresponding local route.  You can't do this with IPv6 ranges, but you
can directly "ip route add local aaaa:bbb:cc:d::/64 dev lo" (on modern
Linux kernels).
-- 
Regards,
Feri.



More information about the lvs-users mailing list