1 檢測IPV6是否啟用
1.1 使用ifconfig查看自己的IP地址是否含有IPv6地址
inet addr:192.168.198.128 Bcast:192.168.198.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee4:1d8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1080 errors:0 dropped:0 overruns:0 frame:0
TX packets:890 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:89517 (87.4 KiB) TX bytes:122147 (119.2 KiB)
Interrupt:185 Base address:0x1400
紅色標識部分即為IPV6地址。
1.2 查看服務監聽的IP中是否有IPv6格式的地址
[root@centos ~]# netstat -tulnActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address Statetcp 0 0 0.0.0.0:613 0.0.0.0:* LISTENtcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTENtcp 0 0 0.0.0.0:111 0.0.0.0:* LISTENtcp 0 0 0.0.0.0:21 0.0.0.0:* LISTENtcp 0 0 127.0.0.1:631 0.0.0.0:* LISTENtcp 0 0 127.0.0.1:25 0.0.0.0:* LISTENtcp 0 0 :::80 :::* LISTENtcp 0 0 :::22 :::* LISTENudp 0 0 0.0.0.0:68 0.0.0.0:*udp 0 0 0.0.0.0:607 0.0.0.0:*udp 0 0 0.0.0.0:610 0.0.0.0:*udp 0 0 0.0.0.0:111 0.0.0.0:*udp 0 0 0.0.0.0:631 0.0.0.0:*
1.3 使用lsmod|grep ipv6查看ipv6的模組是否被載入
[root@centos ~]# lsmod|grep ipv6ipv6 243425 19
2 關閉/開啟IPV6
2.1 關閉IPV6
#vi /etc/modprobe.conf
添加下面兩行內容
alias net-pf-10 off
alias ipv6 off
儲存退出,並且重新啟動系統。
重啟之後可以使用上面的三種方法去驗證IPv6支援是否已經被關閉。
2.2 開啟IPV6
IPv6是預設支援的,所以當你要重新開起IPv6支援時,將/etc/modprobe.conf中的兩條指令注釋掉就可以了。