代码改变世界

debain关闭numa、ipv6和transparent_hugepage

  abce  阅读(406)  评论(0编辑  收藏  举报

关闭numa、ipv6和transparent_hugepage

1
$ sudo vi /etc/default/grub

添加

1
2
3
GRUB_CMDLINE_LINUX_DEFAULT="quiet numa=off transparent_hugepage=never ipv6.disable=1"
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
$ sudo reboot

 

Debian关闭IPv6的其它方法
方法一:在sysctl.d中新加入配置文件
在/etc/sysctl.d/文件夹中新建disable-ipv6.conf,并写入配置

1
2
3
4
$ sudo touch /etc/sysctl.d/disable-ipv6.conf
$ sudo echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.d/disable-ipv6.conf
$ sudo echo 'net.ipv6.conf.default.disable_ipv6 = 1' >> /etc/sysctl.d/disable-ipv6.conf
$ sudo echo 'net.ipv6.conf.lo.disable_ipv6 = 1' >> /etc/sysctl.d/disable-ipv6.conf

使用以下命令运行配置文件

1
sysctl -p -f /etc/sysctl.d/disable-ipv6.conf

如果使用ip a命令,在输出中没有发现IPv6地址,则说明成功关闭了IPv6功能。

方法二:直接修改sysctl.conf配置文件
打开/etc/sysctl.conf,在Uncomment the next line to enable packet forwarding for IPv6前一行添加以下三行内容:

1
2
3
$ sudo echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.conf
$ sudo echo 'net.ipv6.conf.default.disable_ipv6 = 1' >> /etc/sysctl.conf
$ sudo echo 'net.ipv6.conf.lo.disable_ipv6 = 1' >> /etc/sysctl.conf

使用以下命令运行配置文件:

1
sysctl -p

如果使用ip a命令,在输出中没有发现IPv6地址,则说明成功关闭了IPv6功能。

相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示