Disable IPv6 via grub command line

Unfortunately disabling IPv6 via sysctl doesn't actually
disable it on all of the interfaces by default. Disabling
it via grub disables it entirely in the VM.

Helps with #454
This commit is contained in:
Bob Lantz
2014-12-17 13:49:12 -08:00
parent a84bec9709
commit a7ad739036
+9 -2
View File
@@ -554,9 +554,9 @@ function vm_other {
# BLACKLIST=/etc/modprobe.d/blacklist
#fi
#sudo sh -c "echo 'blacklist net-pf-10\nblacklist ipv6' >> $BLACKLIST"
echo "Disabling IPv6"
# Disable IPv6
if ! grep 'disable IPv6' /etc/sysctl.conf; then
if ! grep 'disable_ipv6' /etc/sysctl.conf; then
echo 'Disabling IPv6'
echo '
# Mininet: disable IPv6
@@ -564,6 +564,13 @@ net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1' | sudo tee -a /etc/sysctl.conf > /dev/null
fi
# Since the above doesn't disable neighbor discovery, also do this:
if ! grep 'ipv6.disable' /etc/default/grub; then
sudo sed -i -e \
's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1/' \
/etc/default/grub
sudo update-grub
fi
# Disabling IPv6 breaks X11 forwarding via ssh
line='AddressFamily inet'
file='/etc/ssh/sshd_config'