google / seesaw

Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform.
Apache License 2.0
5.65k stars 511 forks source link

Arpflux #50

Closed liuyuan10 closed 5 years ago

liuyuan10 commented 5 years ago

Seesaw requires node NIC and LB NIC on the same LAN. If unicast VIP is in this network, kernel may choose to reply arp with node NIC MAC but not VRRP MAC.

Source based routing must be set up for arp_filter to work. See https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt

This change will add source based routing policy for each VIP that's in the same network of LB NIC

Example: ~$ ip rule 0: from all lookup local 32761: from 100.115.222.143 lookup 2 32764: from 100.115.222.149 lookup 2 32765: from all to 100.115.222.149 lookup 2 32766: from all lookup main 32767: from all lookup default

~$ ip route show table 2 default via 100.115.222.254 dev ens224 100.115.222.128/25 dev ens224 scope link

A line for the VIP of 100.115.222.143 is added. Lines for the cluster VIP 100.115.222.149 is what's added in addClusterVIP().