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
PING ipv6.google.com(2404:6800:8002::69) 56 data bytes
64 bytes from 2404:6800:8002::69: icmp_seq=0 ttl=50 time=99.4 ms
64 bytes from 2404:6800:8002::69: icmp_seq=1 ttl=50 time=99.2 ms
64 bytes from 2404:6800:8002::69: icmp_seq=2 ttl=50 time=98.1 ms