Example for Configuring MLAG Peer-Gateway
Networking Requirements
Figure 1. User Configuration Topology of MLAG Peer-Gateway
As shown in Figure 1, Switch 1 and Switch 2 are a pair of MLAG devices. Host1 can dual-access to the network through the MLAG peer devices. VRRP is not deployed in this topology.
In the MLAG setup, if host1's default gateway is Switch 2 but traffic is hashed to Switch 1, Switch 1 forwards the packet to Switch 2 via the peer link. However, if the ARP entry is learned on the Switch 2, packets may be dropped.
Enabling Peer-Gateway allows both switches to act as the gateway by replicating each other’s system MAC address. This ensures that each switch can locally forward packets destined for the gateway, avoiding peer-link forwarding and packet loss.
In the MLAG topology, hosts typically use a gateway IP associated with one of the MLAG switches. Without Anycast, the gateway's IP and MAC are unique to each switch, which may cause ARP learning inconsistencies and suboptimal traffic paths.
By configuring Anycast IP & Anycast MAC on both MLAG peers, both switches advertise the same gateway IP and MAC address. This ensures consistent ARP entries on hosts and allows traffic to be locally forwarded by the switch that receives it, eliminating asymmetric routing and reducing reliance on the peer link.
Combining Peer-Gateway and Anycast IP & MAC in an MLAG setup provides a highly resilient and efficient gateway solution for hosts.
Procedure
Switch1
Step 1 Configure the VLANs.
admin@Switch1# set vlans vlan-id 4 l3-interface vlan-4
admin@Switch1# set vlans vlan-id 5 l3-interface vlan-5
admin@Switch1# set vlans vlan-id 4088 l3-interface vlan4088
admin@Switch1# set interface aggregate-ethernet ae10 family ethernet-switching native-vlan-id 4088
admin@Switch1# set interface aggregate-ethernet ae10 family ethernet-switching port-mode trunk
admin@Switch1# set interface aggregate-ethernet ae10 family ethernet-switching vlan members 4-5
admin@Switch1# set interface aggregate-ethernet ae9 aggregated-ether-options lacp enable true
admin@Switch1# set interface aggregate-ethernet ae9 family ethernet-switching port-mode trunk
admin@Switch1# set interface aggregate-ethernet ae9 family ethernet-switching vlan members 4-5
admin@Switch1# set interface gigabit-ethernet ge-1/1/23 ether-options 802.3ad ae10
admin@Switch1# set interface gigabit-ethernet ge-1/1/24 ether-options 802.3ad ae10
admin@Switch1# set interface gigabit-ethernet ge-1/1/29 ether-options 802.3ad ae9
admin@Switch1# set interface gigabit-ethernet ge-1/1/41 family ethernet-switching native-vlan-id 5 Step 2 Configure the VLAN interface address, anycast address and anycast MAC.
admin@Switch1# set ip routing enable true
admin@Switch1# set l3-interface vlan-interface vlan-4 address 192.168.40.1 prefix-length 24
admin@Switch1# set l3-interface vlan-interface vlan-4 anycast address 192.168.40.100 prefix-length 24
admin@Switch1# set l3-interface vlan-interface vlan-4 anycast mac 00:01:02:03:04:05
admin@Switch1# set l3-interface vlan-interface vlan-5 address 192.168.50.1 prefix-length 24
admin@Switch1# set l3-interface vlan-interface vlan-5 anycast address 192.168.50.100 prefix-length 24
admin@Switch1# set l3-interface vlan-interface vlan-5 anycast mac 00:01:02:03:05:05
admin@Switch1# set l3-interface vlan-interface vlan-4088 address 172.168.40.1 prefix-length 24
admin@Switch1# set protocols static route 2.2.2.0/24 next-hop 192.168.50.200Step 3 Configure the basic MLAG settings, enable peer-gateway and disable the spanning tree.
admin@Switch1# set protocols mlag domain 1 node 0
admin@Switch1# set protocols mlag domain 1 peer-gateway enable true
admin@Switch1# set protocols mlag domain 1 peer-ip 172.168.40.2 peer-link ae10
admin@Switch1# set protocols mlag domain 1 peer-ip 172.168.40.2 peer-vlan 4088
admin@Switch1# set protocols mlag domain 1 interface ae9 link 1
admin@Switch1# set protocols spanning-tree enable falseStep 4 Commit the configuration.
admin@Switch1# commitSwitch2
Step 1 Configure the VLANs.
admin@Switch2# set vlans vlan-id 4 l3-interface vlan-4
admin@Switch2# set vlans vlan-id 5 l3-interface vlan-5
admin@Switch2# set vlans vlan-id 4088 l3-interface vlan4088
admin@Switch2# set interface aggregate-ethernet ae10 family ethernet-switching native-vlan-id 4088
admin@Switch2# set interface aggregate-ethernet ae10 family ethernet-switching port-mode trunk
admin@Switch2# set interface aggregate-ethernet ae10 family ethernet-switching vlan members 4-5
admin@Switch2# set interface aggregate-ethernet ae9 aggregated-ether-options lacp enable true
admin@Switch2# set interface aggregate-ethernet ae9 family ethernet-switching port-mode trunk
admin@Switch2# set interface aggregate-ethernet ae9 family ethernet-switching vlan members 4-5
admin@Switch2# set interface gigabit-ethernet te-1/1/13 ether-options 802.3ad ae9
admin@Switch2# set interface gigabit-ethernet te-1/1/16 family ethernet-switching native-vlan-id 5
admin@Switch2# set interface gigabit-ethernet te-1/1/17 ether-options 802.3ad ae10
admin@Switch2# set interface gigabit-ethernet te-1/1/19 ether-options 802.3ad ae10 Step 2 Configure the VLAN interface address, anycast address and anycast MAC.
admin@Switch2# set ip routing enable true
admin@Switch2# set l3-interface vlan-interface vlan-4 address 192.168.40.2 prefix-length 24
admin@Switch2# set l3-interface vlan-interface vlan-4 anycast address 192.168.40.100 prefix-length 24
admin@Switch2# set l3-interface vlan-interface vlan-4 anycast mac 00:01:02:03:04:05
admin@Switch2# set l3-interface vlan-interface vlan-5 address 192.168.50.2 prefix-length 24
admin@Switch2# set l3-interface vlan-interface vlan-5 anycast address 192.168.50.100 prefix-length 24
admin@Switch2# set l3-interface vlan-interface vlan-5 anycast mac 00:01:02:03:05:05
admin@Switch2# set l3-interface vlan-interface vlan-4088 address 172.168.40.2 prefix-length 24
admin@Switch2# set protocols static route 2.2.2.0/24 next-hop 192.168.50.200Step 3 Configure the basic MLAG settings, enable peer-gateway and disable the spanning tree.
admin@Switch2# set protocols mlag domain 1 node 1
admin@Switch2# set protocols mlag domain 1 peer-gateway enable true
admin@Switch2# set protocols mlag domain 1 peer-ip 172.168.40.1 peer-link ae10
admin@Switch2# set protocols mlag domain 1 peer-ip 172.168.40.1 peer-vlan 4088
admin@Switch2# set protocols mlag domain 1 interface ae9 link 1
admin@Switch2# set protocols spanning-tree enable falseStep 4 Commit the configuration.
admin@Switch2# commitSwitch3
Step 1 Configure the VLANs an VLAN interfaces.
admin@Switch3# set interface aggregate-ethernet ae9 aggregated-ether-options lacp enable true
admin@Switch3# set interface aggregate-ethernet ae9 family ethernet-switching port-mode trunk
admin@Switch3# set interface aggregate-ethernet ae9 family ethernet-switching vlan members 4-5
admin@Switch3# set interface gigabit-ethernet te-1/1/19 ether-options 802.3ad ae9
admin@Switch3# set interface gigabit-ethernet te-1/1/36 ether-options 802.3ad ae9
admin@Switch3# set interface gigabit-ethernet te-1/1/45 family ethernet-switching native-vlan-id 5
admin@Switch3# set interface gigabit-ethernet te-1/1/45 family ethernet-switching port-mode trunk
admin@Switch3# set interface gigabit-ethernet te-1/1/45 family ethernet-switching vlan members 4Step 2 Configure the VLAN interfaces, and disable the spanning tree.
admin@Switch3# set vlans vlan-id 4 l3-interface vlan-4
admin@Switch3# set vlans vlan-id 5 l3-interface vlan-5
admin@Switch3# set l3-interface vlan-interface vlan-4 address 192.168.40.4 prefix-length 24
admin@Switch3# set l3-interface vlan-interface vlan-5 address 192.168.50.4 prefix-length 24
admin@Switch3# set protocols spanning-tree enable falseStep 3 Enable IP routing function when using MLAG Peer-Gateway.
admin@Switch3# set ip routing enable trueStep 4 Commit the configuration.
admin@Switch3# commitSwitch4
Step 1 Configure the VLANs an VLAN interfaces.
admin@Switch4# set interface aggregate-ethernet ae9 aggregated-ether-options lacp enable true
admin@Switch4# set interface aggregate-ethernet ae9 family ethernet-switching port-mode trunk
admin@Switch4# set interface aggregate-ethernet ae9 family ethernet-switching vlan members 4-5
admin@Switch4# set interface gigabit-ethernet te-1/1/19 ether-options 802.3ad ae9
admin@Switch4# set interface gigabit-ethernet te-1/1/36 ether-options 802.3ad ae9
admin@Switch4# set interface gigabit-ethernet te-1/1/45 family ethernet-switching native-vlan-id 5
admin@Switch4# set interface gigabit-ethernet te-1/1/45 family ethernet-switching port-mode trunk
admin@Switch4# set interface gigabit-ethernet te-1/1/45 family ethernet-switching vlan members 4Step 2 Configure the VLAN interfaces, and disable the spanning tree.
admin@Switch4# set vlans vlan-id 4 l3-interface vlan-4
admin@Switch4# set vlans vlan-id 5 l3-interface vlan-5
admin@Switch4# set l3-interface vlan-interface vlan-4 address 192.168.40.4 prefix-length 24
admin@Switch4# set l3-interface vlan-interface vlan-5 address 192.168.50.4 prefix-length 24
admin@Switch4# set protocols spanning-tree enable falseStep 3 Enable IP routing function when using MLAG Peer-Gateway.
admin@Switch4# set ip routing enable trueStep 4 Commit the configuration.
admin@Switch4# commitVerifying the Configuration
You can use the run show mlag domain command to display the global MLAG domain information.
admin@Switch1# run show mlag domain summary
Domain ID: 1 Domain MAC: 48:6E:73:FF:00:0a Node ID: 0
-----------------------------------------------------------------------
Peer Link Peer IP Peer Vlan Neighbor Status Config Matched MAC Synced # of Links
--------- -------- ------ --------- -------------- ----------- ----------
ae10 10.10.10.1 4088 ESTABLISHED Yes Yes 1You can use the run show mlag link command to display MLAG link information.
admin@Switch1# run show mlag link summary
# of Links: 1
Link Local LAG Link Status Local Status Peer Status Config Matched Flood
---- --------- ----------- ------------ ----------- -------------- -----
1 ae10 FULL UP UP Yes NoAfter the configuration is complete, host1 and host2 can communicate with each other normally.