Ubuntu disable IPv6

The server I have in my local network cannot access api.telegram.org, the problem was solved instantly after I disabled IPv6 in router.

The proxy only works in IPv4 protocol, but the server prefer to use IPv6 so the requests were blocked by the GFW.

Environment

  • Ubuntu 18.04 Server

Disable instantly

Execute command

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

Disable permanently

  1. Modify the grub file located in /etc/default
    # change GRUB_CMDLINE_LINUX_DEFAULT and GRUB_CMDLINE_LINUX to
    GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1" 
    GRUB_CMDLINE_LINUX="ipv6.disable=1"
  2. update grub
    sudo update-grub 
    #reboot to take affect
    sudo reboot

     

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据