Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Configuring VRRP for IPv4

This example shows how to configure VRRP properties for IPv4.

Requirements

This example uses the following hardware and software components:

  • Three routers

  • Junos OS Release 11.3 or later

    • This example has been recently updated and revalidated on Junos OS Release 21.1R1.
    • For details on VRRP support for specific platform and Junos OS release combinations, see Feature Explorer.

Overview

This example uses a VRRP group, which has a virtual address for IPv4. Devices on the LAN use this virtual address as their default gateway. If the primary router fails, the backup router takes over for it.

Configuring VRRP

Configuring Router A

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Step-by-Step Procedure

To configure this example:

  1. Configure the interfaces.

  2. Configure the IPv4 VRRP group identifier and the virtual IP address.

  3. Configure the priority for RouterA higher than RouterB to become the primary virtual router. RouterB is using the default priority of 100.

  4. Configure track interface to track whether the interface connected to the Internet is up, down, or not present to change the priority of the VRRP group.

  5. Configure accept-data to enable the primary router to accept all packets destined for the virtual IP address.

  6. Configure a static route for traffic to the Internet.

Results

From configuration mode, confirm your configuration by entering the show interfaces and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

If you are done configuring the device, enter commit from configuration mode.

Configuring Router B

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Step-by-Step Procedure

To configure this example:

  1. Configure the interfaces.

  2. Configure the IPv4 VRRP group identifier and the virtual IP address.

  3. Configure accept-data to enable the backup router to accept all packets destined for the virtual IP address in the event the backup router becomes primary.

  4. Configure a static route for traffic to the Internet.

Results

From configuration mode, confirm your configuration by entering the show interfaces and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

If you are done configuring the device, enter commit from configuration mode.

Configuring Router C

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Verification

Verifying That VRRP Is Working on Router A

Purpose

Verify that VRRP is active on Router A and that its role in the VRRP group is correct.

Action

Use the following commands to verify that VRRP is active on Router A, that the router is primary for group 1 and the interface connected to the Internet is being tracked.

Meaning

The show vrrp command displays fundamental information about the VRRP configuration. This output shows that the VRRP group is active and that this router has assumed the primary role. The lcl address is the physical address of the interface and the vip address is the virtual address shared by both routers. The Timer value (A 0.779) indicates the remaining time (in seconds) in which this router expects to receive a VRRP advertisement from the other router.

Verifying That VRRP Is Working on Router B

Purpose

Verify that VRRP is active on Router B and that its role in the VRRP group is correct.

Action

Use the following command to verify that VRRP is active on Router B and that the router is backup for group 1.

Meaning

The show vrrp command displays fundamental information about the VRRP configuration. This output shows that the VRRP group is active and that this router has assumed the backup role. The lcl address is the physical address of the interface and the vip address is the virtual address shared by both routers. The Timer value (D 2.854) indicates the remaining time (in seconds) in which this router expects to receive a VRRP advertisement from the other router.

Verifying Router C Reaches the Internet Transiting Router A

Purpose

Verify connectivity to the Internet from Router C.

Action

Use the following commands to verify that Router C can reach the Internet.

Meaning

The ping command shows reachability to the Internet and the traceroute command shows that Router A is being transited.

Verifying Router B Becomes Primary for VRRP

Purpose

Verify that Router B becomes primary for VRRP when the interface between Router A and the Internet goes down.

Action

Use the following commands to verify that Router B is primary and that Router C can reach the Internet transiting Router B.

Meaning

The show vrrp track detail command shows the tracked interface is down on Router A, that the priority has dropped to 90, and that Router A is now the backup. The show vrrp command shows that Router B is now the primary for VRRP and the traceroute command shows that Router B is now being transited.