2

In a VRRP configuration I've been using /32 subnet mask but I've never know the reason behind.

Sometimes I've using the same subnet mask as the primary interface, like /24, and in some cases it works and int others, until I set up /32, it doesn't.

For example, on Mikrotik documentation points to that, but without explanation:

Note: address on VRRP interface must have /32 netmask if address configured on VRRP is from the same subnet as on router's any other interface.

It's really a requirement? On FreeBSD CARP I didn't find a similar requirement.

rfmoz
  • 694
  • 9
  • 15

1 Answers1

2

A virtual IP address, either used by VRRP, HSRP, GLBP, or CARP, is just that: an IP address. It does not have a subnet mask.

On a Cisco router, for example, you configure HSRP like this:

interface GigabitEthernet0/0
  ip address 192.168.1.2 255.255.255.0
  standby 1 ip 192.168.1.1

The same is true for VRRP:

interface GigabitEthernet0/0
  ip address 192.168.1.2 255.255.255.0
  vrrp 1 ip 192.168.1.1

On Linux I believe it is a requirement to configure all your additional IP addresses on a physical interface as a /32, similar to your VRRP limitation on Microtik routers. These are limitation imposed by the implementation, not by the protocol. Had the Linux or Microtik programmers implement the concept differently perhaps you could give any subnet mask or none at all. After all, it does not need a subnet mask since it can get this information from the physical interface.

Tommiie
  • 5,547
  • 2
  • 11
  • 45