实用交换机配置命令行

   最近使用到的一些交换机配置命令,记录一下。

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上

             监控----客户端---查找

 锐捷无线控制器:

          新版:在首页用户信号强度分布详情直接查找

          旧版:在监控概览---用户信息在查找

原文地址:https://www.cnblogs.com/kellphen/p/9922214.html