#测试网络连接状态[kingarthur@localhost ~]$ ping www.google.com
PING www.google.com (174.37.175.229) 56(84) bytes of data.
^C
--- www.google.com ping statistics ---
33 packets transmitted, 0 received, 100% packet loss, time 32009ms
#发c=3次数据包,发包间隔时间i=2秒[kingarthur@localhost ~]$ ping -c 3 -i 2 www.google.com
PING www.google.com (199.59.148.209) 56(84) bytes of data.
--- www.google.com ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 3999ms
#最小发包间隔为200ms 或0.2s[kingarthur@localhost ~]$ ping -c 5 -i 0.02 www.baidu.com
PING www.a.shifen.com (182.61.200.6) 56(84) bytes of data.
ping: cannot flood; minimal interval allowed for user is 200ms
#测试国内百度网站[kingarthur@localhost ~]$ ping -c 5 -i 0.2 www.baidu.com
PING www.a.shifen.com (182.61.200.7) 56(84) bytes of data.
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=1 ttl=55 time=6.63 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=2 ttl=55 time=6.55 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=3 ttl=55 time=6.39 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=4 ttl=55 time=5.92 ms
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=5 ttl=55 time=5.87 ms
--- www.a.shifen.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 805ms
rtt min/avg/max/mdev = 5.871/6.274/6.633/0.317 ms
#测试 google[kingarthur@localhost ~]$ ping -c 5 -i 0.2 www.google.com
PING www.google.com (69.171.237.16) 56(84) bytes of data.
--- www.google.com ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 810ms
#测试 youtube[kingarthur@localhost ~]$ ping -c 5 -i 0.2 www.youtube.com
PING www.youtube.com (243.185.187.39) 56(84) bytes of data.
--- www.youtube.com ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 811ms
#测试 bing[kingarthur@localhost ~]$ ping -c 5 -i 0.2 www.bing.com
PING cn-0001.cn-msedge.net (202.89.233.100) 56(84) bytes of data.
64 bytes from 202.89.233.100 (202.89.233.100): icmp_seq=1 ttl=117 time=4.58 ms
64 bytes from 202.89.233.100 (202.89.233.100): icmp_seq=2 ttl=117 time=4.64 ms
64 bytes from 202.89.233.100 (202.89.233.100): icmp_seq=3 ttl=117 time=3.09 ms
64 bytes from 202.89.233.100 (202.89.233.100): icmp_seq=4 ttl=117 time=4.63 ms
64 bytes from 202.89.233.100 (202.89.233.100): icmp_seq=5 ttl=117 time=4.37 ms
--- cn-0001.cn-msedge.net ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 806ms
rtt min/avg/max/mdev = 3.090/4.263/4.642/0.600 ms
#-p显示正在使用的socket的程序名称#-l显示监控中的服务器的socket#-n直接使用IP地址#-t显示TCP端口情况
ingarthur@localhost ~]$ netstat -plnt
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN -
tcp 0 0 192.16