腾讯云Centos开启IPV6
2017-03-29 16:32
260 查看
先看下开启后的效果吧。
[root@VM_centos ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:00:34
1:52
inet addr:10.101.3.185 Bcast:10.101.127.255 Mask:255.255.192.0
inet6 addr: fe80::5054:ff:fe34:d152/64 Scope
ink
------------------------->>>开启成功后会有一列IPV6的地址格式
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1010372 errors:0 dropped:0 overruns:0 frame:0
TX packets:423319 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:79625272 (75.9 MiB) TX bytes:44330935 (42.2 MiB)
腾讯云主机centos系统均加载了IPV6模块,可以使用lsmod命令查看,如下:
[root@VM_centos ~]# lsmod |grep ipv6
ipv6 334804 0
一、开启IPV6命令:sysctl -w net.ipv6.conf.all.disable_ipv6=0
[root@VM_centos ~]# sysctl -w net.ipv6.conf.all.disable_ipv6=0
error: "net.ipv6.conf.all.disable_ipv6" is an unknown key -->内核参数没加载,则会报这个错(注意:centos6.2/7.0/7.1版本的默认是加载的,直接运行这个命令便可以成功,其它centos版本都得重启主机来加载,往下看...)
二、原来还要在配置文件中/etc/modprobe.d/ipv6.conf 修改内核参数,options ipv6 disable=0,设置为0表示打开这个参数。
[root@VM_centos ~]# cat /etc/modprobe.d/ipv6.conf
# Anaconda disabling ipv6
options ipv6 disable=0
三、设置了还不行再操作第一步,还是报错,原来必须要重启云主机刚修改的内核参数才会加载生效。重启云主机后,再执行:sysctl -w net.ipv6.conf.all.disable_ipv6=0 就OK了。(最好把这条命令写在/etc/rc.local配置文件里,开机自动执行,不然重启后,又会默认关闭了。)
查看下设置生效的方法:
[root@VM_centos ~]# sysctl -a|grep ipv6|grep all.disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 0
再执行下ifconfig看下网卡,就会发现多了一个IPV6的地址。如第一段的开启效果。
注意:上述方法适用于centos6.2、centos6.3、centos6.4、centos6.5 centos6.6
centos5.8/5.11略有不同,IPV6内核参数文件在/etc/modprobe.conf中修改。
[root@VM_centos ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:00:34
1:52
inet addr:10.101.3.185 Bcast:10.101.127.255 Mask:255.255.192.0
inet6 addr: fe80::5054:ff:fe34:d152/64 Scope
ink
------------------------->>>开启成功后会有一列IPV6的地址格式
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1010372 errors:0 dropped:0 overruns:0 frame:0
TX packets:423319 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:79625272 (75.9 MiB) TX bytes:44330935 (42.2 MiB)
腾讯云主机centos系统均加载了IPV6模块,可以使用lsmod命令查看,如下:
[root@VM_centos ~]# lsmod |grep ipv6
ipv6 334804 0
一、开启IPV6命令:sysctl -w net.ipv6.conf.all.disable_ipv6=0
[root@VM_centos ~]# sysctl -w net.ipv6.conf.all.disable_ipv6=0
error: "net.ipv6.conf.all.disable_ipv6" is an unknown key -->内核参数没加载,则会报这个错(注意:centos6.2/7.0/7.1版本的默认是加载的,直接运行这个命令便可以成功,其它centos版本都得重启主机来加载,往下看...)
二、原来还要在配置文件中/etc/modprobe.d/ipv6.conf 修改内核参数,options ipv6 disable=0,设置为0表示打开这个参数。
[root@VM_centos ~]# cat /etc/modprobe.d/ipv6.conf
# Anaconda disabling ipv6
options ipv6 disable=0
三、设置了还不行再操作第一步,还是报错,原来必须要重启云主机刚修改的内核参数才会加载生效。重启云主机后,再执行:sysctl -w net.ipv6.conf.all.disable_ipv6=0 就OK了。(最好把这条命令写在/etc/rc.local配置文件里,开机自动执行,不然重启后,又会默认关闭了。)
查看下设置生效的方法:
[root@VM_centos ~]# sysctl -a|grep ipv6|grep all.disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 0
再执行下ifconfig看下网卡,就会发现多了一个IPV6的地址。如第一段的开启效果。
注意:上述方法适用于centos6.2、centos6.3、centos6.4、centos6.5 centos6.6
centos5.8/5.11略有不同,IPV6内核参数文件在/etc/modprobe.conf中修改。
相关文章推荐
- 阿里云centos开启ipv6支持
- CentOS6 关闭开启ipv6
- 腾讯云CentOS Apache开启HTTPS
- 阿里云ECS Centos开启ipv6支持
- Linux(centOS) IPV6的开启、设置
- Centos查看系统是否开启ipv6,ipv6关闭方法
- centos网速特别慢的最佳解决的方法 - 关闭ipv6
- 腾讯云Centos6.6搭建javaweb环境:mysql5.1+jdk1.7+tomcat6完整过程
- 如何在CentOS 7中禁止IPv6
- 腾讯云CentOS7.2 PHP-SDK镜像服务器根目录(腾讯云微信小程序服务端Demo -PHP 页面根目录)
- CentOS Linux开启和关闭防火墙命令
- centos5.8 禁用ipv6
- centos 下mysql怎么开启服务
- Centos6.0开启syslog之keepalived
- 在CentOS或RHEL防火墙上开启端口
- centos开启Tomcat远程调试端口
- linux centos系统永久关闭ipv6
- CentOS开启和关闭防火墙
- centos防火墙开启、关闭、查看状态。
- RHEL/CentOS 7.x/6.x/5.x开启EPEL仓库