HowTo Configure MAGP on Mellanox Switches

Version 12

    This post discusses MAGP Configuration.

     

    >>Learn for free about Mellanox solutions and technologies in the Mellanox Online Academy

     

    References

     

    Overview - FAQ

    What is MAGP?

    Multi-active gateway protocol (MAGP) aims to resolve the default gateway problem when a host is connected to a set of switch routers (SRs) via MLAG. The network functionality in that case requires that each SR is an active default gateway router to the host, thus reducing hops between the SRs and directly forwarding IP traffic to the L3 cloud regardless which SR traffic comes through.

    What is the difference between MAGP and VRRP?

     

    MAGP is Mellanox proprietary protocol that implements active-active VRRP.

     

    Configuration

     

    To enable  MAGP you need MLNX-OS version 3.3.5000 (or later).

     

    To configure MAGP on two ToRs configured with MLAG follow these steps:


    1. Make sure MLAG is configured according to this post HowTo Configure MLAG on Mellanox Switches.

     

    2. Create VLAN interface within the same subnet of the hosts. For example, run the following on both switch-routers. Run:

    switch (config) # vlan 1

    switch (config vlan 1) # exit

    switch (config) # interface ethernet 1/1 switchport mode access

    switch (config) # interface ethernet 1/1 switchport access vlan 1

    switch (config) # interface vlan 1

     

    Configure different IP addresses on each switch. For example:

    On the first switch:

    switch sx01 (config interface vlan 1) # ip address 11.11.11.11 /24

     

    On the second switch:

    switch sx02 (config interface vlan 1) # ip address 11.11.11.12 /24

     

    3. Enable MAGP and configure the virtual IP address. Run the following on both switch-routers:

    Note: the IP address should be within the same subnet of the VLAN interface.

    Note: Any Unicast MAC could be used here. Refer to RFC 3768 - Virtual Router Redundancy Protocol (VRRP)  for possible range to be used.

    switch (config) # protocol magp

    switch (config) # interface vlan 1 magp 1

    switch (config interface vlan 1 magp 1) # ip virtual-router address 11.11.11.254

    switch (config interface vlan 1 magp 1) # ip virtual-router mac-address 00:00:5E:00:01:01

     

    4. Verify that MAGP is running, run the command "show magp" (on both switch-routers).

    Note: As MAGP is an active-active protocol. The MAGP state should become master on both switch-routers.

    switch (config)# show magp 1

    MAGP 1

      Interface vlan:1

      MAGP state:Master

      MAGP virtual IP:11.11.11.254

      MAGP virtual MAC:00:00:5E:00:01:01

    switch (config)#

             

     

    At this point you can configure the default gateway on both servers to be 11.11.11.254. Any of the switch-routers will answer it.