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 和 neighbors。
注意
此模块具有对应的 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 进程执行的操作。 对于 merged,输入配置将与设备上现有的 BGP 配置合并。 对于 deleted,将从设备中删除现有的 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
返回值
通用返回值记录在 此处,以下是此模块独有的字段
键 |
描述 |
---|---|
生成的配置模块调用。 返回: 当发生更改时 示例: |
|
生成的配置模块调用。 返回: 当 示例: |
|
模块调用之前的配置。 返回: 始终 示例: |
|
推送到远程设备的命令集。 返回: 始终 示例: |