View Categories

MAC

6 min read

4.2 MAC Address Table #

4.2.1 Generation of MAC Address Table Entries

4.2.2 Classification of MAC Address Table Entries

4.3 MAC Configuration #

4.3.1 MAC Default Setting

ParametersDefault value
Dynamic MAC table entry aging time1800 seconds
MAC address learningOpen
MAC drift detection functionOpen

4.3.2 Configure Static MAC

OperationCommandsDescription
Enter global configuration view.configure terminal-
Configure a static MAC.mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id interface-type interface-nameInterface type optional ethernet, link-aggregation
Remove the static MAC.no mac-address static HH:HH:HH:HH:HH:HH vlan vlan-idInterface type optional ethernet, link-aggregation

4.3.3 Configure a Black Hole MAC

OperationCommandsDescription
Enter global configuration view.configure terminal-
Configure a black hole MAC.mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id blackhole-
Delete the black hole MAC.no mac-address static HH:HH:HH:HH:HH:HH vlan vlan-id-

4.3.4 Set the Aging Time of Dynamic MAC

OperationCommandsDescription
Enter global configuration view.configure terminal-
Set dynamic MAC aging time.mac-address timer aging secondsThe default value is 1800s.
Configure dynamic MAC not to age.mac-address timer no-aging-

4.3.5 Disable MAC Address Learning

4.3.5.1 Disable Interface-based MAC Address Learning

OperationCommandsDescription
Enter global configuration view.configure terminal-
Enter interface viewinterface interface-type interface-nameInterface type, optionally ethernet, link-aggregation, Sub-interfaces not supported at this time
Disable MAC Learningno mac-address learning-
Enable MAC Learningmac-address learning-

4.3.5.2 Disable VLAN-based MAC Address Learning

OperationCommandsDescription
Enter global configuration view.configure terminal-
Enter VLAN viewvlan vlan-id-
Disable MAC Learningno mac-address learning-
Enable MAC Learningmac-address learning-

4.3.6 Configure MAC Table Entry Limit

OperationCommandsDescription
Enter global configuration view.configure terminal-
Enter interface viewinterface interface-type interface-nameInterface type optional ethernet, vlan
Configure MAC table entry limit for an interfacemac-limit numbernumber : number of mac table entries allowed to be learnt, in the range [1,131072].
Remove the MAC table entry limit for an interfaceno mac-limit-

4.3.7 Configure the MAC Address of Layer 3 Interface

OperationCommandsDescription
Enter global configuration view.configure terminal-
Enter interface viewinterface interface-type interface-name[. subinterface-number]Interface type can be ethernet, VLAN, link-aggregation
Configure the MAC address of the interfacemac-address HH:HH:HH:HH:HH:HH-
Restore the MAC address of the interface to its default valueno mac-address-

4.4 Display and Maintenance #

4.4.1 Display the MAC Table

OperationCommandsDescription
View MAC tableshow mac-address [interface-type interface-name]Interface type can be ethernet, VLAN, link-aggregation

4.4.2 Clear MAC Table

OperationCommandsDescription
Clear MAC tableclear mac-address [ethernet|link-aggregation interface-name] [vlan id] {static|dynamic}-

4.5 Typical Configuration Example #

4.5.1 Network requirements

4.5.2 Configuration steps

4.5.3 Validation

sonic# show mac-address
  No. Vlan MacAddress Port Type
----------------------------------------
  1 100 E2:8C:56:85:4A:11 0/0 Static
  2 100 A0:1B:5E:47:C9:08 None BlackHole
Total number of entries 2

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2025 Asteraix. All rights reserved.