ubuntu 18.04 關閉linode的 ipv6,下面方法有效:

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


 
  1. GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"

  2. GRUB_CMDLINE_LINUX="ipv6.disable=1"

Then execute:


 
  1. sudo update-grub

  2. 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章