Multi-active gateway protocol (MAGP) is aimed to solve 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.
Configuring MAGP
Prerequisites
-
Enable IP routing functionality. Run:
switch (config)# ip routing
-
Enable the desired VLAN. Run:
switch (config)# vlan 20 switch (config vlan 20)#
The VLAN cannot be the same one configured for the MLAG IPL, if MLAG is used.
-
Add this VLAN to the desired interface. Run:
switch (config)# interface ethernet 1/1 switch (config interface ethernet 1/1)# switchport access vlan 20
-
Create a VLAN interface. Run:
switch (config)# interface vlan 20 switch (config interface vlan 20)#
-
Set an IP address to the VLAN interface.
-
For IPv4, run:
switch (config interface vlan 20)# ip address 11.11.11.11 /8
-
For IPv6, run:
switch (config interface vlan 20)# ip address 2001::11 /64
-
-
Enable the interface.
switch (config interface vlan 20)# no shutdown
Configuring MAGP
-
Enable MAGP protocol globally. Run:
switch (config)# protocol magp
-
Create a virtual router group for an IP interface. Run:
switch (config interface vlan 20)# magp 100
Up to 255 MAGP IDs are supported.
-
Set a virtual router primary IP address.
-
For IPv4, run:
switch (config interface vlan 20 magp 100)# ip virtual-router address 11.11.11.254
-
For IPv6, run:
switch (config interface vlan 20 magp 100)# ip virtual-router address 2001::254
Only a virtual IP from the primary subnet can be configured for MAGP.
-
-
Set a virtual router primary MAC address. Run:
switch (config interface vlan 20 magp 100)# ip virtual-router mac-address aa:bb:cc:dd:ee:ff
To obtain the virtual router’s MAC address, please run the command “show vrrp detail”.
Verifying MAGP
To verify the MAGP configuration, run:
switch (config) # show magp
MAGP 100:
Interface vlan: 20
Admin state : Enabled
State : Master
Virtual IP : 11.11.11.254
V6 State : Master
Virtual IPv6 : 2001::254
Virtual MAC : aa:bb:cc:dd:ee:ff
This output is to be expected in both MAGP switches.
Useful Reading and Use Cases
For more information about this feature and its potential applications, please refer to the following community post:
MAGP Commands
protocol magp
|
|
protocol magp
Enables MAGP globally and unhides MAGP commands.
|
|
|
Syntax Description |
N/A |
|
|
Default |
Disabled |
|
|
Configuration Mode |
config |
|
|
History |
3.3.4500 |
|
|
Example |
||
|
Related Commands |
|
|
|
Notes |
IP routing must be enabled to enable MAGP. |
|
magp
|
|
magp <instance>
Creates an MAGP instance on this interface and enters a new configuration mode.
|
|
|
Syntax Description |
instance |
MAGP instance number
|
|
Default |
Disabled |
|
|
Configuration Mode |
config interface vlan |
|
|
History |
3.3.4500 |
|
|
3.7.1100 |
Updated notes |
|
|
Example |
||
|
Related Commands |
|
|
|
Notes |
|
|
shutdown
|
|
shutdown
Enables MAGP instance.
|
|
|
Syntax Description |
N/A |
|
|
Default |
Disabled |
|
|
Configuration Mode |
config interface vlan magp |
|
|
History |
3.3.4500 |
|
|
Example |
||
|
Related Commands |
|
|
|
Notes |
|
|
ip virtual-router address
|
|
ip virtual-router address <ip-address> [secondary]
Sets MAGP virtual IP address.
|
|
|
Syntax Description |
ip-address |
The virtual router IP address |
|
secondary |
Adds secondary virtual router address |
|
|
Default |
N/A |
|
|
Configuration Mode |
config interface vlan magp |
|
|
History |
3.3.4500 |
|
|
3.6.8100 |
Added “secondary” parameter |
|
|
3.9.1000 |
Added support for MAGP IPv6 instance |
|
|
Example |
||
|
Related Commands |
|
|
|
Notes |
|
|
ip virtual-router mac-address
|
|
ip virtual-router mac-address <mac-address>
Sets MAGP virtual MAC address.
|
|
|
Syntax Description |
mac-address |
MAC address (format: aa:bb:cc:dd:ee:ff) |
|
Default |
00:00:5E:00:01-<magp instance> |
|
|
Configuration Mode |
config interface vlan magp |
|
|
History |
3.3.4500 |
|
|
3.9.1000 |
Added note about MAGP IPv6 |
|
|
3.9.3000 |
Updated MAC address to be lowercase |
|
|
Example |
||
|
Related Commands |
|
|
|
Notes |
|
|
ip virtual-router mac-address <address>
|
|
ip virtual-router mac-address <address> Sets a global virtual router MAC address. |
|
|
Syntax Description |
address |
MAC address (format: aa:bb:cc:dd:ee:ff) |
|
Default |
N/A |
|
|
Configuration Mode |
config |
|
|
History |
3.9.0500 |
|
|
Example |
||
|
Related Commands |
show ip routing |
|
|
Notes |
|
|
show magp
|
|
show magp [<instance>] Displays the MAGP configuration. |
|
|
Syntax Description |
instance |
Displays configuration of a specific MAGP instance
|
|
Default |
N/A |
|
|
Configuration Mode |
Any command mode |
|
|
History |
3.3.4500 |
|
|
3.6.5000 |
Updated example |
|
|
3.6.8100 |
Updated example |
|
|
3.9.1000 |
Updated example |
|
|
Example |
||
|
Related Commands |
|
|
|
Note |
|
|
show magp interface vlan
|
|
show magp interface vlan <id> Displays the configuration of a specific MAGP instance. |
|
|
Syntax Description |
instance |
MAGP instance number
|
|
Default |
N/A |
|
|
Configuration Mode |
Any command mode |
|
|
History |
3.3.4500 |
|
|
3.6.5000 |
Updated example |
|
|
3.6.8100 |
Updated example |
|
|
3.9.1000 |
Updated example |
|
|
Example |
||
|
Related Commands |
|
|
|
Notes |
|
|
Last updated: