0% found this document useful (0 votes)
122 views

A Comparison of Virtual Ip Commands

This document compares different virtual IP commands on Arista switches. It discusses the 'ip virtual-router address' command, which allows switches to share a virtual IP address and MAC. It also covers the 'ip virtual-router address' command with a mask to conserve IP addresses, and the 'ip address virtual' command commonly used in VXLAN deployments. For each command, it explains how the host resolves ARP for the virtual IP and how switches resolve ARP for the host. ARP synchronization is also discussed to allow both switches in an MLAG pair to learn the host MAC address.

Uploaded by

deep k
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
122 views

A Comparison of Virtual Ip Commands

This document compares different virtual IP commands on Arista switches. It discusses the 'ip virtual-router address' command, which allows switches to share a virtual IP address and MAC. It also covers the 'ip virtual-router address' command with a mask to conserve IP addresses, and the 'ip address virtual' command commonly used in VXLAN deployments. For each command, it explains how the host resolves ARP for the virtual IP and how switches resolve ARP for the host. ARP synchronization is also discussed to allow both switches in an MLAG pair to learn the host MAC address.

Uploaded by

deep k
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

A comparison of virtual ip commands

eos.arista.com/a-comparison-of-virtual-ip-commands

Christie Joseph July 13, 2016

Contents [hide]

The ‘ip virtual-router’ command


How does the host resolve ARP for the default gateway/vIP?
How do the switches resolve ARP for the host?
The ‘ip virtual-router’ command with mask
How does the host resolve ARP for the default gateway/vIP?
How do the switches resolve ARP for the host?
ARP sync
The ‘ip address virtual’ command
How does the host resolve ARP for the default gateway/vIP?
How do the switches resolve ARP for the host?
ARP sync
Suggested reading

The ‘ip virtual-router’ command

1/6
Switch1:
Switch1(config)#interface vlan 10
Switch1(config-if-Vl10)#ip address 10.0.0.2/24
Switch1(config-if-Vl10)#ip virtual-router address 10.0.0.1
Switch1(config)#ip virtual-router mac-address 00:1c:73:00:00:99

Switch2:
Switch2(config)#interface vlan 10
Switch2(config-if-Vl10)#ip address 10.0.0.3/24
Switch2(config-if-Vl10)#ip virtual-router address 10.0.0.1
Switch2(config)#ip virtual-router mac-address 00:1c:73:00:00:99

The ‘ip virtual-router address’ command requires an IP address to be configured on the SVI
where it is applied.

How does the host resolve ARP for the default gateway/vIP?
Gratuitous ARPs: Gratuitous ARPs are periodically sent from both switches which
have VARP configured. In the gratuitous ARPs the configured vMAC is used as the
Ethernet Source MAC. The ARP message informs the host that Virtual IP is present at
vMAC.

ARPing for VIP from host: Some hosts might not learn from GARPs or they might
come up between the gratuitous ARP interval. The host will send out an ARP
request for the virtual IP. The receiving switch will send out an ARP reply similar
to the gratuitous ARP (unicast instead of broadcast).

How do the switches resolve ARP for the host?


When one of the switches receive data to be routed to the host, the switch sends out an ARP
request for the host from the interface IP address, not the virtual IP.

Example: Switch1 has to send data to the host, the switch will send out an ARP request in
the format:

2/6
The ‘ip virtual-router’ command with mask

The ‘ip virtual-router address’ command with mask allows us to conserve IP


addresses which would usually be assigned to the SVI interface. With this command,
we can assign dummy IPs (20.0.0.2, 20.0.0.3) to the SVI while retaining first hop
redundancy for the 10.0.0.0/24 network.

Static route:

Since the SVI IP belongs to a different subnet (20.0.0.0/24), we need a static route to point to
the 10.0.0.0/24 subnet, via the SVI (interface vlan 10). This installs the 10.0.0.0/24 network
in the routing table as a directly connected route.

