命令提示字元下常用的檢查網路通訊的命令
A. ping
B. tracert
C. netstat
命令提示字元下常用的檢查網路通訊的命令
ping
檢查本地網卡是否工作正常
請在”執行”中輸入ping 127.0.0.1觀察結果,如果出現下列資訊則網卡工作正常,否則請檢查網卡的安裝和驅動程式是否正常.
C:\>ping 127.0.0.1
Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
檢查網路是否正常
一般檢查網路是否正常都是通過ping閘道,如果出現下面的情況則是正常
C:\>ping 218.197.223.254 -n 2
Pinging 218.197.223.254 with 32 bytes of data:
Reply from 218.197.223.254: bytes=32 time<
Reply from 218.197.223.254: bytes=32 time<
如果出現以下情況則表明網路連接或者是配置有問題
C:\>ping 218.197.223.254
Pinging 218.197.223.254 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
如果出現以下的情況則說明網卡沒有正常工作
C:\>ping 218.197.223.254
Pinging 218.197.223.254 with 32 bytes of data:
Des
Des
tracert
tracert命令是用來測試路由的,通過其中的測試可以知道網路連接中什麼地方出現了問題.
具體如下:
C:\>tracert ei.hust.edu.cn
Tracing route to ei.hust.edu.cn [211.69.207.8]
over a
1 16 ms <10 ms <10 ms 218.197.223.254
2 * * * Request timed out.
如出現這種問題,其中一個原因是網路中心對各種報文做了限制,還有一個就是網路不通。
●如果出現下面的這種現象就是正常:
C:\>tracert job.eistar.net
Tracing route to job.eistar.net [218.197.223.47]
over a
1 <10 ms <10 ms <10 ms LINFENGWEB2 [218.197.223.47]
Trace complete.
●如果出現以下的情況:
C:\>tracert www.sina.com.cn
Tracing route to jupiter.sina.com.cn [202.112.8.2]
over a
1 16 ms <10 ms 16 ms 218.197.223.254
2 <10 ms <10 ms <10 ms 192.168.1.102
3 <10 ms <10 ms <10 ms 192.168.1.37
4 282 ms 281 ms 281 ms 202.112.21.202
5 922 ms 907 ms 921 ms wh0.cernet.net [202.112.53.81]
6 16 ms 15 ms 16 ms bjwh4.cernet.net [202.112.46.65]
7 16 ms 16 ms 15 ms 202.112.36.130
如在第五行中出現”922 ms 907 ms 921 ms wh0.cernet.net [202.112.53.81]”類似的情況則說明這個路由出現問題,應找網路中心解決
netstat
檢查現在正在通信的埠
C:\>netstat -an
Active Connections
Proto Local Address Foreign
TC
TC
TCP 218.197.223.57:80 202.114.7.1:1774 ESTABLISHED
TCP 218.197.223.57:80 202.114.215.33:1623 ESTABLISHED
TCP 218.197.223.57:80 202.114.215.33:1626 ESTABLISHED
TCP 218.197.223.57:80 218.88.94.75:1031 ESTABLISHED
TCP 218.197.223.57:80 218.197.195.25:1076 TIME_WAIT
TCP 218.197.223.57:80 218.197.195.25:1081 ESTABLISHED
TCP 218.197.223.57:80 218.197.195.25:1083 ESTABLISHED
TCP 218.197.223.57:80 218.197.207.14:4632 ESTABLISHED
UD
UD
UD
UD
UD
UD
其中第一列表明使用的協議,第二列列出本地的位址和埠,第三列表示和其他主機通信的IP位址和埠,第四列表示當前的狀態.
其中0.0.0.0:0表示所有對所有位址所有埠都可以通信