为网站添加IPv6支持
为网站添加IPv6支持
By lincanbin
at 2015-04-10
1人收藏 • 2700人看过
https://www.digitalocean.com/community/tutorials/how-to-enable-ipv6-for-digitalocean-droplets
图中IP打错,实际上应该是2604:a880:1:20::176:c001
DO给了16个IPv6,我用了c001这个。
- 登录后方可回帖
7 个回复 | 最后更新于 2015-07-13
我的是CentOS6
ip -6 addr add 2604:a880:1:20::176:c001/64 dev eth0 ip -6 route add default via 2604:a880:1:20::1 dev eth0 vi /etc/sysconfig/network-scripts/ifcfg-eth0
按需设置
DEVICE='eth0' TYPE=Ethernet BOOTPROTO=none ONBOOT='yes' HWADDR=04:01:33:d3:e7:01 IPADDR=104.236.166.48 NETMASK=255.255.192.0 GATEWAY=104.236.128.1 NM_CONTROLLED='yes' DNS1=8.8.8.8 DNS2=8.8.4.4 IPV6INIT=yes IPV6ADDR=2604:a880:1:20::176:c001 IPV6_DEFAULTGW=2604:a880:1:20::1 IPV6_AUTOCONF=no
vi /etc/sysconfig/network-scripts/ifcfg-eth0
添加
IPV6INIT=yes IPV6ADDR=2604:a880:1:20::176:c000/64 IPV6_DEFAULTGW=2604:a880:1:20::1 IPV6_AUTOCONF=no
重新编译,IPv6开启
ip -6 address add 2604:a880:1:20::176:c002 dev eth0 ip -6 address add 2604:a880:1:20::176:c003 dev eth0 ip -6 address add 2604:a880:1:20::176:c004 dev eth0 ……