CentOS服务器配置ipv6

参考网址:

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

------------------------------------------------------------------------

add:2020-03-23

阿里云的服务器上配置ipv6时,https://tunnelbroker.net网站上的Example Configurations 选项选择Linux-net-tools,使用下面指令配置成功

ifconfig sit0 up
ifconfig sit0 inet6 tunnel ::74.82.46.6
ifconfig sit1 up
ifconfig sit1 inet6 add 2001:470:23:60f::2/64
route -A inet6 add ::/0 dev sit1




[root@******** sysconfig]# ping6 -c 5  ipv6.google.cn
PING ipv6.google.cn(tsa03s06-in-x0e.1e100.net (2404:6800:4012:1::200e)) 56 data bytes
64 bytes from tsa03s06-in-x0e.1e100.net (2404:6800:4012:1::200e): icmp_seq=1 ttl=57 time=401 ms
64 bytes from tsa03s06-in-x0e.1e100.net (2404:6800:4012:1::200e): icmp_seq=2 ttl=57 time=383 ms
64 bytes from tsa03s06-in-x0e.1e100.net (2404:6800:4012:1::200e): icmp_seq=3 ttl=57 time=403 ms
64 bytes from tsa03s06-in-x0e.1e100.net (2404:6800:4012:1::200e): icmp_seq=4 ttl=57 time=385 ms
64 bytes from tsa03s06-in-x0e.1e100.net (2404:6800:4012:1::200e): icmp_seq=5 ttl=57 time=392 ms

--- ipv6.google.cn ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 496ms
rtt min/avg/max/mdev = 383.001/392.847/402.759/8.032 ms

参考: https://blog.csdn.net/u014201191/article/details/85112590

你可能感兴趣的:(软件使用心得)