.. _dellemc.enterprise_sonic.sonic_mac_module: ********************************** dellemc.enterprise_sonic.sonic_mac ********************************** **Manage MAC configuration on SONiC** Version added: 2.1.0 .. contents:: :local: :depth: 1 Synopsis -------- - This module provides configuration management of MAC for devices running SONiC Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
list / elements=dictionary
A list of MAC configurations.
mac
dictionary
Configuration attributes for MAC.
aging_time
integer
Default:
600
Time in seconds of inactivity before the MAC entry is timed out.
dampening_interval
integer
Default:
5
Interval for which mac movements are observed before disabling MAC learning on a port.
dampening_threshold
integer
Default:
5
Number of MAC movements allowed per second before disabling MAC learning on a port.
mac_table_entries
list / elements=dictionary
Configuration attributes for MAC table entries.
interface
string
Specifies the interface for the MAC table entry.
mac_address
string / required
MAC address for the dynamic or static MAC table entry.
vlan_id
integer / required
ID number of VLAN on which the MAC address is present.
vrf_name
string
Default:
"default"
Specifies the VRF name.
state
string
    Choices:
  • merged ←
  • deleted
  • replaced
  • overridden
The state of the configuration after module completion

Notes ----- .. note:: - Tested against Enterprise SONiC Distribution by Dell Technologies. - Supports ``check_mode``. Examples -------- .. code-block:: yaml # Using "merged" state # # Before state: # ------------- # # sonic# show mac dampening # MAC Move Dampening Threshold : 5 # MAC Move Dampening Interval : 5 # sonic# show running-configuration | grep mac # (No mac configuration pressent) - name: Merge MAC configurations dellemc.enterprise_sonic.sonic_mac: config: - vrf_name: 'default' mac: aging_time: 50 dampening_interval: 20 dampening_threshold: 30 mac_table_entries: - mac_address: '00:00:5e:00:53:af' vlan_id: 1 interface: 'Ethernet20' - mac_address: '00:33:33:33:33:33' vlan_id: 2 interface: 'Ethernet24' - mac_address: '00:00:4e:00:24:af' vlan_id: 3 interface: 'Ethernet28' state: merged # After state: # ------------ # # sonic# show mac dampening # MAC Move Dampening Threshold : 30 # MAC Move Dampening Interval : 20 # sonic# show running-configuration | grep mac # mac address-table 00:00:5e:00:53:af Vlan1 Ethernet20 # mac address-table 00:33:33:33:33:33 Vlan2 Ethernet24 # mac address-table 00:00:4e:00:24:af Vlan3 Ethernet28 # mac address-table aging-time 50 # # # Using "replaced" state # # Before state: # ------------- # # sonic# show mac dampening # MAC Move Dampening Threshold : 30 # MAC Move Dampening Interval : 20 # sonic# show running-configuration | grep mac # mac address-table 00:00:5e:00:53:af Vlan1 Ethernet20 # mac address-table 00:33:33:33:33:33 Vlan2 Ethernet24 # mac address-table 00:00:4e:00:24:af Vlan3 Ethernet28 # mac address-table aging-time 50 - name: Replace MAC configurations dellemc.enterprise_sonic.sonic_mac: config: - vrf_name: 'default' mac: aging_time: 45 dampening_interval: 30 dampening_threshold: 60 mac_table_entries: - mac_address: '00:00:5e:00:53:af' vlan_id: 3 interface: 'Ethernet24' - mac_address: '00:44:44:44:44:44' vlan_id: 2 interface: 'Ethernet20' state: replaced # sonic# show mac dampening # MAC Move Dampening Threshold : 60 # MAC Move Dampening Interval : 30 # sonic# show running-configuration | grep mac # mac address-table 00:00:5e:00:53:af Vlan3 Ethernet24 # mac address-table 00:33:33:33:33:33 Vlan2 Ethernet24 # mac address-table 00:00:4e:00:24:af Vlan3 Ethernet28 # mac address-table 00:44:44:44:44:44 Vlan2 Ethernet20 # mac address-table aging-time 45 # # # Using "overridden" state # # Before state: # ------------- # # sonic# show mac dampening # MAC Move Dampening Threshold : 60 # MAC Move Dampening Interval : 30 # sonic# show running-configuration | grep mac # mac address-table 00:00:5e:00:53:af Vlan3 Ethernet24 # mac address-table 00:33:33:33:33:33 Vlan2 Ethernet24 # mac address-table 00:00:4e:00:24:af Vlan3 Ethernet28 # mac address-table 00:44:44:44:44:44 Vlan2 Ethernet20 # mac address-table aging-time 45 - name: Override MAC cofigurations dellemc.enterprise_sonic.sonic_mac: config: - vrf_name: 'default' mac: aging_time: 10 dampening_interval: 20 dampening_threshold: 30 mac_table_entries: - mac_address: '00:11:11:11:11:11' vlan_id: 1 interface: 'Ethernet20' - mac_address: '00:22:22:22:22:22' vlan_id: 2 interface: 'Ethernet24' state: overridden # After state: # ------------ # # sonic# show mac dampening # MAC Move Dampening Threshold : 30 # MAC Move Dampening Interval : 20 # sonic# show running-configuration | grep mac # mac address-table 00:11:11:11:11:11 Vlan1 Ethernet20 # mac address-table 00:22:22:22:22:22 Vlan2 Ethernet24 # mac address-table aging-time 10 # # # Using "deleted" state # # Before state: # ------------- # # sonic# show mac dampening # MAC Move Dampening Threshold : 30 # MAC Move Dampening Interval : 20 # sonic# show running-configuration | grep mac # mac address-table 00:11:11:11:11:11 Vlan1 Ethernet20 # mac address-table 00:22:22:22:22:22 Vlan2 Ethernet24 # mac address-table aging-time 10 - name: Delete MAC cofigurations dellemc.enterprise_sonic.sonic_mac: config: - vrf_name: 'default' mac: aging_time: 10 dampening_interval: 20 dampening_threshold: 30 mac_table_entries: - mac_address: '00:11:11:11:11:11' vlan_id: 1 interface: 'Ethernet20' - mac_address: '00:22:22:22:22:22' vlan_id: 2 interface: 'Ethernet24' state: deleted # After state: # ------------ # # sonic# show mac dampening # MAC Move Dampening Threshold : 5 # MAC Move Dampening Interval : 5 # sonic# show running-configuration | grep mac # (No mac configuration present) Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
list
when changed
The resulting configuration module invocation.

Sample:
The configuration returned will always be in the same format as the parameters above.
after_generated
list
when check_mode
The generated configuration module invocation.

Sample:
The configuration returned will always be in the same format as the parameters above.
before
list
always
The configuration prior to the module invocation.

Sample:
The configuration returned will always be in the same format as the parameters above.
commands
list
always
The set of commands pushed to the remote device.

Sample:
['command 1', 'command 2', 'command 3']


Status ------ Authors ~~~~~~~ - S\. Talabi (@stalabi1)