Linux基础——IPV6内核参数配置

一、检查内核配置是否启动ipv6

net.ipv6.conf.bond0.forwarding = 1

net.ipv6.conf.bond0.disable_ipv6 = 0

net.ipv6.conf.all.forwarding = 1

net.ipv6.conf.default.forwarding = 1

 

二、检查内核启动IPV6配置

ansible -i ip all -m shell -a "sysctl -a | grep -iE 'forwarding|disable_ipv6'|grep bond0"

添加IPV6相关配置到/etc/sysctl.conf

ansible -i ip all -m shell -a "echo 'net.ipv6.conf.all.forwarding = 1'>>/etc/sysctl.conf"

ansible -i ip all -m shell -a "echo 'net.ipv6.conf.default.forwarding = 1'>>/etc/sysctl.conf"

ansible -i ip all -m shell -a "echo 'net.ipv6.conf.bond0.forwarding = 1'>>/etc/sysctl.conf"

ansible -i ip all -m shell -a "echo 'net.ipv6.conf.bond0.disable_ipv6 = 0'>>/etc/sysctl.conf"

ansible -i ip all -m shell -a "sysctl -p"

三、加载IPV6内核配置

sysctl -a | grep disable_ipv6

posted on 2023-10-17 16:11  gkhost  阅读(881)  评论(0编辑  收藏  举报

导航