首页/网络/网络设备配置速查/接口 MAC 地址查看与修改
接口与链路73 条

接口 MAC 地址查看与修改

查接口 MAC 用于对接端绑定、溯源;修改接口 MAC 用于替换设备时保持上游策略不变(谨慎使用)。三厂地址格式不同:华为/H3C 用短横线,思科用点分。

网络设备配置速查网络更新于 2026-10-12
场景替换设备、MAC 溯源、链路对接核对
适用全部设备
命令族display interface(MAC 字段)/ show interfaces / display interface

华为 VRP

华为 VRP
<Huawei> display interface GigabitEthernet 0/0/1 | include MAC
! 输出如:Hardware address is 0011-2233-4455
[Huawei-GigabitEthernet0/0/1] mac-address 0011-2233-4456   ! 修改(谨慎)

思科 IOS

思科 IOS
SW-CORE-01# show interfaces GigabitEthernet1/0/1 | include address
! 输出如:hardware is Gigabit Ethernet, address is 0011.2233.4455
SW-CORE-01(config-if)# mac-address 0011.2233.4456

H3C Comware

H3C Comware
<H3C> display interface GigabitEthernet 1/0/1 | include MAC
! 输出如:Hardware address is 0011-2233-4455
[H3C-GigabitEthernet1/0/1] mac-address 0011-2233-4456
格式对照:华为/H3C xxxx-xxxx-xxxx,思科 xxxx.xxxx.xxxx(同一地址两种写法)。物理口 MAC 默认取设备/单板基地址,改 MAC 后记得同步更新上游静态绑定与安全策略。

易错点

  • 改接口 MAC 会触发端口的 MAC 迁移日志与安全特性告警,生产环境尽量不动
  • 把思科点分格式直接粘到华为会报格式错误,录入前先转换

数据来源与参考

  • 华为产品文档:MAC 地址配置
  • Cisco mac-address 命令
  • H3C Comware 7 MAC 地址配置

相关工具

​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