MAC 地址
MAC(媒体访问控制)地址是一个第 2 层构造,使用 48 位唯一标识网络接口控制器 (NIC),以便在网络内进行通信。
使用 NetQ,您可以
- 查看整个网络以及给定设备、VLAN、VLAN 上的出口端口和 VRR 的 MAC 地址
- 查看给定设备上 MAC 地址的计数
- 查看 MAC 地址在网络中存在的位置(MAC 历史记录)
- 查看有关 MAC 地址更改的注释(MAC 注释)
- 查看与 MAC 地址相关的事件
MAC 地址与交换机接口关联。它们分为以下几类:
- 源:MAC 地址由特定交换机在一个或多个接口上拥有。一个 MAC 地址通常只有一个源节点。例外情况是配置 MLAG 时,MLAG 对的 VRR 接口上的 MAC 相同;以及配置 EVPN 时,MAC 分布在第 3 层网关上。
- 远程:MAC 地址由控制平面在指向特定远程位置的隧道接口上学习或分发。对于给定的 MAC 地址和 VLAN,只有一个第一跳交换机(或交换机对),但多个节点可以具有相同的远程 MAC 地址。
- 本地(非源和非远程):MAC 地址在网桥上学习,并指向另一台交换机上的接口。如果接口的 LLDP 邻居是主机,则此交换机是学习 MAC 地址的第一跳交换机。对于给定的 MAC 地址和 VLAN,只有一个第一跳交换机,除非交换机是 MLAG 对的一部分,并且两个交换机上的接口形成双连接或单连接链路聚合。
MAC 命令
使用以下命令监控 MAC 地址。有关其他选项、定义和示例,请参阅命令行参考。
- 要查看整个网络中的所有 MAC 地址,请使用
netq show macs
命令。 - 要查看与 VLAN 关联的 MAC 地址,请使用
netq show macs vlan
命令。 - 要查看与出口端口关联的 MAC 地址,请使用
netq show macs egress-port
命令。 - 要查看与 VRR(虚拟路由器反射器)接口配置关联的所有 MAC 地址,请使用
netq show interfaces type macvlan
命令。 - 要查看 MAC 地址的历史记录,请使用
netq show mac-history
命令。 - 要查看 MAC 地址注释,请使用
netq show mac-commentary
命令。
在 UI 中查看 MAC 地址
NetQ UI 提供了当前 MAC 地址的列表,您可以按主机名、时间戳、MAC 地址、VLAN 或源进行过滤。您可以按这些参数以及远程、静态和下一跳对列表进行排序。要查看 MAC 地址,请打开 菜单 并搜索 MAC 地址

在此屏幕中,选择 过滤器 以按主机名、时间戳、MAC 地址、VLAN 或源过滤结果。

查看 MAC 地址注释
您可以获取有关特定 VLAN 上给定 MAC 地址更改的更多描述性信息。注释适用于以下基于其分类的 MAC 地址相关事件(请参阅本主题开头的定义)
事件触发器 | 示例注释 |
---|---|
创建 MAC 地址,或通过 /etc/network/interface 中的 hwaddress 选项更改接口上的 MAC 地址 | leaf01 00:00:5e:00:00:03 在接口 vlan1000-v0 上配置 |
接口成为链路聚合中的从属接口,或从链路聚合中删除 | leaf01 00:00:5e:00:00:03 在接口 vlan1000-v0 上配置 |
接口是一个网桥,并且由于成员资格更改而继承了不同的 MAC 地址 | leaf01 00:00:5e:00:00:03 在接口 vlan1000-v0 上配置 |
远程 MAC 地址由控制平面在隧道接口上学习或安装 | 44:38:39:00:00:5d 在 vni vni10 上学习/安装,指向远程目标 10.0.1.34 |
远程 MAC 地址被刷新或过期 | leaf01 44:38:39:00:00:5d 已刷新或过期 |
远程 MAC 地址从一个远程交换机后移动到另一个远程交换机,或变为本地 MAC 地址 | leaf02:00:08:00:00:aa:13 从远程目标 27.0.0.22 移动到远程目标 27.0.0.34 00:08:00:00:aa:13 从远程目标 27.0.0.22 移动到本地接口 hostbond2 |
MAC 地址在第一跳交换机(或 MLAG 交换机对)上学习 | leaf04(和 MLAG 对等交换机 leaf05):44:38:39:00:00:5d 在第一跳交换机上学习,指向本地接口 bond4 |
本地 MAC 地址被刷新或过期 | leaf04(和 MLAG 对等交换机 leaf05)44:38:39:00:00:5d 从 bond4 刷新或过期 |
本地 MAC 地址从一个接口移动到另一个接口或另一个交换机 | leaf04:00:08:00:00:aa:13 从 hostbond2 移动到 hostbond3 00:08:00:00:aa:13 从 hostbond2 移动到远程目标 27.0.0.13 |
要查看 MAC 地址注释
选择
菜单。
搜索 MAC 地址。
选择其中一个条目旁边的复选框,然后选择表上方的
打开卡片。
选择时间范围,然后单击继续。
您可以滚动列表以查看与 MAC 地址移动和更改相关的注释

