Skip to content
Ask AI

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.

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.

OperationCommandDescription
Enter the system configuration viewconfigure terminal
Enter the VLAN viewvlan ID
Enable mac-trigger functionmac-trigger enable
OperationCommandDescription
Display the configuration of the MAC-Triggershow vlan mac-trigger [vlan-id ID]

Network requirements

Users access network through APs, requirement terminal can come online quickly after migration from Leaf A to Leaf B.

Procedure

  1. Leaf A Configuration

# Leaf A creates a BGP neighbor with Spine

sonic(config)# vlan 500
sonic(config)# interface ethernet 50
sonic(config-if-50)# switchport access vlan 500
sonic(config)# interface vlan 500
sonic(config-vlanif-500)# ip address 10.255.8.1/30
sonic(config-vlanif-500)# exit
sonic(config)# router bgp 65200
sonic(config-router)# bgp router-id 10.15.1.1
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.255.8.2 remote-as 65100
sonic(config-router)# neighbor 10.255.8.2 bfd
sonic(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 800
sonic(config-vlan-800)# mac-address 00:01:01:01:08:00
sonic(config-vlan-800)# exit
sonic(config)# interface ethernet 1
sonic(config-if-1)# switchport access vlan 800
sonic(config)# interface vlan 800
sonic(config-vlanif-800)# ip address 192.168.52.1/24
sonic(config-vlanif-800)# exit

# Leaf A configures DHCP Relay related functions

sonic(config)# dhcp-relay test v4
sonic(config-dhcp-relay-test__v4)# down_link interface vlan 800
sonic(config-dhcp-relay-test__v4)# up_link interface vlan500
sonic(config-dhcp-relay-test__v4)# server_ip 150.1.0.1
sonic(config-dhcp-relay-test__v4)# loopback_interface loopback 0
sonic(config-dhcp-relay-test__v4)# exit

# Leaf A Enables MAC-Trigger

sonic(config)# vlan 800
sonic(config-vlan-800)# mac-trigger enable
  1. Leaf B and Leaf A configurations are identical
  2. Spine
sonic(config)# router bgp 65100
sonic(config-router)# bgp router-id 10.15.1.3
sonic(config-router)# no bgp ebgp-requires-policy
sonic(config-router)# neighbor 10.255.8.1 remote-as 65200
sonic(config-router)# neighbor 10.255.8.1 bfd
sonic(config-router)# neighbor 10.255.8.1 description LeafA

Verify 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.