Switch1:
Switch1(config)#interface vlan 10
Switch1(config-if-Vl10)#ip address 20.0.0.2/24
Switch1(config-if-Vl10)#ip virtual-router address 10.0.0.1/24
Switch1(config)#ip virtual-router mac-address 00:1c:73:00:00:99
Switch1(config)#ip route 10.0.0.0/24 vlan 10

Switch2:
Switch2(config)#interface vlan 10
Switch2(config-if-Vl10)#ip address 20.0.0.3/24
Switch2(config-if-Vl10)#ip virtual-router address 10.0.0.1/24
Switch2(config)#ip virtual-router mac-address 00:1c:73:00:00:99
Switch1(config)#ip route 10.0.0.0/24 vlan 10

How does the host resolve ARP for the default gateway/vIP?

3/6
Gratuitous ARPs: Gratuitous ARPs are periodically sent from both switches which
have VARP configured. In the gratuitous ARP, the configured vMAC is used as the
Ethernet Source MAC. The ARP message informs the host that Virtual IP is present at
vMAC.

ARPing for VIP from host: Some hosts might not learn from Grat ARPs or they might
come up between the gratuitous ARP interval. It will send out an ARP request for the
virtual IP. The receiving switch will send out an ARP reply similar to the gratuitous ARP
(unicast instead of broadcast).

How do the switches resolve ARP for the host?


When one of the switches receive data to be routed to the host, the switch sends out
an ARP for the host sourced from the switch MAC address, but the ARP packet
contains the virtual IP and MAC information.

Example: Switch1 has to send data to the host, the switch will send out an ARP
request in the format:

ARP sync
The host will learn the virtual IP and MAC from the ARP request and will reply to the same.
Since the reply could be hashed to any one of the switches, ARP sync is enabled on the
switches to allow both the switches in the MLAG pair to learn the host MAC.

Example: Switch 1 sends out the ARP request. Host replies to the ARP request, but the reply
could get hashed to Switch2. In this case, Switch 2 consumes the ARP reply since it also
possesses the vMAC. Switch2 then uses ARP sync to inform Switch1 about the host’s ARP
information.

The ‘ip address virtual’ command

4/6
This command is generally used to conserve IP addresses in VXLAN deployments and
can be used to provide an Anycast gateway.

Switch1:
Switch1(config)#interface vlan 10
Switch1(config-if-Vl10)#ip address virtual 10.0.0.1/24
Switch1(config)#ip virtual-router mac-address 00:1c:73:00:00:99

Switch2:
Switch2(config)#interface vlan 10
Switch2(config-if-Vl10)#ip address virtual 10.0.0.1/24
Switch2(config)#ip virtual-router mac-address 00:1c:73:00:00:99

The ‘ip virtual-router address’ commands discussed above require an IP address to be


configured on the SVI where it is applied. However, the ‘ip address virtual’ command does
not require such an IP address to be configured.

How does the host resolve ARP for the default gateway/vIP?
No gratuitous ARPs: There are no gratuitous ARPs generated by the switch when the ‘ip
address virtual’ command is used.

To learn the vMAC, the host will send an ARP request for the virtual IP. The
receiving switch will sent an ARP reply in the format:

How do the switches resolve ARP for the host?


5/6
When one of the switches receive data to be routed to the host, the switch sends out an ARP
for the host sourced from the vMAC and the ARP packet contains the virtual IP and MAC
information.

Example: Switch1 has to send data to the host, the switch will send out an ARP request
in the format:

ARP sync

The host will learn the virtual IP and MAC from the ARP request and will reply to the same.
Since the reply could be hashed to any one of the switches, ARP sync is enabled on the
switches to allow both the switches in the MLAG pair to learn the host MAC.

Suggested reading
1. Active-active router redundancy using VARP
2. Difference between”ip virtual-router address” and “ip address virtual”
3. VXLAN routing with MLAG

6/6

You might also like