当前位置: > CentOS > CentOS入门 >

CentOS服务器配置ipv6

时间:2019-04-02 17:44来源:linux.it.net.cn 作者:IT
参考网址:
https://blog.csdn.net/ogogo1981/article/details/54583819
 
查看是否支持ipv6
https://blog.csdn.net/quantum7/article/details/81014193
 
申请IPV6地址并配置
https://www.cnblogs.com/wunaozai/p/9445150.html
https://blog.csdn.net/u012377333/article/details/80583471
步骤:
查看CentOS版本号:
 
[root@host etc]# cat /etc/centos-release
CentOS release 6.8 (Final)
是6.6及以上版本
设置服务器支持IPV6
 
vi /etc/sysctl.conf
 
配置上以下3条属性
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
 
保存
运行 sysctl -p
 
[root@host etc]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
net.ipv4.neigh.default.base_reachable_time_ms = 600000
net.ipv4.neigh.default.mcast_solicit = 20
net.ipv4.neigh.default.retrans_time_ms = 250
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
查看服务器是否已支持ipv6
 
[root@host etc]# ifconfig | grep inet
[root@host etc]# netstat -tuln
[root@host etc]# lsmod
 
返回值参考上面第二篇链接
申请一个IPV6地址
 
参考上面3,4链接
 
注:申请网站用google浏览器打开为佳,本人之前用别的浏览器打开注册,会因为排版格式注册失败
 
测试是否可以访问IPV6网站
 
[root@host etc]# ping6 -c 5 ipv6.google.com
PING ipv6.google.com(lax28s15-in-x0e.1e100.net) 56 data bytes
64 bytes from lax28s15-in-x0e.1e100.net: icmp_seq=1 ttl=57 time=1.73 ms
64 bytes from lax28s15-in-x0e.1e100.net: icmp_seq=2 ttl=57 time=1.44 ms
64 bytes from lax28s15-in-x0e.1e100.net: icmp_seq=3 ttl=57 time=0.913 ms
64 bytes from lax28s15-in-x0e.1e100.net: icmp_seq=4 ttl=57 time=1.25 ms
64 bytes from lax28s15-in-x0e.1e100.net: icmp_seq=5 ttl=57 time=1.09 ms
 
--- ipv6.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4040ms
rtt min/avg/max/mdev = 0.913/1.288/1.732/0.285 ms
 
 
(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容