關閉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