dellemc.enterprise_sonic.sonic_vrrp 模块 – 在 SONiC 上配置 VRRP 协议设置。
注意
此模块是 dellemc.enterprise_sonic 集合(版本 2.5.1)的一部分。
如果您正在使用 ansible
包,您可能已经安装了这个集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install dellemc.enterprise_sonic
。
要在 playbook 中使用它,请指定:dellemc.enterprise_sonic.sonic_vrrp
。
dellemc.enterprise_sonic 2.5.0 中的新增功能
概要
此模块提供在运行 SONiC 的设备上对 VRRP 协议设置进行配置管理
在配置 VRRP 之前配置接口 IP 地址
在 VRF 中配置 VRRP 之前配置接口 VRF 转发
参数
参数 |
注释 |
---|---|
指定 VRRP 相关配置。 |
|
定义 VRRP/VRRP6 组 |
|
配置通告间隔(1 到 254) |
|
要为类型(VRRP/VRRP6)中提到的接口设置的 VRRP 配置。 选择
|
|
启用抢占 选择
|
|
MASTER 选举的优先级(1 到 254) |
|
配置用于优先级更改的跟踪接口。 interface 和 priority_increment 是必需的。 |
|
第 3 层接口的全名,例如 Eth1/1。 |
|
更改优先级的权重(1 到 254) |
|
启用与 VRRPv2 的校验和兼容性(不支持 IPv6)。 选择
|
|
配置 VRRP 版本 2 或 3(不支持 IPv6)。 选择
|
|
配置虚拟 IP 地址。 |
|
要设置的 IP 地址列表。 |
|
VRRP ID(1 到 255) |
|
第 3 层接口的全名,例如 Eth1/1。 |
|
指定要在设备上配置的 VRRP 进程上执行的操作。 对于 merged,输入配置将与设备上现有的 VRRP 配置合并。 对于 deleted,现有的 VRRP 配置将从设备中删除。 对于 overridden,所有现有的 VRRP 配置将被删除,并且将安装指定的输入配置。 对于 replaced,设备上现有的 VRRP 配置将被 playbook 中配置的每个 VRRP 接口/组的 playbook 中的配置替换。 选择
|
示例
# Using deleted
#
# 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
# 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
- 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
#
# 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
- 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
# 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
#
# 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
# 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
#
# 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
# 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
#!
返回值
常见返回值在此处记录 这里,以下是此模块独有的字段
键 |
描述 |
---|---|
生成的配置模型调用。 已返回:当已更改 示例: |
|
生成的配置模型调用。 已返回:当 示例: |
|
模型调用之前的配置。 已返回:始终 示例: |
|
推送到远程设备的命令集。 已返回:始终 示例: |