近日,家里的电信adsl运营商给了IPV6,windows,mac图形桌面都自动获取到了,linux没有开自动获取,需要手动设置.
静态IPv6 地址的配置
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:07:5D:22:EA:40
IPADDR=192.168.2.1
NETMASK=255.255.255.0
ONBOOT=yes
GATEWAY=192.168.2.254
TYPE=Ethernet
USERCTL=no
IPV6INIT=yes
PEERDNS=yes
IPV6ADDR=240e:33d:9906:6900:a0e0:ad9e:28ad:a0d0
IPV6默认静态网关设置
[root@localhost ~]# vim /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=server4
GATEWAY=192.168.2.254
IPV6_DEFAULTGW=240e:33d:9906:6900::1%eth0
重启网络服务生效
systemctl restart network.service
或者
service network restart