FAQ-S5700交换机上通过ip地址来查询mac

发布时间:  2015-02-16 浏览次数:  1178 下载次数:  0
问题描述

怎样在交换机上通过命令来查看设备本身的mac地址,以及通过ip查询设备的mac地址的命令?

解决方案

查看设备本身的mac地址的命令

对于盒式设备,例如S2700/5700/S6700,可以通过查看二层接口的mac地址,也就是设备的MAC

如下,就是设备的mac地址:1047-8031-bbd0

[S5700]display interface
Eth-Trunk0 current state : DOWN
Line protocol current state : DOWN
Description:
Switch Port, Link-type : dot1q-tunnel,
PVID :   10, Hash arithmetic : According to SA-XOR-DA,The Maximum Frame Length is 1600
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 1047-8031-bbd0
Current system time: 2015-02-11 14:30:57+08:00
Last 300 seconds input rate 0 bits/sec, 0 packets/sec
Last 300 seconds output rate 0 bits/sec, 0 packets/sec
Input:  0 packets, 0 bytes
  Unicast:                          0,  Multicast:                           0
  Broadcast:                        0,  Jumbo:                               0
  Discard:                          0,  Pause:                               0
  Frames:                           0

  Total Error:                      0
  CRC:                              0,  Giants:                              0
  Jabbers:                          0,  Fragments:                           0
  Runts:                            0,  DropEvents:                          0
  Alignments:                       0,  Symbols:                             0
  Ignoreds:                         0

Output:  0 packets, 0 bytes
  Unicast:                          0,  Multicast:                           0
  Broadcast:                        0,  Jumbo:                               0
  Discard:                          0,  Pause:                               0
                                         
  Total Error:                      0
  Collisions:                       0,  ExcessiveCollisions:                 0
  Late Collisions:                  0,  Deferreds:                           0
  Buffers Purged:                   0

    Input bandwidth utilization  :    0%
    Output bandwidth utilization :    0%

如果是S9300的设备,可以通过命令 display system-mac 查看

<S9303>display system-mac
MAC-num      :1
Index         MAC Addr
----------------------------
default       0025-9e03-1329

current       d46a-b330-d341

如果需要通过ip地址查看下接设备的mac地址,dis arp命令加个参数就能看个某个接口下的全部ip和mac地址了,命令如下:

<S_Buick>sys
Enter system view, return user view with Ctrl+Z.
[S_Buick]dis arp interface ethernet 0/0/36
IP ADDRESS      MAC ADDRESS     EXPIRE(M) TYPE INTERFACE      VPN-INSTANCE      VLAN
------------------------------------------------------------------------------
192.168.3.38    900b-a60a-3b61  3         D-0  Eth0/0/36           3
192.168.3.39    4007-fc49-5c63  4         D-0  Eth0/0/36            3
192.168.3.42    4007-fc48-87cb  13        D-0  Eth0/0/36           3
192.168.3.37    4007-fc6b-3389  3         D-0  Eth0/0/36            3
192.168.3.41    4007-e68c-8bb5  1         D-0  Eth0/0/36           3
192.168.3.40    1009-05fb-3eec  7         D-0  Eth0/0/36            3
------------------------------------------------------------------------------
Total:6         Dynamic:6       Static:0    Interface:0

END