- (可选)从此处,您可以通过选择
过滤器,按给定设备过滤列表。
要查看 MAC 地址注释,请使用 netq show mac-commentary
命令。以下示例显示了常见情况下的注释。
本地配置的 MAC 地址
在此示例中,46:38:39:00:00:44 MAC 地址在多个交换机的 VlanA-1 接口上配置,因此我们看到了它们中每一个上的 MAC 配置注释。
cumulus@server-01:~$ netq show mac-commentary 46:38:39:00:00:44 between now and 1hr
Matching mac_commentary records:
Last Updated Hostname VLAN Commentary
------------------------- ---------------- ------ --------------------------------------------------------------------------------
Mon Aug 24 2020 14:14:33 leaf11 100 leaf11: 46:38:39:00:00:44 configured on interface VlanA-1
Mon Aug 24 2020 14:15:03 leaf12 100 leaf12: 46:38:39:00:00:44 configured on interface VlanA-1
Mon Aug 24 2020 14:15:19 leaf21 100 leaf21: 46:38:39:00:00:44 configured on interface VlanA-1
Mon Aug 24 2020 14:15:40 leaf22 100 leaf22: 46:38:39:00:00:44 configured on interface VlanA-1
Mon Aug 24 2020 14:15:19 leaf21 1003 leaf21: 46:38:39:00:00:44 configured on interface VlanA-1
Mon Aug 24 2020 14:15:40 leaf22 1003 leaf22: 46:38:39:00:00:44 configured on interface VlanA-1
Mon Aug 24 2020 14:16:32 leaf02 1003 leaf02: 00:00:5e:00:01:01 configured on interface VlanA-1
在服务器上配置并从对等方学习的 MAC 地址
在此示例中,00:08:00:00:aa:13 MAC 地址在 server01 上配置。因此,leaf11 和 leaf12 都在下一跳接口 serv01bond2 上学习了此地址(本地学习),而 leaf01 交换机在 vx-34 上远程学习了此地址(远程学习)。
cumulus@server11:~$ netq show mac-commentary 00:08:00:00:aa:13 vlan 1000 between now and 5hr
Matching mac_commentary records:
Last Updated Hostname VLAN Commentary
------------------------- ---------------- ------ --------------------------------------------------------------------------------
Tue Aug 25 2020 10:29:23 leaf12 1000 leaf12: 00:08:00:00:aa:13 learned on first hop switch interface serv01bond2
Tue Aug 25 2020 10:29:23 leaf11 1000 leaf11: 00:08:00:00:aa:13 learned on first hop switch interface serv01bond2
Tue Aug 25 2020 10:29:23 leaf01 1000 leaf01: 00:08:00:00:aa:13 learned/installed on vni vx-34 pointing to remote dest 36.0.0.24
删除的 MAC 地址
在此示例中,删除了 00:02:00:00:00:a0 MAC 地址、接口 VlanA-1 和 VLAN 100 的网桥 FDB 条目,从而影响了 leaf11 和 leaf12。
cumulus@server11:~$ netq show mac-commentary 00:02:00:00:00:a0 vlan 100 between now and 5hr
Matching mac_commentary records:
Last Updated Hostname VLAN Commentary
------------------------- ---------------- ------ --------------------------------------------------------------------------------
Mon Aug 24 2020 14:14:33 leaf11 100 leaf11: 00:02:00:00:00:a0 configured on interface VlanA-1
Mon Aug 24 2020 14:15:03 leaf12 100 leaf12: 00:02:00:00:00:a0 learned on first hop switch interface peerlink-1
Tue Aug 25 2020 13:06:52 leaf11 100 leaf11: 00:02:00:00:00:a0 unconfigured on interface VlanA-1
在服务器上移动并从对等方学习的 MAC 地址
server11 上的 MAC 地址从 00:08:00:00:aa:13 更改。在此示例中,在 leaf01 上远程学习的 MAC 现在是从其本地接口 swp6 本地学习的 MAC 地址。同样,在 leaf11 和 leaf12 上本地学习的 MAC 地址现在是从远程目标 27.0.0.22 学习的。
cumulus@server11:~$ netq show mac-commentary 00:08:00:00:aa:13 vlan 1000 between now and 5hr
Matching mac_commentary records:
Last Updated Hostname VLAN Commentary
------------------------- ---------------- ------ --------------------------------------------------------------------------------
Tue Aug 25 2020 10:29:23 leaf12 1000 leaf12: 00:08:00:00:aa:13 learned on first hop switch interface serv01bond2
Tue Aug 25 2020 10:29:23 leaf11 1000 leaf11: 00:08:00:00:aa:13 learned on first hop switch interface serv01bond2
Tue Aug 25 2020 10:29:23 leaf01 1000 leaf01: 00:08:00:00:aa:13 learned/installed on vni vx-34 pointing to remote dest 36.0.0.24
Tue Aug 25 2020 10:33:06 leaf01 1000 leaf01: 00:08:00:00:aa:13 moved from remote dest 36.0.0.24 to local interface swp6
Tue Aug 25 2020 10:33:06 leaf12 1000 leaf12: 00:08:00:00:aa:13 moved from local interface serv01bond2 to remote dest 27.0.0.22
Tue Aug 25 2020 10:33:06 leaf11 1000 leaf11: 00:08:00:00:aa:13 moved from local interface serv01bond2 to remote dest 27.0.0.22
从 MLAG 对学习的 MAC 地址
在此示例中,在 leaf11 和 leaf12 上本地第一跳学习 00:02:00:00:00:1c MAC 地址后,MLAG 在双连接接口 serv01bond3 上交换了学习结果。
cumulus@server11:~$ netq show mac-commentary 00:02:00:00:00:1c vlan 105 between now and 2d
Matching mac_commentary records:
Last Updated Hostname VLAN Commentary
------------------------- ---------------- ------ --------------------------------------------------------------------------------
Sun Aug 23 2020 14:13:39 leaf11 105 leaf11: 00:02:00:00:00:1c learned on first hop switch interface serv01bond3
Sun Aug 23 2020 14:14:02 leaf12 105 leaf12: 00:02:00:00:00:1c learned on first hop switch interface serv01bond3
Sun Aug 23 2020 14:14:16 leaf11 105 leaf11: 00:02:00:00:00:1c moved from interface serv01bond3 to interface serv01bond3
Sun Aug 23 2020 14:14:23 leaf12 105 leaf12: 00:02:00:00:00:1c learned on MLAG peer dually connected interface serv01bond3
Sun Aug 23 2020 14:14:37 leaf11 105 leaf11: 00:02:00:00:00:1c learned on MLAG peer dually connected interface serv01bond3
Sun Aug 23 2020 14:14:39 leaf12 105 leaf12: 00:02:00:00:00:1c moved from interface serv01bond3 to interface serv01bond3
Sun Aug 23 2020 14:53:31 leaf11 105 leaf11: 00:02:00:00:00:1c learned on MLAG peer dually connected interface serv01bond3
Mon Aug 24 2020 14:15:03 leaf12 105 leaf12: 00:02:00:00:00:1c learned on MLAG peer dually connected interface serv01bond3
刷新的 MAC 地址
在此示例中,与 00:02:00:00:00:2d MAC 地址和 VLAN 1008 关联的接口 VlanA-1 被删除,从而影响了 leaf11 和 leaf12。
cumulus@server11:~$ netq show mac-commentary 00:02:00:00:00:2d vlan 1008 between now and 5hr
Matching mac_commentary records:
Last Updated Hostname VLAN Commentary
------------------------- ---------------- ------ --------------------------------------------------------------------------------
Mon Aug 24 2020 14:14:33 leaf11 1008 leaf11: 00:02:00:00:00:2d learned/installed on vni vx-42 pointing to remote dest 27.0.0.22
Mon Aug 24 2020 14:15:03 leaf12 1008 leaf12: 00:02:00:00:00:2d learned/installed on vni vx-42 pointing to remote dest 27.0.0.22
Mon Aug 24 2020 14:16:03 leaf01 1008 leaf01: 00:02:00:00:00:2d learned on MLAG peer dually connected interface swp8
Tue Aug 25 2020 11:36:06 leaf11 1008 leaf11: 00:02:00:00:00:2d is flushed or expired
Tue Aug 25 2020 11:36:06 leaf11 1008 leaf11: 00:02:00:00:00:2d on vni 1008 remote dest changed to 27.0.0.22