# VRRP

The `nv unset` commands remove the configuration you set with the equivalent `nv set` commands. This guide only describes an `nv unset` command if it differs from the `nv set` command.

## nv set interface <interface-id> ipv4 vrrp state

Enables and disables VRRP for the interface. The default setting is `disabled`. For IPv6, run the `nv set interface <interface-id> ipv6 vrrp state` command.

In Cumulus Linux 5.14 and earlier:

- The command is `nv set interface <interface-id> ip vrrp`.
- You specify `enable on` or `enable off` instead of `state enabled` or `state disabled`.

### Command Syntax

Syntax | Description
--- | ---
`<interface-id>` | The interface you want to configure.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv set interface swp1 ipv4 vrrp state enabled

## nv set interface <interface-id> ipv4 vrrp virtual-router <virtual-router-id>

Configures the group of virtual gateways used with VRRP. For IPv6, run the `nv set interface <interface-id> ipv6 vrrp virtual-router <virtual-router-id>` command.

In Cumulus Linux 5.14 and earlier, the command is `nv set interface <interface-id> ip vrrp virtual-router <virtual-router-id>`.

### Command Syntax

Syntax | Description
--- | ---
`<interface-id>` | The interface you want to configure.
`<virtual-router-id>` | The Virtual Router Syntax (VRID).

### Version History

Introduced in Cumulus Linux 5.0.0

## nv set interface <interface-id> ipv4 vrrp virtual-router <virtual-router-id> address <ip-address>

Configures a virtual address for VRRPv3. For IPv6, run the `nv set interface <interface-id> ipv6 vrrp virtual-router <virtual-router-id> address <ip-address>` command.

In Cumulus Linux 5.14 and earlier, the command is `nv set interface <interface-id> ip vrrp virtual-router <virtual-router-id> address <ip-address>`.

### Command Syntax

Syntax | Description
--- | ---
`<interface-id>` | The interface you want to configure.
`<virtual-router-id>` | The Virtual Router Syntax (VRID).
`<ip-address>` | The IPv4 or IPv6 address.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv set interface swp1 ipv4 vrrp virtual-router 44 address 10.0.0.1

## nv set interface <interface-id> ipv4 vrrp virtual-router <virtual-router-id> advertisement-interval

Configures the interval between successive advertisements by the master in a virtual router group. You can specify a value between 10 and 40950 milliseconds. The default setting is 1000. For IPv6, run the `nv set interface <interface-id> ipv6 vrrp virtual-router <virtual-router-id> advertisement-interval` command.

In Cumulus Linux 5.14 and earlier, the command is `nv set interface <interface-id> ip vrrp virtual-router <virtual-router-id> advertisement-interval`.

### Command Syntax

Syntax | Description
--- | ---
`<interface-id>` | The interface you want to configure.
`<virtual-router-id>` | The Virtual Router Syntax (VRID).

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv set interface swp1 ipv4 vrrp virtual-router 44 advertisement-interval 2000

## nv set interface <interface-id> ipv4 vrrp virtual-router <virtual-router-id> preempt

Configures preempt mode, which lets the router take over as master for a virtual router group if it has a higher priority than the current master. The default setting is `disabled`. For IPv6, run the `nv set interface <interface-id> ipv6 vrrp virtual-router <virtual-router-id> preempt` command.

In Cumulus Linux 5.14 and earlier:

- The command is `nv set interface <interface-id> ipv vrrp virtual-router <virtual-router-id> preempt`.
- You specify `enabled` or `disabled` instead of `on` or `off`.

### Command Syntax

Syntax | Description
--- | ---
`<interface-id>` | The interface you want to configure.
`<virtual-router-id>` | The Virtual Router Syntax (VRID).

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv set interface swp1 ipv4 vrrp virtual-router 44 preempt disabled

## nv set interface <interface-id> ipv4 vrrp virtual-router <virtual-router-id> priority

Configures the priority level of the virtual router within the virtual router group, which determines the role that each virtual router plays and what happens if the master fails. Virtual routers have a priority between 1 and 254; the router with the highest priority becomes the master. The default setting is 100. For IPv6, run the `nv set interface <interface-id> ipv6 vrrp virtual-router <virtual-router-id> priority` command.

In Cumulus Linux 5.14 and earlier, the command is `nv set interface <interface-id> ip vrrp virtual-router <virtual-router-id> priority`.

### Command Syntax

Syntax | Description
--- | ---
`<interface-id>` | The interface you want to configure.
`<virtual-router-id>` | The Virtual Router Syntax (VRID).

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv set interface swp1 ipv4 vrrp virtual-router 44 priority 254

## nv set interface <interface-id> ipv4 vrrp virtual-router <virtual-router-id> version

Configures the VRRP protocol version for the interface. You can specify a value of 2, 3, or `auto`. The default setting is `auto`. For IPv6, run the `nv set interface <interface-id> ipv6 vrrp virtual-router <virtual-router-id> version` command.

- In Cumulus Linux 5.15 and earlier, you can only specify a value of 2 or 3.
- In Cumulus Linux 5.14 and earlier, the command is `nv set interface <interface-id> ip vrrp virtual-router <virtual-router-id> version`.

### Command Syntax

Syntax | Description
--- | ---
`<interface-id>` | The interface you want to configure.
`<virtual-router-id>` | The Virtual Router Syntax (VRID).

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv set interface swp1 ipv4 vrrp virtual-router 44 version 2

## nv set router vrrp advertisement-interval

Configures the advertisement interval between successive advertisements by the master in a virtual router group. You can specify a value between 10 and 40950. The default setting is 1000 milliseconds.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv set router vrrp advertisement-interval 2000

## nv set router vrrp state

Enables and disables VRRP globally on the switch. The default setting is `disabled`.

In Cumulus Linux 5.14 and earlier, you specify `enable on` or `enable off` instead of `state enabled` or `state disabled`.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv set router vrrp state enabled

## nv set router vrrp preempt

Configures the router to take over as master for a virtual router group if it has a higher priority than the current master. The default setting is `on`.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv set router vrrp preempt off

## nv set router vrrp priority

Configures the priority level of the virtual router within the virtual router group, which determines the role that each virtual router plays and what happens if the master fails. Virtual routers have a priority between 1 and 254; the router with the highest priority becomes the master. The default setting is 100.

### Version History

Introduced in Cumulus Linux 5.0.0

### Example

    cumulus@switch:~$ nv set router vrrp priority 254