Configuring VRRP on a port or a VLAN

About this task

Configure VRRP on a port or a VLAN to forward packets to the virtual IP addresses associated with the virtual router and customize the VRRP configuration.

Procedure

  1. Enter GigabitEthernet Interface Configuration mode:

    enable

    configure terminal

    interface GigabitEthernet {slot/port[/sub-port][-slot/port[/sub-port]][,...]}

    Note

    Note

    If the platform supports channelization and the port is channelized, you must also specify the sub-port in the format slot/port/sub-port.

  2. Configure a backup VRRP address:

    ip vrrp address <1-255> <A.B.C.D>

  3. Configure VRRP on a port:

    ip vrrp <1-255> enable

  4. Show the global VRRP configuration:

    show ip vrrp

Example

Switch:1> enable
Switch:1# configure terminal
Switch:1(config)# interface gigabitethernet 1/2

Configure a backup VRRP address:

Switch:1(config-if)# ip vrrp address 28 192.0.2.1

Configure VRRP on a port:

Switch:1(config-if)# ip vrrp 28 enable

Show the global VRRP configuration:

Switch:1(config-if)# show ip vrrp

Variable definitions

Use the data in the following table to use the ip vrrp command.

Variable

Value

1-255

Specifies the number of the VRRP to create or modify.

action {none|preempt}

Causes the virtual router to disregard the timer and transition to Master state immediately, provided the hold-down timer is running.
Note:

You can use this parameter only if the hold-down timer is active.

To set this option to the default value, use the default operator with this command.

action {none|preempt}

Enables the choice option to manually override the hold-down timer and force preemption.

You can configurenone|preempt to preempt the timer or configure it as none to allow the timer to keep working.

To configure this option to the default value, use the default operator with this command.

address <1-255> <A.B.C.D>

Configures the IP address of the VRRP physical interface that forwards packets to the virtual IP addresses associated with the virtual router.

A.B.C.D is the IP address of the master VRRP.

Use the no operator to remove the IP address of the VRRP physical interface:no ip vrrp address <1-255> <A.B.C.D>. To configure this option to the default value, use the default operator with this command.

adver-int <1-255>

Configures the the time interval between sending VRRP advertisement messages. The range is between 1 and 255 seconds. This value must be the same on all participating routers. The default is 1.

To configure this option to the default value, use the default operator with this command.

backup-master enable

Enables the VRRP backup master.

Use the no operator to disable the VRRP backup master: no ip vrrp <1-255> backup-master enable. To configure this option to the default value, use the default operator with this command.

When backup master functionality is enabled, the VRRP router will IP-forward packets destined to the VRRP MAC even when the router is not the VRRP Master.

Important:

Do not enable backup master if you enable critical IP.

critical-ip-addr <A.B.C.D>

Configures the critical IP address for VRRP.

A.B.C.D is the IP address on the local router, which is configured so that a change in its state causes a role switch in the virtual router (for example, from master to backup) in case the interface stops responding.
Note:

In this context, local implies an address from the same VRF as the IP interface where VRRP is being configured.

critical-ip enable

Enables the critical IP address option.

Use the no operator to disable the critical IP address option: no ip vrrp <1-255> critical-ip enable. To configure this option to the default value, use the default operator with this command.

Important:

Do not enable Critical IP if backup master is enabled.

enable

Enables VRRP on the port.

Use the no operator to disable VRRP on the port: no ip vrrp <1-255> enable. To configure this option to the default value, use the default operator with this command.

fast-adv enable

Enables the Fast Advertisement Interval. The default is disabled.

Use the no operator to disable VRRP on the port: no ip vrrp <1-255> fast-adv enable. To configure this option to the default value, use the default operator with this command.

fast-adv-int <200-1000>

Configures the Fast Advertisement Interval, the time interval between sending VRRP advertisement messages.

200-1000 is the range in milliseconds, and must be the same on all participating routers. The default is 200. You must enter values in multiples of 200 milliseconds.

To configure this option to the default value, use the default operator with this command.

holddown-timer <0-21600>

Specifies the time interval (in seconds) for which the transition of virtual router to Master state is delayed in case of the following conditions:
  • The VRRP hold-down timer runs only when the VRRP virtual router transitions from initialization to backup to master. This occurs only on a system startup.

  • The VRRP hold-down timer does not run if the amount of time passed since VRRP virtual router initialization is greater than preset hold-down time. In such a case, VRRP virtual router transitions to Master happens irrespective of the hold-down timer.

  • The VRRP hold-down timer also applies to the VRRP BackupMaster feature.

0-21600 is the time interval range (in seconds). To configure this option to the default value, use the default operator with this command. The default value for hold-down timer is 0, that is, the timer is disabled by default.

priority <1-255>

Configures the port VRRP priority.

1-255 is the value used by the VRRP router. The default is 100. Assign the value 255 to the router that owns the IP address associated with the virtual router.

To configure this option to the default value, use the default operator with this command.