dellemc.enterprise_sonic.sonic_bgp_neighbors_af 模块 – 管理 BGP 邻居地址族及其参数
注意
此模块是 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_bgp_neighbors_af
。
dellemc.enterprise_sonic 1.0.0 中的新功能
概要
此模块提供在运行 Enterprise SONiC 的设备上配置管理 BGP 邻居地址族参数的功能。
bgp_as、vrf_name 和邻居需要在设备上提前创建。
注意
此模块具有相应的 action 插件。
参数
参数 |
注释 |
---|---|
指定 BGP 邻居地址族相关的配置。 |
|
指定设备上已配置的 BGP 自治系统 (AS) 号。 |
|
指定地址族配置模式下 BGP 邻居的相关配置。 |
|
指定 BGP 地址族相关的配置。 afi 和 safi 需要一起使用。 |
|
为此邻居启用地址族。 选项
|
|
要配置的地址族类型。 选项
|
|
指定 allowas in 的值。 |
|
指定 origin 值。 选项
|
|
指定 allowas in 的值。 |
|
将邻居配置为 fabric-external。 Fabric external 仅支持 l2vpn 地址族。 选项
|
|
IPv4 和 IPv6 单播地址族的通用配置属性。 |
|
指定路由策略定义。 |
|
启用或禁用向邻居发送默认路由。 选项
|
|
指定 ipv4-unicast 和 ipv6-unicast 的前缀限制属性。 |
|
将接受来自邻居的最大前缀数。 |
|
当超过最大前缀限制时,启用或禁用 BGP 会话的拆除。 选项
|
|
拆除后重新建立 BGP 会话的时间间隔(以秒为单位)。 |
|
从邻居接收到的前缀数达到多少时生成警告消息的阈值。 表示为 max-prefixes 的百分比。 |
|
邻居的入站路由过滤策略。 |
|
邻居的出站路由过滤策略。 |
|
指定路由图。 |
|
指定路由图的方向。 |
|
指定路由图的名称。 |
|
指定邻居作为路由反射器客户端。 选项
|
|
指定邻居作为路由服务器客户端。 选项
|
|
指定地址族的投射类型。 选项
|
|
设备上已配置的邻居路由器地址。 |
|
指定设备上已配置的 VRF 名称。 默认: |
|
指定要在设备上配置的 BGP 进程上执行的操作。 在合并的情况下,输入配置与设备上现有的 BGP 配置合并。 在删除的情况下,现有的 BGP 配置将从设备中删除。 选项
|
备注
注意
已针对 Dell Technologies 的 Enterprise SONiC 发行版进行测试。
支持
check_mode
。
示例
# Using deleted
#
# Before state:
# -------------
#
#!
#router bgp 4
# !
# neighbor interface Eth1/3
# !
# address-family ipv4 unicast
# activate
# allowas-in 4
# route-map aa in
# route-map aa out
# route-reflector-client
# route-server-client
# send-community both
#!
#
- name: Deletes neighbors address-family with specific values
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
- bgp_as: 4
neighbors:
- neighbor: Eth1/3
address_family:
- afi: ipv4
safi: unicast
allowas_in:
value: 4
route_map:
- name: aa
direction: in
- name: aa
direction: out
route_reflector_client: true
route_server_client: true
state: deleted
# After state:
# ------------
#!
#router bgp 4
# !
# neighbor interface Eth1/3
# !
# address-family ipv4 unicast
# send-community both
#!
# Using deleted
#
# Before state:
# -------------
#
#!
#router bgp 4
# !
# neighbor interface Eth1/3
# !
# address-family ipv4 unicast
# activate
# allowas-in 4
# route-map aa in
# route-map aa out
# route-reflector-client
# route-server-client
# send-community both
#!
# neighbor interface Eth1/5
# !
# address-family ipv4 unicast
# activate
# allowas-in origin
# send-community both
#!
#
- name: Deletes neighbors address-family with specific values
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
state: deleted
# After state:
# ------------
#!
#router bgp 4
#!
# Using deleted
#
# Before state:
# -------------
#
#!
#router bgp 4
# !
# neighbor interface Eth1/3
#!
#
- name: Merges neighbors address-family with specific values
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
- bgp_as: 4
neighbors:
- neighbor: Eth1/3
address_family:
- afi: ipv4
safi: unicast
allowas_in:
value: 4
route_map:
- name: aa
direction: in
- name: aa
direction: out
route_reflector_client: true
route_server_client: true
state: merged
# After state:
# ------------
#!
#router bgp 4
# !
# neighbor interface Eth1/3
# !
# address-family ipv4 unicast
# activate
# allowas-in 4
# route-map aa in
# route-map aa out
# route-reflector-client
# route-server-client
# send-community both
#!
# Using merged
#
# Before state:
# -------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# (No bgp neighbor configuration present)
- name: "Configure BGP neighbor prefix-list attributes"
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
- bgp_as: 51
neighbors:
- neighbor: 1.1.1.1
address_family:
- afi: ipv4
safi: unicast
ip_afi:
default_policy_name: rmap_reg1
send_default_route: true
prefix_limit:
max_prefixes: 1
prevent_teardown: true
warning_threshold: 80
prefix_list_in: p1
prefix_list_out: p2
state: merged
# After state:
# ------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# !
# neighbor 1.1.1.1
# !
# address-family ipv4 unicast
# default-originate route-map rmap_reg1
# prefix-list p1 in
# prefix-list p2 out
# send-community both
# maximum-prefix 1 80 warning-only
# Using deleted
#
# Before state:
# -------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# !
# neighbor 1.1.1.1
# !
# address-family ipv6 unicast
# default-originate route-map rmap_reg2
# prefix-list p1 in
# prefix-list p2 out
# send-community both
# maximum-prefix 5 90 restart 2
- name: "Delete BGP neighbor prefix-list attributes"
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
- bgp_as: 51
neighbors:
- neighbor: 1.1.1.1
address_family:
- afi: ipv6
safi: unicast
ip_afi:
default_policy_name: rmap_reg2
send_default_route: true
prefix_limit:
max_prefixes: 5
warning_threshold: 90
restart-timer: 2
prefix_list_in: p1
prefix_list_out: p2
state: deleted
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# (No bgp neighbor configuration present)
# Using replaced
#
# Before state:
# -------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# !
# neighbor 1.1.1.1
# !
# address-family ipv6 unicast
# default-originate route-map rmap_reg2
# prefix-list p1 in
# prefix-list p2 out
# send-community both
# maximum-prefix 5 90 restart 2
- name: "Replace BGP neighbor address-family attributes"
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
- bgp_as: 51
neighbors:
- neighbor: 1.1.1.1
address_family:
- afi: ipv4
safi: unicast
ip_afi:
default_policy_name: rmap_reg1
send_default_route: true
prefix_limit:
max_prefixes: 1
prevent_teardown: true
warning_threshold: 80
prefix_list_in: p1
prefix_list_out: p2
state: replaced
# After state:
# ------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# !
# neighbor 1.1.1.1
# !
# address-family ipv4 unicast
# default-originate route-map rmap_reg1
# prefix-list p1 in
# prefix-list p2 out
# send-community both
# maximum-prefix 1 80 warning-only
#
#
# Using overridden
#
# Before state:
# -------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# !
# neighbor 1.1.1.1
# !
# address-family ipv6 unicast
# default-originate route-map rmap_reg2
# prefix-list p1 in
# prefix-list p2 out
# send-community both
# maximum-prefix 5 90 restart 2
- name: "Override BGP neighbors"
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
- bgp_as: 51
neighbors:
- neighbor: 2.2.2.2
address_family:
- afi: ipv4
safi: unicast
ip_afi:
default_policy_name: rmap_reg1
send_default_route: true
prefix_limit:
max_prefixes: 1
prevent_teardown: true
warning_threshold: 80
prefix_list_in: p1
prefix_list_out: p2
state: replaced
# After state:
# ------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# !
# neighbor 1.1.1.1
# !
# address-family ipv4 unicast
# default-originate route-map rmap_reg1
# prefix-list p1 in
# prefix-list p2 out
# send-community both
# maximum-prefix 1 80 warning-only
返回值
常见的返回值记录在此处,以下是此模块独有的字段
键 |
描述 |
---|---|
生成的配置模块调用。 返回:当更改时 示例: |
|
生成的配置模块调用。 返回:当 示例: |
|
模块调用之前的配置。 返回值: 始终 示例: |
|
推送到远程设备的命令集。 返回值: 始终 示例: |