.. _dellemc.enterprise_sonic.sonic_vrrp_module: *********************************** dellemc.enterprise_sonic.sonic_vrrp *********************************** **Configure VRRP protocol settings on SONiC.** Version added: 2.5.0 .. contents:: :local: :depth: 1 Synopsis -------- - This module provides configuration management of VRRP protocol settings on devices running SONiC - Configure interface IP address before configuring VRRP - Configure interface VRF forwarding before configuring VRRP in a VRF Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
list / elements=dictionary
Specifies the VRRP related configuration.
group
list / elements=dictionary
Defining the VRRP/VRRP6 group
advertisement_interval
integer
Configure advertisement interval (1 to 254)
afi
string / required
    Choices:
  • ipv4
  • ipv6
VRRP configurations to be set for the interface mentioned in types(VRRP/VRRP6).
preempt
boolean
    Choices:
  • no
  • yes
Enable preempt
preempt_delay
integer
added in 4.0.0
Configure preempt delay interval (0 to 1000)
priority
integer
Priority for MASTER election (1 to 254)
track_interface
list / elements=dictionary
Configure track interface for priority change.
interface and priority_increment are required together.
interface
string / required
Full name of the Layer 3 interface, i.e. Eth1/1.
priority_increment
integer
Weight for changing priority (1 to 254)
use_v2_checksum
boolean
    Choices:
  • no
  • yes
Enable checksum compatibility with VRRPv2 (Not supported for IPv6).
version
integer
    Choices:
  • 2
  • 3
Configure VRRP Version 2 or 3 (Not supported for IPv6).
virtual_address
list / elements=dictionary
Configure virtual IP Address.
address
string
List of IP addresses to be set.
virtual_router_id
integer / required
VRRP ID (1 to 255)
name
string / required
Full name of the Layer 3 interface, i.e. Eth1/1.
state
string
    Choices:
  • merged ←
  • deleted
  • replaced
  • overridden
Specifies the operation to be performed on the VRRP process configured on the device.
In case of merged, the input configuration will be merged with the existing VRRP configuration on the device.
In case of deleted, the existing VRRP configuration will be removed from the device.
In case of overridden, all existing VRRP configuration will be deleted and the specified input configuration will be installed.
In case of replaced, the existing VRRP configuration on the device will be replaced by the configuration in the playbook for each VRRP interface/group configured by the playbook.

