


利用IP地址查交換機端口
添加時間:2010-11-14
添加:
admin
在一個Cisco 交換網絡中間,已知某臺機器的IP地址,如何找出它連接到了哪臺交換機的哪個端口上呢?最方便快捷的方法使使用CiscoWorks 2000 LMS網管軟件的User tracking 功能,圖形化界面,一目了然。
如果沒有這個軟件,也可以使用以下手工分析方法來找出答案:
示例網絡:核心交換機為6509(交換引擎SE用CatOS, MSFC運行IOS軟件)
1. 找出該IP所對應的MAC地址:
通過查看系統(tǒng)的ARP緩存表可以找出某IP所對應的MAC地址。由于ARP不能跨VLAN進行,所以連接各個VLAN的路由模塊MSFC就是最佳的選擇--一般它在每一個VLAN都有一個端口(interface vlan n),能正確地進行ARP解釋。
6509MSFC#ping 10.10.1.65
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.1.65, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
6509MSFC#show arp | in 10.10.1.65
Internet 10.10.1.65 2 0006.2973.121d ARPA Vlan2
通過以上命令,我們知道10.10.1.65的MAC地址是0006.2973.121d, 這是IOS設備的MAC地址表達方式,在CatOS中,應寫為00-06-29-73-12-1d.
2.在交換機上找出MAC地址所對應的端口
6509SE> (enable) show cam 00-06-29-73-12-1d
* = Static Entry. + = Permanent Entry. # = System Entry. R = Router Entry.
X = Port Security Entry $ = Dot1x Security Entry
VLAN Dest MAC/Route Des [CoS] Destination Ports or VCs / [Protocol Type]
2 00-06-29-73-12-1d 9/41 [ALL]
Total Matching CAM Entries Displayed =1
這是不是說IP為 10.10.1.65的機器就接在端口9/41上呢?
不一定。如果以下命令中顯示該端口上只有一個活動的MAC地址,那么答案就是肯定的:
6509SE> (enable) show cam dynamic 9/41
* = Static Entry. + = Permanent Entry. # = System Entry. R = Router Entry.
X = Port Security Entry $ = Dot1x Security Entry
VLAN Dest MAC/Route Des [CoS] Destination Ports or VCs / [Protocol Type]
2 00-06-29-73-12-1d 9/41 [ALL]
Total Matching CAM Entries Displayed =1
如果該命令顯示該端口上有多個活動的MAC地址,那么這個端口應該連接到別的交換機或HUB設備上,見下面的例子(查找IP為10.10.1.250所對應的交換機端口):
6509MSFC#ping 10.10.1.250
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.1.250, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
6509MSFC#show arp | in 10.10.1.250
Internet 10.10.1.250 4 0009.6b8c.64ec ARPA Vlan2
6509SE> (enable) show cam 00-09-6b-8c-64-ec
* = Static Entry. + = Permanent Entry. # = System Entry. R = Router Entry.
X = Port Security Entry $ = Dot1x Security Entry
VLAN Dest MAC/Route Des [CoS] Destination Ports or VCs / [Protocol Type]
---- ------------------ ----- -------------------------------------------
2 00-09-6b-8c-64-ec 3/11 [ALL]
Total Matching CAM Entries Displayed =1
6509SE> (enable) show cam dy 3/11
* = Static Entry. + = Permanent Entry. # = System Entry. R = Router Entry.
X = Port Security Entry $ = Dot1x Security Entry
VLAN Dest MAC/Route Des [CoS] Destination Ports or VCs / [Protocol Type]
1 00-03-e3-4b-06-80 3/11 [ALL]
1 00-08-02-e6-b0-cd 3/11 [ALL]
1 00-02-a5-ee-f2-4f 3/11 [ALL]
1 00-09-6b-8c-66-d6 3/11 [ALL]
1 00-09-6b-63-17-d9 3/11 [ALL]
1 00-0b-cd-03-ec-f5 3/11 [ALL]
1 00-09-6b-63-17-d8 3/11 [ALL]
1 00-08-02-e6-b0-c1 3/11 [ALL]
1 00-08-02-e6-b0-85 3/11 [ALL]
1 00-08-02-e6-b0-81 3/11 [ALL]
1 00-02-a5-ef-16-af 3/11 [ALL]
1 00-02-a5-ee-f2-93 3/11 [ALL]
1 00-02-55-c6-05-61 3/11 [ALL]
2 00-09-6b-8c-64-ec 3/11 [ALL]
1 00-08-02-e6-b0-ed 3/11 [ALL]
1 00-08-02-e6-b0-a9 3/11 [ALL]
1 00-02-55-54-7a-e0 3/11 [ALL]
1 00-02-a5-ef-15-a6 3/11 [ALL]
1 00-08-02-e6-af-8f 3/11 [ALL]
1 00-08-02-e6-b0-bd 3/11 [ALL]
1 00-0b
如果沒有這個軟件,也可以使用以下手工分析方法來找出答案:
示例網絡:核心交換機為6509(交換引擎SE用CatOS, MSFC運行IOS軟件)
1. 找出該IP所對應的MAC地址:
通過查看系統(tǒng)的ARP緩存表可以找出某IP所對應的MAC地址。由于ARP不能跨VLAN進行,所以連接各個VLAN的路由模塊MSFC就是最佳的選擇--一般它在每一個VLAN都有一個端口(interface vlan n),能正確地進行ARP解釋。
6509MSFC#ping 10.10.1.65
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.1.65, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
6509MSFC#show arp | in 10.10.1.65
Internet 10.10.1.65 2 0006.2973.121d ARPA Vlan2
通過以上命令,我們知道10.10.1.65的MAC地址是0006.2973.121d, 這是IOS設備的MAC地址表達方式,在CatOS中,應寫為00-06-29-73-12-1d.
2.在交換機上找出MAC地址所對應的端口
6509SE> (enable) show cam 00-06-29-73-12-1d
* = Static Entry. + = Permanent Entry. # = System Entry. R = Router Entry.
X = Port Security Entry $ = Dot1x Security Entry
VLAN Dest MAC/Route Des [CoS] Destination Ports or VCs / [Protocol Type]
2 00-06-29-73-12-1d 9/41 [ALL]
Total Matching CAM Entries Displayed =1
這是不是說IP為 10.10.1.65的機器就接在端口9/41上呢?
不一定。如果以下命令中顯示該端口上只有一個活動的MAC地址,那么答案就是肯定的:
6509SE> (enable) show cam dynamic 9/41
* = Static Entry. + = Permanent Entry. # = System Entry. R = Router Entry.
X = Port Security Entry $ = Dot1x Security Entry
VLAN Dest MAC/Route Des [CoS] Destination Ports or VCs / [Protocol Type]
2 00-06-29-73-12-1d 9/41 [ALL]
Total Matching CAM Entries Displayed =1
如果該命令顯示該端口上有多個活動的MAC地址,那么這個端口應該連接到別的交換機或HUB設備上,見下面的例子(查找IP為10.10.1.250所對應的交換機端口):
6509MSFC#ping 10.10.1.250
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.1.250, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
6509MSFC#show arp | in 10.10.1.250
Internet 10.10.1.250 4 0009.6b8c.64ec ARPA Vlan2
6509SE> (enable) show cam 00-09-6b-8c-64-ec
* = Static Entry. + = Permanent Entry. # = System Entry. R = Router Entry.
X = Port Security Entry $ = Dot1x Security Entry
VLAN Dest MAC/Route Des [CoS] Destination Ports or VCs / [Protocol Type]
---- ------------------ ----- -------------------------------------------
2 00-09-6b-8c-64-ec 3/11 [ALL]
Total Matching CAM Entries Displayed =1
6509SE> (enable) show cam dy 3/11
* = Static Entry. + = Permanent Entry. # = System Entry. R = Router Entry.
X = Port Security Entry $ = Dot1x Security Entry
VLAN Dest MAC/Route Des [CoS] Destination Ports or VCs / [Protocol Type]
1 00-03-e3-4b-06-80 3/11 [ALL]
1 00-08-02-e6-b0-cd 3/11 [ALL]
1 00-02-a5-ee-f2-4f 3/11 [ALL]
1 00-09-6b-8c-66-d6 3/11 [ALL]
1 00-09-6b-63-17-d9 3/11 [ALL]
1 00-0b-cd-03-ec-f5 3/11 [ALL]
1 00-09-6b-63-17-d8 3/11 [ALL]
1 00-08-02-e6-b0-c1 3/11 [ALL]
1 00-08-02-e6-b0-85 3/11 [ALL]
1 00-08-02-e6-b0-81 3/11 [ALL]
1 00-02-a5-ef-16-af 3/11 [ALL]
1 00-02-a5-ee-f2-93 3/11 [ALL]
1 00-02-55-c6-05-61 3/11 [ALL]
2 00-09-6b-8c-64-ec 3/11 [ALL]
1 00-08-02-e6-b0-ed 3/11 [ALL]
1 00-08-02-e6-b0-a9 3/11 [ALL]
1 00-02-55-54-7a-e0 3/11 [ALL]
1 00-02-a5-ef-15-a6 3/11 [ALL]
1 00-08-02-e6-af-8f 3/11 [ALL]
1 00-08-02-e6-b0-bd 3/11 [ALL]
1 00-0b
新文章:
- CentOS7下圖形配置網絡的方法
- CentOS 7如何添加刪除用戶
- 如何解決centos7雙系統(tǒng)后丟失windows啟動項
- CentOS單網卡如何批量添加不同IP段
- CentOS下iconv命令的介紹
- Centos7 SSH密鑰登陸及密碼密鑰雙重驗證詳解
- CentOS 7.1添加刪除用戶的方法
- CentOS查找/掃描局域網打印機IP講解
- CentOS7使用hostapd實現(xiàn)無AP模式的詳解
- su命令不能切換root的解決方法
- 解決VMware下CentOS7網絡重啟出錯
- 解決Centos7雙系統(tǒng)后丟失windows啟動項
- CentOS下如何避免文件覆蓋
- CentOS7和CentOS6系統(tǒng)有什么不同呢
- Centos 6.6默認iptable規(guī)則詳解