Ubuntu 目前沒有套件,Debian 才有。官方只有提供 RPM 套件。
apt-get -y install linux-image-openvz-686 vzctl vzquota vzdump
ln -s /var/lib/vz /vz
cat >> /etc/sysctl.conf << EOF
net.ipv4.conf.all.rp_filter=1
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.ip_forward=1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.eth0.proxy_arp=1
EOF
sysctl -p
cat /etc/vz/vz.conf | grep NEIGHBOUR_DEVS
sed -i 's#NEIGHBOUR_DEVS=detect#NEIGHBOUR_DEVS=all#' /etc/vz/vz.conf
cat /etc/vz/vz.conf | grep NEIGHBOUR_DEVS
reboot