<HUAWEI> display mac-address ------------------------------------------------------------------------------- MAC Address VLAN/VSI Learned-From Type ------------------------------------------------------------------------------- 0000-0000-0002 10/- - blackhole 0000-0000-0003 300/- GE1/0/3 static 0026-6e5c-feac 3000/- Eth-Trunk2 dynamic 0000-c116-0201 -/test Eth-Trunk3 dynamic ------------------------------------------------------------------------------- Total items displayed = 4
查看某个接口学习到的MAC地址
# 执行命令display mac-address dynamic gigabitethernet1/0/1,查看接口GE1/0/1学习到的MAC地址表项。
<HUAWEI> display mac-address dynamic gigabitethernet1/0/1 ------------------------------------------------------------------------------- MAC Address VLAN/VSI Learned-From Type ------------------------------------------------------------------------------- 0000-0000-0003 300/- GE1/0/1 dynamic 0026-6e5c-feac 3000/- GE1/0/1 dynamic ------------------------------------------------------------------------------- Total items displayed = 2
查看某个VLAN学习到的MAC地址
# 执行命令display mac-address dynamic vlan 10,查看VLAN 10学习到的MAC地址表项。
<HUAWEI> display mac-address dynamic vlan 10 ------------------------------------------------------------------------------- MAC Address VLAN/VSI Learned-From Type ------------------------------------------------------------------------------- 0000-0000-0003 10/- GE1/0/1 dynamic 0026-6e5c-feac 10/- GE1/0/2 dynamic ------------------------------------------------------------------------------- Total items displayed = 2
查看系统的MAC地址
可以通过下面两种方式,查看设备的MAC地址。
- 二层接口的MAC地址就是设备的MAC地址,执行命令display interface gigabitethernet1/0/1,显示信息中的00e0-f74b-6d00,即为设备的MAC地址。
<HUAWEI> display interface gigabitethernet1/0/1 GigabitEthernet1/0/1 current state : UP Line protocol current state : UP Description: Switch Port, Link-type : access(configured), PVID : 103, TPID : 8100(Hex), The Maximum Frame Length is 9216 IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-f74b-6d00 ......
- 在V200R002版本及之后版本,执行命令display bridge mac-address,查看设备的MAC地址。
<HUAWEI> display bridge mac-address System bridge MAC address: 00e0-f74b-6d00
-
查看接口的MAC地址
# 执行命令display interface gigabitethernet1/0/1,显示信息中的00e0-f74b-6d00,即为接口的MAC地址。
<HUAWEI> display interface gigabitethernet1/0/1 GigabitEthernet1/0/1 current state : UP Line protocol current state : UP Description: Switch Port, Link-type : access(configured), PVID : 103, TPID : 8100(Hex), The Maximum Frame Length is 9216 IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-f74b-6d00
-
查看VLANIF接口的MAC地址
# 执行命令display interface vlanif10,显示信息中的00e0-0987-7891,即为VLANIF接口的MAC地址。
<HUAWEI> display interface vlanif10 Vlanif10 current state : DOWN Line protocol current state : DOWN Description: Route Port,The Maximum Transmit Unit is 1500 Internet Address is 172.16.1.2/24 IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 00e0-0987-7891 Current system time: 2014-08-14 16:40:09+08:00 Input bandwidth utilization : -- Output bandwidth utilization : --
-
根据IP获取对应设备的MAC地址
# 执行命令display arp | include ip-address,即可获取指定IP对应设备的MAC地址。
例如:根据IP地址192.168.150.20获取对应设备的MAC地址。
<HUAWEI> display arp | include 192.168.150.20 IP ADDRESS MAC ADDRESS EXPIRE(M) TYPE INTERFACE VPN-INSTANCE VLAN ------------------------------------------------------------------------------ 192.168.150.20 000b-0935-766f 10 D-0 GE0/0/24 ------------------------------------------------------------------------------ Total:27 Dynamic:26 Static:0 Interface:1