大老张学编程 2019-11-30
https://blog.csdn.net/cnmilan/article/details/8493977
CentOS 环境下 IPv6设置方法:
1)/etc/sysconfig/network 打开/关闭网络配置
添加:
NETWORKING_IPV6=yes #打开IPv6
# IPV6_AUTOCONF=no #不自动获取地址,即:设置"no”,不必需
2) /etc/sysconfig/network-scripts/ifcfg-eth0 配置IP/IPv6地址,网关等
添加:
IPV6INIT=yes #网卡初始化IPv6协议栈
IPV6ADDR=2001:250:4000:2000::53 #配置IPv6地址
IPV6_DEFAULTGW=2001:250:4000:2000::1 #配置IPv6网关
3) service network restart 重启网络服务,使配置生效
测试:
ping6 ipv6.google.com
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME. java 1113 admin 252u IPv6 26643775 TCP 192.168.0.1:1