IP定址排錯

IP定址排錯

IP定址排錯是指利用驗證IP位址的連通性來判斷某一網路中的故障可能出現的地方。

IP定址排錯

IP定址排錯是指利用驗證IP位址的連通性來判斷某一網路中的故障可能出現的地方。

下面介紹下Cisco使用的排錯步驟。如圖所示,Sally為一客戶機,它此時不能訪問連線到位於遠端網路的某台伺服器。下面是 Cisco推薦使用的排錯四步曲:
1. 打開DOS視窗並PING 127.0.0.1。這是一個診斷或環回地址,如果你得到一個成功的ping返回,則可以認定你的IP棧是被初始化過的。如果失敗,那么你的IP棧失敗,並且你需要在這一主機上重新安裝TCP/IP。
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<1ms TTL=128
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Ping statistics for 127.0.0.1:
Packet: Sent = 4, received = 4, Lost = 0(0% loss),
Approximate round trip times in milli-seconds:
Minimum = Oms, Maximum = Oms, Average = Oms
2. 在DOS視窗下,ping本地主機的IP位址。如果成功,那么可以說明你的網路接口卡(NIC)是功能正常的。如果失敗,則表明NIC卡存在問題。這一步並不能說明網線已經連線到NIC上,它只能說明主機上的IP位址棧可以(通過LAN驅動器)與這個NIC進行通信。
C:\>ping 172.16.10.2
Pinging 172.16.10.2 with 32 bytes of data:
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Ping statistics for 172.16.10.2:
Packet: Sent = 4, Received = 4, Lost = 0(0% loss),
Approximate round trip times in milli-seconds:
Minimum = Oms, Maximum = Oms, Average = Oms
3. 在DOS視窗下,ping默認網關(路由器)。如果ping正常,表明NIC已經連線到網路並且可以與本地網路進行通信。如果失敗,則表明存在一個本地物理網絡問題,這個問題可能出現在NIC到路由器之間的任何一個位置上。
C:\>ping 172.16.10.1
Pinging 172.16.10.1 with 32 bytes of data:
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Ping statistics for 172.16.10.1:
Packet: Sent = 4, Received = 4, Lost = 0(0% loss),
Approximate round trip times in milli-seconds:
Minimum = Oms, Maximum = Oms, Average = Oms
4. 如果以上三個步驟都是成功的,那么嘗試ping一下遠端伺服器。如果正常,則表明你可以在本地主機與遠端伺服器之間進行IP通信。同時,你也可以確信遠端物理網路也是正常的。
C:\>ping 172.16.20.2
Pinging 172.16.20.2 with 32 bytes of data:
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Reply from 127.0.0.1:bytes=32 time<1ms TTL=128
Ping statistics for 172.16.20.2:
Packet: Sent = 4, Received = 4, Lost = 0(0% loss),
Approximate round trip times in milli-seconds:
Minimum = Oms, Maximum = Oms, Average = Oms
如果在完成以上四個步驟後全都正常,而此用戶仍不能與該伺服器通信,那么你可能面對著某些名字解析的問題,這需要檢查你的域名伺服器(DNS)的設定。但是,如果ping遠端伺服器失敗,那么你所面對的將是某些遠程物理網路的問題,這時,你需要趕到伺服器現場,並執行步驟1-3的測試,直到找出癥結所在。
下面介紹一些DOS命令,它們可以幫助你從PC機和Cisco路由器(這些命令可能完成的是同一件事,但是它們有不用的執行方式)上進行網路故障的排錯
Packet InterNet Groper(ping)使用ICMP的回應請求和答覆來測試網路上節點的IP棧是否初始化及是否存活。
traceroute 通過使用TTL的逾時機制和ICMP的出錯信息的通報機制,顯示通往目標網路路徑上的路由器列表。這個命令將不能在DOS提示符下使用。
tracert 同traceroute一樣的命令,而它是一個微軟Windows命令,它不能在Cisco路由器上運行。
arp-a 在Windows PC機上顯示IP到MAC地址的映射。
show ip arp 與arp-a一樣,但它顯示的是在Cisco路由器上的ARP表。與traceroute和tracer命令一樣,它們不能在DOS和Cisco上互換使用。
ipconfig /all 只可用於DOS提示符下,用於顯示PC機上的網路配置。
一旦你掌握了所有的這些步驟,並在需要時適當運用DOS命令,即可發現了網路中的某個問題。

相關詞條

相關搜尋

熱門詞條

聯絡我們