Cisco交换机可以根据IP或者Mac地址,找到对应的交换机端口。命令语法如下:
show ip arp <ip address>
show mac-address-table address <mac address>
根据IP查询Mac地址:
6513>show ip arp 192.168.220.20
Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.220.20 9 001e.79c5.d0c1 ARPA Vlan2
根据MAC查询端口号:
6513>show mac-address-table address 001e.79c5.d0c1
Legend: * - primary entry
age - seconds since last seen
n/a - not available
vlan mac address type learn age ports
------+----------------+--------+-----+----------+--------------------------
Active Supervisor:
* 2 001e.79c5.d0c1 dynamic Yes 15 Gi7/1
Standby Supervisor:
* 2 001e.79c5.d0c1 dynamic Yes 20 Gi7/1
当网络中存在交换机级联时,查出来的是交换机级联端口,通过CDP协议,查找交换机级联信息,然后重新登录到主机连接的交换机,查询端口。
6513>show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
RD_LAB Gig 7/2 179 S I WS-C2960G Gig 0/48
TS_LAB Gig 8/1 178 S I WS-C2960G Gig 0/48
6513-3 Ten 9/3 143 R S I WS-C6513 Ten 7/1
6513-2 Ten 9/2 130 R S I WS-C6513 Ten 7/1
6504 Ten 9/1 162 R S I WS-C6504- Ten 1/1
关闭指定端口:
> en
# conf t
6513(config)# int Gi7/1
6513(config-if)# shutdown
Comments
There are currently no comments
New Comment