Examples -------- .. code-block:: yaml # Using "deleted" state # # Before state: # ------------- # # sonic# show running-configuration interface # ! # interface Eth1/1 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 81.1.1.1/24 # ipv6 address 81::1/24 # ! # vrrp 1 address-family ipv4 # preempt # vip 81.1.1.3 # vip 81.1.1.4 # ! # vrrp 10 address-family ipv6 # priority 10 # preempt-delay 4 # advertisement-interval 4 # vip 81::3 # vip 81::4 # ! # interface Eth1/3 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 61.1.1.1/24 # ! # vrrp 5 address-family ipv4 # priority 20 # vip 61.1.1.3 # ! # vrrp 15 address-family ipv4 # priority 20 # preempt # vip 61.1.1.4 # ! - name: Delete VRRP and VRRP6 relay configurations sonic_vrrp: config: - name: 'Eth1/1' group: - virtual_router_id: 1 afi: ipv4 virtual_address: - address: 81.1.1.4 preempt: true - virtual_router_id: 10 afi: ipv6 advertisement_interval: 4 priority: 10 preempt_delay: 4 - name: 'Eth1/3' group: - virtual_router_id: 5 afi: ipv4 virtual_address: - address: 61.1.1.3 priority: 20 - virtual_router_id: 15 afi: ipv4 state: deleted # After state: # ------------ # # sonic# show running-configuration interface # ! # interface Eth1/1 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 81.1.1.1/24 # ipv6 address 81::1/24 # ! # vrrp 1 address-family ipv4 # vip 81.1.1.3 # ! # vrrp 10 address-family ipv6 # vip 81::3 # vip 81::4 # ! # interface Eth1/3 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 61.1.1.1/24 # ! # Using "merged" state # # Before state: # ------------- # # sonic# show running-configuration interface # ! # interface Eth1/1 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 81.1.1.1/24 # ipv6 address 81::1/24 # ! # interface Eth1/3 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 61.1.1.1/24 # ! - name: Add VRRP and VRRP6 configurations sonic_vrrp: config: - name: 'Eth1/1' group: - virtual_router_id: 1 afi: ipv4 virtual_address: - address: 81.1.1.3 - address: 81.1.1.4 preempt: true - virtual_router_id: 10 afi: ipv6 virtual_address: - address: 81::3 - address: 81::4 advertisement_interval: 4 priority: 10 preempt_delay: 4 - name: 'Eth1/3' group: - virtual_router_id: 5 afi: ipv4 virtual_address: - address: 61.1.1.3 priority: 20 - virtual_router_id: 15 afi: ipv4 virtual_address: - address: 61.1.1.4 preempt: true priority: 20 state: merged # After state: # ------------ # # sonic# show running-configuration interface # ! # interface Eth1/1 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 81.1.1.1/24 # ipv6 address 81::1/24 # ! # vrrp 1 address-family ipv4 # preempt # vip 81.1.1.3 # vip 81.1.1.4 # ! # vrrp 10 address-family ipv6 # priority 10 # preempt-delay 4 # advertisement-interval 4 # vip 81::3 # vip 81::4 # ! # interface Eth1/3 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 61.1.1.1/24 # ! # vrrp 5 address-family ipv4 # priority 20 # vip 61.1.1.3 # ! # vrrp 15 address-family ipv4 # priority 20 # preempt # vip 61.1.1.4 # ! # Using "replaced" state # # Before state: # ------------- # # sonic# show running-configuration interface # ! # interface Eth1/1 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 81.1.1.1/24 # ipv6 address 81::1/24 # ! # vrrp 1 address-family ipv4 # preempt # vip 81.1.1.3 # vip 81.1.1.4 # ! # vrrp 10 address-family ipv6 # priority 10 # preempt-delay 4 # advertisement-interval 4 # vip 81::3 # vip 81::4 # ! # interface Eth1/3 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 61.1.1.1/24 # ! # vrrp 5 address-family ipv4 # priority 20 # vip 61.1.1.3 # ! # vrrp 15 address-family ipv4 # priority 20 # preempt # vip 61.1.1.4 # ! - name: Replace VRRP and VRRP6 relay configurations sonic_vrrp: config: - name: 'Eth1/1' group: - virtual_router_id: 10 afi: ipv6 priority: 20 - name: 'Eth1/3' group: - virtual_router_id: 5 afi: ipv4 virtual_address: - address: 61.1.1.5 preempt: false track_interface: - interface: Eth1/1 priority_increment: 10 state: replaced # After state: # ------------ # # sonic# show running-configuration interface # ! # interface Eth1/1 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 81.1.1.1/24 # ipv6 address 81::1/24 # ! # vrrp 1 address-family ipv4 # vip 81.1.1.3 # vip 81.1.1.4 # ! # vrrp 10 address-family ipv6 # priority 20 # ! # interface Eth1/3 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 61.1.1.1/24 # ! # vrrp 5 address-family ipv4 # no preempt # vip 61.1.1.5 # track-interface Eth1/1 weight 10 # ! # vrrp 15 address-family ipv4 # priority 20 # preempt # vip 61.1.1.4 # ! # Using "overridden" state # # Before state: # ------------- # # sonic# show running-configuration interface # ! # interface Eth1/1 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 81.1.1.1/24 # ipv6 address 81::1/24 # ! # vrrp 1 address-family ipv4 # preempt # vip 81.1.1.3 # vip 81.1.1.4 # ! # vrrp 10 address-family ipv6 # priority 10 # advertisement-interval 4 # preempt-delay 4 # vip 81::3 # vip 81::4 # ! # interface Eth1/3 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 61.1.1.1/24 # ! # vrrp 5 address-family ipv4 # priority 20 # vip 61.1.1.3 # ! # vrrp 15 address-family ipv4 # priority 20 # preempt # vip 61.1.1.4 # ! - name: Overwrite the VRRP and VRRP6 relay configurations sonic_vrrp: config: - name: 'Eth1/1' group: - virtual_router_id: 15 afi: ipv4 virtual_address: - address: 81.1.1.15 preempt: false - name: 'Eth1/3' group: - virtual_router_id: 5 afi: ipv4 - virtual_router_id: 15 afi: ipv4 virtual_address: - address: 61.1.1.5 state: overridden # After state: # ------------ # # sonic# show running-configuration interface # ! # interface Eth1/1 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 81.1.1.1/24 # ipv6 address 81::1/24 # ! # vrrp 15 address-family ipv4 # no preempt # vip 81.1.1.15 # ! # interface Eth1/3 # mtu 9100 # speed 400000 # fec RS # no shutdown # ip address 61.1.1.1/24 # ! # vrrp 5 address-family ipv4 # ! # vrrp 15 address-family ipv4 # vip 61.1.1.5 # ! Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
list
when changed
The resulting configuration model invocation.

Sample:
The configuration returned will always be in the same format of the parameters above.
after_generated
list
when check_mode
The generated configuration model invocation.

Sample:
The configuration returned will always be in the same format of the parameters above.
before
list
always
The configuration prior to the model invocation.

Sample:
The configuration returned will always be in the same format of the parameters above.
commands
list
always
The set of commands pushed to the remote device.

Sample:
['command 1', 'command 2', 'command 3']


Status ------ Authors ~~~~~~~ - Santhosh Kumar T(@santhosh-kt)