Physical Environment: Dual-host + Multi-nic + one Nic is bound with two IP addresses + switch with arp cache usage scenario: Dual-host Master/Slave switchover, using a virtual IP address to provide unified external service problems: after the master-slave switchover, the virtual IP address is successfully bound, but the ping from the outside cannot be the same as the virtual IP address, that is, the virtual IP address cannot take effect quickly. Note: if a common L2 Switch is used, this problem does not exist, because normal switches do not have arp caches. Of course, you can alleviate this problem by adjusting the arp cache invalidation time on the switch, but generally, the switch is owned by others and cannot be moved at will. Solution: initiate an arp Address update command to broadcast an arp Address update command to the switch.
In linux, use the arping command directly.
Arping-I eth3-s 172.16.251.54-B-c 1 172.16.251.49
-I: Specify the physical interface-s bound to the virtual IP Address: Specify the virtual IP address-B: broadcast mode-c: the number of send broadcast packets is finally the gateway on the layer-3 Switch to notify arp Address Change.
After switching between the master and slave servers, the server bound to the virtual IP address directly executes the preceding command to notify the switch that the MAC address of the virtual IP address has changed and is updated in a timely manner. In this way, when a vswitch accesses a virtual IP address, the switch can use the new MAC address in time, so that the virtual IP Address can take effect quickly.
There is no arping command in windows. However, similar scripts and source code may be available at night to implement the same functions.