最近使用到的一些交換機配置命令,記錄一下。
1. 通過mac地址查找所在交換機端口
show mac address-table address MAC地址 (MAC地址規則為**.**.**)
2. H3C交換機查看端口相鄰的網絡設備
Disp dnp
例如可以看出E1/0/48端口接了一台H3C交換機:
Interface: Ethernet1/0/48
Status: Enabled, Pkts Snd: 33175, Pkts Rvd: 98184, Pkts Err: 0
Neighbor 1: Aging Time: 134(s)
MAC Address : 70f9-6d09-013d
Host Name : H3C
Port Name : GigabitEthernet1/0/25
Software Ver: V500R001B01D010SP03
Device Name : H3C S3100V2-26TP-EI
Port Duplex : AUTO
Product Ver : Release 5103P01
BootROM Ver : 109
RJ-H3C通用(show--display):
show lldp neighbors detail
show lldp neighbors interface gigabitEthernet */* detail
超好用, 能看到臨近設備的IP地址等。
示例:
Ruijie(config)#show lldp neighbors interface gigabitEthernet 0/24 detail ---------------------------------------------------------------------------- LLDP neighbor-information of port [GigabitEthernet 0/24] ---------------------------------------------------------------------------- Neighbor index : 1 Device type : LLDP Device Update time : 1minutes 6seconds Aging time : 1minutes 33seconds Chassis ID type : MAC address Chassis ID : 0074.9c**.**** System name : Ruijie System description : Ruijie Full Gigabit Security & Intelligence Access Switch (S2928G-E) By Ruijie Networks System capabilities supported : Repeater, Bridge, Router System capabilities enabled : Repeater, Bridge, Router Management address subtype : ipv4 Management address : 192.168.**.** Interface numbering subtype : ifIndex Interface number : 4097 Object identifier : Port ID type : Interface name Port ID : Gi0/23 Port description : GigabitEthernet 0/23 802.1 organizationally information Port VLAN ID : 1 Port and protocol VLAN ID(PPVID) : 0 PPVID Supported : YES PPVID Enabled : NO VLAN name of VLAN 1 : VLAN0001 Protocol Identity :
(前提需開啟lldp協議—lldp enable,一般交換機默認是開啟的)
3. 追蹤設備在網絡中的位置(以下為銳捷命令,H3C相應自行轉換)
(1) 通過IP地址追蹤MAC地址:
show arp | include ip地址
(2) 通過mac地址追蹤設備經過的端口:
show mac-address-table | include mac地址
(3) 根據端口查看相鄰設備地址,進入下一級設備:
show lldp neighbors interface 端口號 detail
(4) 根據查看到的IP地址進入下一級設備,重復步驟(2)
PS:遇到aggregatePORT ,直接查看其構成端口的相鄰設備
(5) 直到找到底層端口位置
4. 追蹤設備在網絡中的位置(無線)
(1) 在管理設備上(如深信服AC)獲取用戶的IP地址
(2) A:直接通過電腦ping對方ip,用arp –a ip地址,獲取對方MAC地址
B:無法通過arp命令獲取mac地址時候,可以在H3C無線控制器命令行 獲取ip地址對應的MAC地址:display ip source binding | include IP地址
(3) 在web管理端直接查找MAC地址對應在哪個AP上
監控----客戶端---查找
銳捷無線控制器:
新版:在首頁用戶信號強度分布—詳情直接查找
舊版:在監控概覽---用戶信息在查找