centos绑定ipv6
🕙2023-04-16
如果获得的ipv6信息为
ipv6: 2222:2c80:16:1::f0ae:4ef6/64
网关地址:2222:2c80:16:1::1
打开网络配置文件
vi /etc/sysconfig/network-scripts/ifcfg-<interface_name>
其中 "<interface_name>" 是你想要绑定 IPv6 地址的网卡名称。
查看使用网卡信息可获得当前使用的网卡名称
ifconfig
以默认的eth0网卡为例
vi /etc/sysconfig/network-scripts/ifcfg-eth0
在末尾加上ipv6地址
IPV6INIT=yes
IPV6ADDR=2222:2c80:16:1::f0ae:4ef6/64
再加上网关地址
IPV6_DEFAULTGW=2222:2c80:16:1::1
保存并重启网络服务
sudo systemctl restart network
查看网卡信息
ifconfig
使用ping6测试
ping6 ipv6.google.com
如果收到响应则表示已经支持ipv6