关闭linode的 ipv6,下面方法有效:
https://askubuntu.com/questions/1046057/disabling-ipv6-in-ubuntu-18-04-server
To clarify Stephan Rauch (for 18.04 only) - If using grub method to disable ipv6, the /etc/sysctl.conf configuration changes were not needed. I ended up leaving them in, (in case netplan is fixed in future) but all that is needed is the following:
sudo vi /etc/default/grub
Modify the GRUB_CMDLINEs to look like:
-
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"
-
GRUB_CMDLINE_LINUX="ipv6.disable=1"
Then execute:
-
sudo update-grub
-
sudo reboot
Enjoy ipv4.
ubuntu16.04对于ipv6的开启和关闭
编辑99-sysctl.conf文件。
sudo gedit /etc/sysctl.d/99-sysctl.conf
复制并粘贴以下3行在文件的底部。
net.ipv6.conf.all.disable_ipv6 = 1#0
net.ipv6.conf.default.disable_ipv6 = 1#0
net.ipv6.conf.lo.disable_ipv6 = 1#0
保存并关闭文件。 然后执行以下命令加载上述更改。
sudo sysctl -p
现在运行以下命令。 您应该看到1,这意味着IPv6已成功禁用。
cat /proc/sys/net/ipv6/conf/all/disable_ipv6