Linux 配置IPv6网络 #
2020-11-04 20:26
-
修改网卡配置文件
vi /etc/sysconfig/network-scripts/ifcfg-eth1增加如下配置
IPV6INIT=yes IPV6ADDR=fdff::251:10:254:251:109 IPV6PREFIX=64 IPV6_DEFAULTGW=fdff::251:10:254:251:254 IPV6_AUTOCONF=no IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no -
重启网络
service network restart
一般情况下到这里就差不多了。ifconfig 查看,可以看到已经有IPv6地址了:inet6 addr: fdff::251:10:254:251:109/64 Scope:Global
eth1 Link encap:Ethernet HWaddr 00:50:56:9A:7B:5B
inet addr:10.254.251.109 Bcast:10.254.251.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe9a:7b5b/64 Scope:Link
inet6 addr: fdff::251:10:254:251:109/64 Scope:Global
但我这边遇到个问题,本机可以telnet通,但外网一直不行。经过排查,发现还有个IPv6的防火墙未关闭。
service ip6tables status查看IPv6 防火墙状态service ip6tables stop关闭IPv6 防火墙chkconfig ip6tables off永久关闭IPv6防火墙(避免开机自启动)
PS. IPv6 的ping 命令为 ping6,chkconfig --list 查看开机启动项