How to quickly enable virtual IP addresses with multiple network adapters in Linux

Source: Internet
Author: User
Physical Environment: dual-Host & amp; 43; multiple NICs & amp; 43; one Nic is bound with two IP addresses & amp; 43; switch scenarios with arp cache: the dual-host master-slave switchover uses a virtual IP address to provide unified external services. problem: After the master-slave switchover, the virtual IP address is bound successfully, but cannot be pinged to the same virtual IP address or the 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 uniformly provide external services: 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.