MAC
MAC View
Section titled “MAC View”Table 1 MAC View
| Command | Purpose |
|---|---|
| show mac-address[{ethernet|link-aggregation} interface_name|all] | Display MAC address table. |
| clear mac-address [{ethernet|link-aggregation} interface_name|vlan vlan-id] {static|dynamic|all} | Clear MAC entries. |
| show mac-limit | Display MAC limit configuration. |
show mac-address [{ethernet|link-aggregation} interface_name|all]
Section titled “show mac-address [{ethernet|link-aggregation} interface_name|all]”[Command]
show mac-address [{ethernet|link-aggregation} interface_name|all]
[Purpose]
Display MAC address table.
[Parameters]
| Parameter | Description |
|---|---|
| interface_name | Interface name (eg.0/1) |
[View]
Privileged User View
[Use Cases]
sonic# show mac-address No. Vlan MacAddress Port Type----- ------ ----------------- --------- --------- 1 100 E2:8C:56:85:4A:11 0/0 StaticTotal number of entries 1sonic# show mac-address all No. Vlan MacAddress Port Type----- ------ ----------------- ----------- ------- 1 200 AA:BB:CC:11:22:33 0/129 DynamicTotal number of entries 1+--------+-------------------+--------------+-------+--------+| VLAN | MAC | RemoteVTEP | VNI | Type |+========+===================+==============+=======+========+| 200 | 60:EB:5A:01:10:B1 | 10.193.2.102 | 200 | Static |+--------+-------------------+--------------+-------+--------+
Total count : 1Aging time for switch is 1800 secondsclear mac-address [{ethernet|link-aggregation} interface_name|vlan vlan-id] {static|dynamic|all}
Section titled “clear mac-address [{ethernet|link-aggregation} interface_name|vlan vlan-id] {static|dynamic|all}”[Command]
clear mac-address [{ethernet|link-aggregation} interface_name|vlan vlan-id] {static|dynamic|all}
[Purpose]
Clear MAC entries.
[Parameters]
| Parameter | Description |
|---|---|
| interface_name | Interface name (eg.0/1) |
| vlan-id | VLAN ID, the range is [1,4094]. |
[View]
Privileged User View
[Use Cases]
sonic# clear mac-address dynamicshow mac-limit
Section titled “show mac-limit”[Command]
show mac-limit
[Purpose]
Display MAC limit configuration.
[View]
Privileged User View
[Use Cases]
sonic# show mac-limitInterface Mac-limit----------- -----------0/1 1000/2 200MAC Config
Section titled “MAC Config”Table 2 MAC Config
| Command | Purpose |
|---|---|
| mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id {ethernet|link-aggregation} interface_name | Configure a static MAC entry. |
| mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id blackhole | Configure a blackhole MAC entry. |
| mac-address timer {aging aging-time|no-aging} | Set MAC aging time. |
| mac-limit dynamic mac-limit-value | Set a limit to the number of dynamic MAC table entries. |
mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id {ethernet|link-aggregation} interface_name
Section titled “mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id {ethernet|link-aggregation} interface_name”[Command]
mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id {ethernet|link-aggregation} interface_name
[Purpose]
Configure a static MAC entry.
[Parameters]
| Parameter | Description |
|---|---|
| HH:HH:HH:HH:HH:HH | MAC address. |
| vlan-id | VLAN ID, the range is [1,4094]. |
| interface_name | Interface name (eg.0/1) |
[View]
Global Configuration View
[Notes]
Run command no mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id to delete a static MAC entry.
[Use Cases]
sonic# configure terminalsonic(config)# mac-address static aa:aa:aa:aa:aa:aa vlan 4 ethernet 0/4mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id blackhole
Section titled “mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id blackhole”[Command]
mac-addressstatic HH:HH:HH:HH:HH:HH vlan vlan-id blackhole
[Purpose]
Configure a blackhole MAC entry.
[Parameters]
| Parameter | Description |
|---|---|
| HH:HH:HH:HH:HH:HH | MAC address. |
| vlan-id | VLAN ID, the range is [1,4094]. |
[View]
Global Configuration View
[Notes]
Run command no mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id to delete a blackhole MAC entry.
[Use Cases]
sonic# configure terminalsonic(config)# mac-address aa:bb:bb:bb:bb:bb vlan 5 blackholemac-address timer {aging aging-time|no-aging}
Section titled “mac-address timer {aging aging-time|no-aging}”[Command]
mac-address timer {aging aging-time|no-aging}
[Purpose]
Set MAC aging time.
[Parameters]
| Parameter | Description |
|---|---|
| aging-time | Specify the aging time in seconds, the default is 1800, and the range is from 30 to 7200. |
[View]
Global Configuration View
[Notes]
MAC aging time is a parameter that affects MAC self-learning on the switch. Dynamic MAC entries will be automatically discarded after aging; and static MAC entries are not affected by MAC aging time. Run command mac-address timer no-aging to disable MAC aging.
[Use Cases]
sonic# configure terminalsonic(config)# mac-address timer aging 3600sonic(config)# mac-address timer no-agingmac-limit dynamic mac-limit-value
Section titled “mac-limit dynamic mac-limit-value”[Command]
mac-limit dynamic mac-limit-value
[Purpose]
Set a limit to the number of dynamic MAC table entries.
[Parameters]
| Parameter | Description |
|---|---|
| mac-limit-value | The range is from 1 to 131072. |
[View]
VLAN Configuration View/Physical Interface Configuration View
[Notes]
Only CX308P-48Y-N-V2 and CX532P-N-V2 support this feature. Only VLAN or VLAN member ports are allowed to configure the MAC number limit. Run command no mac-limit dynamic to delete MAC limit configuration.
[Use Cases]
sonic# configure terminalsonic(config)# interface ethernet 0/0sonic(config-if-0/0)# mac-limit dynamic 1000sonic(config-if-0/0)# exitsonic(config)# vlan 30sonic(config-vlan-30)# mac-limit dynamic 2000