--- title: "Ipv6 笔记" date: 2019-10-29T21:07:06+08:00 lastmod: 2019-10-29T21:07:06+08:00 keywords: [] tags: ["ipv6", "centos"] categories: ["network"] --- ## CentOS7 禁用 ipv6 ### 方法1 - 编辑 /etc/sysctl.conf,增加如下内容 ``` net.ipv6.conf.all.disable_ipv6 =1 net.ipv6.conf.default.disable_ipv6 =1 ``` - 如果你想要为特定的网卡禁止IPv6,比如,对于enp0s3,添加下面的行 ``` net.ipv6.conf.enp0s3.disable_ipv6 =1 ``` - 生效 ```bash sysctl -p ``` ### 方法2 - 执行下面命令 ```bash echo 1>/proc/sys/net/ipv6/conf/all/disable_ipv6 echo 1>/proc/sys/net/ipv6/conf/default/disable_ipv6 ```