MAC-Trigger Configuration
MAC-Trigger is a feature that triggers the learning of HostRoutes (32-bit host routes) based on the source MAC address (SMAC). It works primarily in conjunction with DHCP-Snooping entries. Its purpose is to ensure timely updating of host routes when a user’s IP address and gateway MAC address remain unchanged after migration. This guarantees the quality of the network during user migration when they send business traffic.
Explanation of Principles
Section titled “Explanation of Principles”As depicted in the diagram, when a terminal migrates to a new device and sends its first packet, this packet might not be an ARP/ND packet. Consequently, it cannot trigger the ARP/ND learning process, leading to a delay in updating the host route. This inconsistency in the data packet’s round-trip path hinders the terminal from accessing the network properly.

When the MAC-Trigger feature is enabled, after a terminal user migrates to a new device, the device checks its local MAC table. If there is no entry in the local MAC address table that matches the source MAC address of the packet, the MAC-Trigger learning is triggered. This learning process is combined with the ARP-TO-HOST learning feature. The newly learned ARP/ND entries are converted into corresponding host routes. These routes are then synchronized to other devices in the network environment via the BGP protocol. This ensures that when a terminal user migrates without changes in their IP address and gateway MAC address, the host routes are promptly updated. This effective update safeguards the network quality during user migration.
For instance, when a user comes online on LeafB, the device checks its local MAC table. If there is no entry that matches the source MAC address of the packet, the MAC-Trigger is triggered. It learns both MAC and ARP/NDP entries. This is often used in conjunction with cluster configuration. The newly learned ARP/NDP entries are transformed into host routes, which are synchronized to the Spine devices through the BGP protocol. This triggers the removal of entries on the source device, achieving fast migration effects.

MAC-Trigger Configuration
Section titled “MAC-Trigger Configuration”| Operation | Command | Description |
|---|---|---|
| Enter the system configuration view | configure terminal | |
| Enter the VLAN view | vlan ID | |
| Enable mac-trigger function | mac-trigger enable |
Display and Maintenance
Section titled “Display and Maintenance”| Operation | Command | Description |
|---|---|---|
| Display the configuration of the MAC-Trigger | show vlan mac-trigger [vlan-id ID] |
Configuration Example
Section titled “Configuration Example”Network requirements
Users access network through APs, requirement terminal can come online quickly after migration from Leaf A to Leaf B.

Procedure
- Leaf A Configuration
# Leaf A creates a BGP neighbor with Spine
sonic(config)# vlan 500sonic(config)# interface ethernet 50sonic(config-if-50)# switchport access vlan 500sonic(config)# interface vlan 500sonic(config-vlanif-500)# ip address 10.255.8.1/30sonic(config-vlanif-500)# exitsonic(config)# router bgp 65200sonic(config-router)# bgp router-id 10.15.1.1sonic(config-router)# no bgp ebgp-requires-policysonic(config-router)# neighbor 10.255.8.2 remote-as 65100sonic(config-router)# neighbor 10.255.8.2 bfdsonic(config-router)# neighbor 10.255.8.2 description SPineA# Leaf A configures the AP downlink port to configure the MAC address of the VLAN gateway where the user segment of the downlink port is located as a fixed MAC address
sonic(config)# vlan 800sonic(config-vlan-800)# mac-address 00:01:01:01:08:00sonic(config-vlan-800)# exitsonic(config)# interface ethernet 1sonic(config-if-1)# switchport access vlan 800sonic(config)# interface vlan 800sonic(config-vlanif-800)# ip address 192.168.52.1/24sonic(config-vlanif-800)# exit# Leaf A configures DHCP Relay related functions
sonic(config)# dhcp-relay test v4sonic(config-dhcp-relay-test__v4)# down_link interface vlan 800sonic(config-dhcp-relay-test__v4)# up_link interface vlan500sonic(config-dhcp-relay-test__v4)# server_ip 150.1.0.1sonic(config-dhcp-relay-test__v4)# loopback_interface loopback 0sonic(config-dhcp-relay-test__v4)# exit# Leaf A Enables MAC-Trigger
sonic(config)# vlan 800sonic(config-vlan-800)# mac-trigger enable- Leaf B and Leaf A configurations are identical
- Spine
sonic(config)# router bgp 65100sonic(config-router)# bgp router-id 10.15.1.3sonic(config-router)# no bgp ebgp-requires-policysonic(config-router)# neighbor 10.255.8.1 remote-as 65200sonic(config-router)# neighbor 10.255.8.1 bfdsonic(config-router)# neighbor 10.255.8.1 description LeafAVerify configuration
sonic# show vlan mac_trigger+---------+----------+| VLANID | STATUS |+=========+==========+| 800 | enabled |+---------+----------+When a user migrates from Leaf A to Leaf B, Leaf B can quickly learn the ARP table entries.