Dell Networking SONiC 介质访问控制 (MAC) 地址
摘要: 本文介绍 Dell SONiC 交换机中的 MAC 地址
本文适用于
本文不适用于
本文并非针对某种特定的产品。
本文并非包含所有产品版本。
说明
指数
什么是 MAC 地址
如何在交换机
中学习 MAC 地址配置静态 MAC 地址
配置 MAC 老化时间
配置 MAC 地址抑制
配置
示例验证
查看 MAC 地址表
按 MAC 地址查看 MAC
地址表条目按 VLAN
查看 MAC 地址表条目查看 MAC 地址计数
按接口
查看 MAC 地址条目通过 PortChannel
查看 MAC 地址条目查看静态 MAC 地址条目
查看动态 MAC 地址条目
什么是 MAC 地址
介质访问控制 (MAC) 地址是格式为 nn.nn.nn.nn.nn.nn 的 48 位编号。MAC 地址表包含静态和动态 MAC 地址条目。
- 静态 MAC 地址是用户配置的条目,不会老化。
- 动态学习的 MAC 地址是基于硬件的条目,根据配置的老化时间过期。
提醒:mac 地址表的最大容量因交换机型号和配置的 L2/L3 交换机配置文件而异。有关详细信息,请参阅文章 Dell Networking SONiC OS L2 and L3 Switch Profiles (Dell Networking SONiC OS L2和L3交换机配置文件) 。
如何在交换机中学习 MAC 地址
当交换机收到数据包时,它会在接收数据包的端口上的源 MAC 地址字段中学习 MAC 地址。然后,交换机在 MAC 地址表中查找指定 VLAN 的目标 MAC 地址。如果找到目标 MAC 地址,交换机会将数据包转发到相应的端口/端口通道。如果找不到目标 MAC 地址,交换机会在所有 VLAN 端口上充斥数据包。
当达到老化时间时,缺少源 MAC 接收的数据包,将从表中删除动态 MAC 地址条目。
提醒:Dell SONiC 中的默认 MAC 老化时间为 600 秒(10 分钟)。
配置静态 MAC 地址
要将静态 MAC 地址添加到 MAC 地址表,请手动配置地址。指定以太网端口或端口通道以及可通过其访问具有静态 MAC 地址的设备以及交换机可将数据包转发到的 VLAN。
配置语法
admin@sonic:~$ sonic-cli sonic# configure sonic(config)# mac address-table mac-address Vlan vlan-id |
示例配置
admin@sonic:~$ sonic-cli sonic# configure sonic(config)# no mac address-table 00:00:00:00:00:01 Vlan 10 |
要删除静态 MAC 地址,请使用未使用以太网端口或端口通道编号的完整命令的无版本。
配置示例
admin@sonic:~$ sonic-cli sonic# configure sonic(config)# no mac address-table 00:00:00:00:00:01 Vlan 10 |
配置 MAC 老化时间
为所有动态学习的 MAC 地址配置老化时间(0 到 1000000 秒;默认值为 600)。静态 MAC 地址条目不受 mac address-table aging-time 命令的影响。达到老化时间时,将从表中删除动态 MAC 地址条目。输入 0 以禁用 MAC 老化。输入无版本的 命令以恢复默认的老化时间。配置语法
admin@sonic:~$ sonic-cli sonic# configure sonic(config)# mac address-table aging-time |
示例配置
admin@sonic:~$ sonic-cli sonic# show mac address-table aging-time Global aging time: 600 seconds admin@sonic:~$ sonic-cli sonic# configure sonic(config)# mac address-table aging-time 1000 sonic(config)# exit sonic# show mac address-table aging-time Global aging time: 1000 seconds sonic(config)# mac address-table aging-time 0 sonic(config)# exit sonic# show mac address-table aging-time Global aging time: 0 seconds(disabled) sonic(config)# no mac address-table aging-time sonic(config)# exit sonic# show mac address-table aging-time Global aging time: 600 seconds |
配置 MAC 地址抑制
要限制可将动态 MAC 地址分配给不同接口的最大次数,请配置抑制阈值(5 到 100;无默认值)。配置语法
admin@sonic:~$ sonic-cli sonic# configure sonic(config)# mac address-table dampening-threshold |
要配置可将动态 MAC 地址分配给不同接口的最短时间间隔,请配置抑制间隔(1 到 1000000 秒;无默认值)。
配置语法
admin@sonic:~$ sonic-cli sonic# configure sonic(config)# mac address-table dampening-interval |
示例配置
admin@sonic:~$ sonic-cli sonic# configure sonic(config)# mac address-table 00:00:00:00:00:01 Vlan 10 Eth1/1 sonic(config)# mac address-table 00:00:00:00:00:01 Vlan 11 Eth1/1 sonic(config)# mac address-table 00:00:00:00:00:03 Vlan 30 Eth1/2 sonic(config)# mac address-table 00:00:00:00:00:05 Vlan 50 Eth1/3 sonic(config)# mac address-table 00:00:00:00:00:07 Vlan 70 Eth1/4 sonic(config)# mac address-table 00:00:00:00:00:09 Vlan 90 Eth1/5 sonic(config)# mac address-table 00:00:00:00:00:98 Vlan 10 Eth1/6 sonic(config)# mac address-table 00:00:00:00:00:99 Vlan 99 PortChannel 110 sonic(config)# mac address-table aging-time 1000 sonic(config)# mac address-table dampening-threshold 10 sonic(config)# mac address-table dampening-interval 100000 |
验证
使用 show mac-address table 命令查看 MAC 地址表信息。
show mac address-table [address mac-address] [aging-time] [interface Eth slot/port[/breakout-port]] [Vlan vlan-id] [PortChannel number] [count] [static] [dynamic] |
查看 MAC 地址表
输出示例
sonic# show mac address-table ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 10 00:00:00:00:00:01 STATIC Eth1/1 11 00:00:00:00:00:01 STATIC Eth1/1 100 00:00:00:00:00:10 DYNAMIC Eth1/9 20 00:00:00:00:00:02 DYNAMIC Eth1/2 30 00:00:00:00:00:03 STATIC Eth1/2 40 00:00:00:00:00:04 DYNAMIC Eth1/3 50 00:00:00:00:00:05 STATIC Eth1/3 60 00:00:00:00:00:06 DYNAMIC Eth1/4 70 00:00:00:00:00:07 STATIC Eth1/4 80 00:00:00:00:00:08 DYNAMIC Eth1/4 90 00:00:00:00:00:09 STATIC Eth1/5 99 00:00:00:00:00:99 STATIC PortChannel110 |
按 MAC 地址查看 MAC
地址表条目输出示例
sonic# show mac address-table address 00:00:00:00:00:01 ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 10 00:00:00:00:00:01 STATIC Eth1/1 11 00:00:00:00:00:01 STATIC Eth1/1 |
按 VLAN
查看 MAC 地址表条目输出示例
sonic# show mac address-table Vlan 10 ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 10 00:00:00:00:00:01 STATIC Eth1/1 10 00:00:00:00:00:98 STATIC Eth1/1 |
sonic# show mac address-table static Vlan 11 ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 11 00:00:00:00:00:01 STATIC Eth1/1 |
sonic# show mac address-table dynamic Vlan 60 ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 60 00:00:00:00:00:06 DYNAMIC Eth1/12 |
查看 MAC 地址计数
输出示例
sonic# show mac address-table count MAC Entries for all vlans : 13 Dynamic Address Count : 5 Static Address (User-defined) Count : 8 Total MAC Addresses in Use: 13 |
按接口
查看 MAC 地址条目输出示例
sonic# show mac address-table interface Eth1/1 ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 10 00:00:00:00:00:01 STATIC Eth1/1 10 00:00:00:00:00:98 STATIC Eth1/1 11 00:00:00:00:00:01 STATIC Eth1/1 |
sonic# show mac address-table static interface Eth1/3 ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 30 00:00:00:00:00:03 STATIC Eth1/3 |
sonic# show mac address-table dynamic interface Eth1/5 ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 60 00:00:00:00:00:06 DYNAMIC Eth1/5 |
通过 PortChannel
查看 MAC 地址条目输出示例
sonic# show mac address-table interface PortChannel 10 ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 99 00:00:00:00:00:99 STATIC PortChannel10 |
查看静态 MAC 地址条目
输出示例
sonic# show mac address-table static ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 10 00:00:00:00:00:01 STATIC Eth1/1 11 00:00:00:00:00:01 STATIC Eth1/1 30 00:00:00:00:00:03 STATIC Eth1/3 50 00:00:00:00:00:05 STATIC Eth1/5 70 00:00:00:00:00:07 STATIC Eth1/7 90 00:00:00:00:00:09 STATIC Eth1/9 10 00:00:00:00:00:98 STATIC Eth1/1 99 00:00:00:00:00:99 STATIC PortChannel10 |
sonic# show mac address-table static address 00:00:00:00:00:01 ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 10 00:00:00:00:00:01 STATIC Eth1/1 11 00:00:00:00:00:01 STATIC Eth1/1 |
查看动态 MAC 地址条目
输出示例
sonic# show mac address-table dynamic ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 100 00:00:00:00:00:10 DYNAMIC Eth1/1 20 00:00:00:00:00:02 DYNAMIC Eth1/2 40 00:00:00:00:00:04 DYNAMIC Eth1/3 60 00:00:00:00:00:06 DYNAMIC Eth1/4 80 00:00:00:00:00:08 DYNAMIC Eth1/5 |
sonic# show mac address-table dynamic address 00:00:00:00:00:06 ----------------------------------------------------------- VLAN MAC-ADDRESS TYPE INTERFACE ----------------------------------------------------------- 60 00:00:00:00:00:06 DYNAMIC Eth1/1 |
受影响的产品
Enterprise SONiC Distribution, PowerSwitch E3200-ON Series, PowerSwitch N3200-ON, PowerSwitch S5212F-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S5248F-ON, PowerSwitch S5296F-ON, PowerSwitch Z9264F-ON, PowerSwitch Z9332F-ON
, PowerSwitch Z9432F-ON
...
文章属性
文章编号: 000217932
文章类型: How To
上次修改时间: 02 10月 2023
版本: 5
从其他戴尔用户那里查找问题的答案
支持服务
检查您的设备是否在支持服务涵盖的范围内。