linux下检查ipv6是否开启的办法

在现在的Linux上IPv6已经在默认安装下被支持,但是对于一些对IPv6支持不是很好的应用服务器来说,开启了IPv6反而会影响服务器的网络性能,毕竟现在的网络交换设备不是IPv6的。

在Linux下首先确认IPv6是否已经被启用,可以从三个方面确定。
1.使用ifconfig查看自己的IP地址是否含有IPv6地址。
eth0 Link encap:Ethernet HWaddr 00:13:D4:05:B2:ED 
inet addr:119.119.xxx.xx Bcast:119.119.115.255 Mask:255.255.255.0
inet6 addr: fe80::213:d4ff:fe05:b2ed/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1054562 errors:0 dropped:0 overruns:0 frame:0
TX packets:538136 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:346189738 (330.1 MiB) TX bytes:246935731 (235.4 MiB)
Interrupt:209 Base address:0xd800 

2.查看服务监听的IP中是否有IPv6格式的地址。(netstat -tuln)
tcp 0 0 0.0.0.0:8100 0.0.0.0:* LISTEN 
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 
tcp 0 0 0.0.0.0:843 0.0.0.0:* LISTEN 
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 
tcp 0 0 0.0.0.0:81 0.0.0.0:* LISTEN 
tcp 0 0 0.0.0.0:113 0.0.0.0:* LISTEN 
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 
tcp 0 0 :::8080 :::* LISTEN 
tcp 0 0 :::22 :::* LISTEN 
tcp 0 0 :::443 :::* LISTEN 
udp 0 0 0.0.0.0:68 0.0.0.0:* 
udp 0 0 0.0.0.0:837 0.0.0.0:* 
udp 0 0 0.0.0.0:840 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:* 

3.使用lsmod查看ipv6的模块是否被加载。
Module Size Used by
parport_pc 24577 1 
lp 12077 0 
parport 37129 2 parport_pc,lp
autofs4 24901 0 
i2c_dev 11329 0 
i2c_core 22081 1 i2c_dev
sunrpc 162597 1 
loop 15817 2 
dm_multipath 20681 0 
button 6481 0 
battery 8901 0 
ac 4805 0 
md5 4033 1 
ipv6 234881 14 

posted on 2014-07-04 22:48  wpjamer  阅读(5123)  评论(0编辑  收藏  举报

导航