1 通过系统配置文件/etc/sysctl.conf

     在sysctl.conf文件中添加行

     

  • # 禁用整个系统所有接口的IPv6
  • net.ipv6.conf.all.disable_ipv6 = 1

   

  • # 禁用某一个指定接口的IPv6(例如:eth0, lo)
  • net.ipv6.conf.lo.disable_ipv6 = 1
  • net.ipv6.conf.eth0.disable_ipv6 = 1
  • 在 /etc/sysctl.conf 使这些更改生效,运行以下命令:
    1. $ sudo sysctl -p /etc/sysctl.conf

2 通过内核启动时,传递内核参数

   

用文本编辑器打开 /etc/default/grub 并给GRUBCMDLINELINUX变量添加"ipv6.disable=1"。

  1. $ sudo vi /etc/default/grup

  1. GRUB_CMDLINE_LINUX="xxxxx ipv6.disable=1"

 

相关文章:

  • 2021-04-19
  • 2022-03-03
  • 2021-09-30
  • 2021-07-27
  • 2021-11-15
  • 2022-02-25
  • 2021-10-01
  • 2021-07-19
猜你喜欢
  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2022-12-23
  • 2021-08-08
相关资源
相似解决方案