通过IP查询交换机端口
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
具体接口
AGING TIME(s)
AGING 老化时间
--- 1 mac address(es) found ---
二,定位接口
三,判断接口类型
1,通过ndp或者LLDP协议查询
例如ndp协议
[kc_A15_209_S5120_62.253]display ndp interface GigabitEthernet 1/0/21 查询命令(display ndp查询全部接口)
VLAN/CEVLAN
------------------------------------------------------------------------------
10.1.117.199
c03f-d5e0-ceca 7
D-0
GE5/0/22
查询的IP
物理地址
老化时间 接口类型 具体接口
三,判断接口类型
3,通过查看mac协议判断
如果通过mac-address命令查看,可以查看此接口下有多个mac地址存在,代表此接口直连设备肯定是交换机或者 无线路由器,肯定不是电脑。
[kc_A15_209_S5120_62.253]display mac-address interface GigabitEthernet 1/0/21
例如华为交换机:
[kc_A15_209_S5120_62.253]display mac-address c03f-d5e0-ceca
MAC ADDR
VLAN ID
STATE
PORT INDEX
c03f-d5e0-ceca 117
Learned GigabitEthernet1/0/21
查询的MAC地址 对应的VLAN 得到类型
MAC Address VLAN/VSI
Learned-From Type
-------------------------------------------------------------------------------
c03f-d5e0-ceca 117/-
GE0/0/12
dynamic
1,通过以上命令,综合判断接口是否要查询的接口。
1:
[A15-2F-62.249]display mac-address C03F-D5E0-CECA
-------------------------------------------------------------------------------
8825-93e2-d0a2 117 Learned GigabitEthernet1/0/21 AGING
8825-93e2-d1cf 117 Learned GigabitEthernet1/0/21 AGING
c03f-d5e0-c5b6 117 Learned GigabitEthernet1/0/21 AGING
------------------------------------------------------------------------------
Total:1081 Dynamic:1046 Static:0 Interface:35
一,获取地址
二,定位具体接口
1.得到MAC地址和具体接口类型后,通过网段判断所在厂区,通过mac协议的查询命令, 从上到下的顺序查询的接口。(查询到接口后,要判断此接口的直连设备,如是交换机, 需继续查询,如是电脑则完成查询)
LLDP neighbor-information of port 1[GigabitEthernet1/0/1]: Neighbor index : 1 Update time : 14 days,1 hours,11 minutes,16 seconds Chassis type : MAC address Chassis ID : 3822-d6e1-a203 Port ID type : Interface name Port ID : GigabitEthernet1/1/1 Port description : GigabitEthernet1/1/1 System name : kc_a15_s3100_62.233 System description : H3C S3100-26TP-SI System capabilities supported : Bridge System capabilities enabled : Bridge
询
Flow-control is not enabled
结
The Maximum Frame Length is 9216 Broadcast MAX-ratio: 100%
果
Unicast MAX-ratio: 100%
Multicast MAX-ratio: 100%
Allow jumbo frame to pass
确定端口
3
4
判断接口类型
一,通过IP地址查询MAC地址
得到IP地址后,通过三层交换机ARP协议命令来查询MAC地址和具体接口:
例如华为交换机:
<A15_2F_S7706_10.254.254.1>display arp | include 10.1.117.199
IP ADDRESS MAC ADDRESS EXPIRE(M) TYPE INTERFACE VPN-INSTANCE
PVID: 1
Mdi type: auto
Port link-type: trunk
VLAN passing : 1(default vlan), 2-3, 5, 10, 30, 32, 60-63, 93, 115-117, 220, 226, 238, 1000, 1201, 2000
VLAN permitted: 1(default vlan), 2-4094
询
3497-f68d-082e 117 Learned GigabitEthernet1/0/21 AGING
结Leabharlann 3497-f68f-91de 117 Learned GigabitEthernet1/0/21 AGING
果
68f7-2888-6108 117 Learned GigabitEthernet1/0/21 AGING
Trunk port encapsulation: IEEE 802.1q Port priority: 0
Last clearing of counters: Never
Peak value of input: 45611912 bytes/sec, at 2000-07-09 15:16:10
三,接口类型
MAC ADDR VLAN ID STATE PORT INDEX
AGING TIME(s)
688f-84ed-1aef 1 Learned GigabitEthernet1/0/21 AGING
001d-0924-2ad6 62 Learned GigabitEthernet1/0/21 AGING
c03f-d5e0-c710 117 Learned GigabitEthernet1/0/21 AGING
c03f-d5e0-ceca 117 Learned GigabitEthernet1/0/21 AGING
d8cb-8a2a-5921 117 Learned GigabitEthernet1/0/21 AGING
查 询 结 果
MAC地址 对应设备的具体接口 软件版本 设备名字 接口速度状态(目前全双工)
Hardware Ver: S1720 V200R006C10SPC100
硬件版本
三,接口类型
三,判断接口类型
1,通过ndp或者LLDP协议查询 例如LLDP协议
[kc_A15_209_S5120_62.253]display lldp neighbor-information interface GigabitEthernet 1/0/1 查询命令
Loopback is not set
Media type is twisted pair
Port hardware type is 1000_BASE_T
1000Mbps-speed mode, full-duplex mode
查
Link speed type is autonegotiation, link duplex type is autonegotiation
Interface: GigabitEthernet1/0/21
本设备具体接口
Status: Enabled, Pkts Snd: 111108, Pkts Rvd: 110282, Pkts Err: 0
接口状态
Neighbor 1: Aging Time: 164(s)
邻居接口老化时间
MAC Address : 688f-84ed-1aef Port Name : GigabitEthernet0/0/28 Software Ver: Version 5.160 V200R006C10SPC100 Device Name : A15-2F-62.249 Port Duplex : FULL
-------------------------------------------------------------------------------
Total items displayed = 1
BYD_IT
——部品件IT科
第一章 查询IP对应的交换机端口
目录页 CONTENTS PAGE
display mac-address c03f-d5e0-ceca
定位具体接口
1
2
获取IP和MAC地址
display arp | include 10.1.117.199
display ndp interface GigabitEthernet 1/0/21 display lldp neighbor-information interface GigabitEthernet 1/0/1 display mac-address interface GigabitEthernet 1/0/21
e0d5-5e03-f76a 117 Learned GigabitEthernet1/0/21 AGING
f8bc-1279-1579 117 Learned GigabitEthernet1/0/21 AGING
--- 16 mac address(es) found ---
三,接口类型
四,确定端口
查 询 结 果
设备接口的标识 设备名字 设备系统的标识
Management address type : ipv4
Management address
: 10.1.62.233
Management address interface type : IfIndex
Management address interface ID : 519
Management address OID
:0
对应于设备IP地址
Port VLAN ID(PVID): 1 ……….
三,接口类型
三,判断接口类型
2,通过接口类型判断
通过查看该接口类型的来判断接口
Trunk:代表该接口直连设备肯定不是电脑,而是其他支持Trunk口的设备,例如交换机,无线路由器等。 Access:代表该接口直连设备可能电脑、非网管型的交换机,或者智能交换机 Hybrid:查看具体配置来判断直连设备 例如华为交换机:
[kc_A15_209_S5120_62.253-GigabitEthernet1/0/21]display interface GigabitEthernet 1/0/21
GigabitEthernet1/0/21 current state: UP
IP Packet Frame Type: PKTFMT_ETHNT_2, Hardware Address: 0cda-4117-21cb Description: to_a15_62.249
4061-869d-dd1e 62 Learned GigabitEthernet1/0/21 AGING
688f-84ed-1aef 62 Learned GigabitEthernet1/0/21 AGING
查
100d-0e74-93b5 117 Learned GigabitEthernet1/0/21 AGING