Add ARP records for containers' IPs on network interface up
This fixes a long-standing bug -- if a network interface like eth0
is restarted after some containers already went up, their appropriate
ARP records became lost. This is usually the case with DHCP.
To fix this, we need to hook on an interface up and add all the ARP
records for all IPs of all the running containers. The adding is done
by the added vzifup-post script. The hooking is distribution-specific:
(1) Red Hat/Fedora/CentOS: use /sbin/ifup-local
(2) SUSE: use /etc/sysconfig/network/if-up.d/
(3) Debian/Ubuntu: /etc/network/if-up.d
(4) Gentoo: use postup() in /etc/conf.d/net
For all of the above the proper install-DISTRO target is added. In case of Gentoo
we can only print a suggestion, for others create an appropriate symlink.
Red Hat is a special case since there's no if-up.d and we can only use
/sbin/ifup-local, so check that if does not exist and create a symlink,
otherwise just print a suggestion to call our script from there.
When building rpms do not install those symlinks, but rather have vzctl.spec's
%post to do the job (and distinguish between suse and redhat).
Suggestions for other distributions are welcome.
http://bugzilla.openvz.org/556
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
8 files changed