cisco.ios.ios_bgp_address_family 模块 – 用于配置 BGP 地址族的资源模块。

注意

此模块是 cisco.ios 集合 (版本 9.0.3) 的一部分。

如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install cisco.ios

要在 playbook 中使用它,请指定:cisco.ios.ios_bgp_address_family

cisco.ios 1.2.0 中的新增功能

概要

  • 此模块配置和管理 Cisco IOS 上 BGP 地址族的属性。

参数

参数

注释

config

字典

BGP 地址族的配置列表。

address_family

list / elements=dictionary

BGP 地址族的配置列表。

advertise

字典

配置路径通告/导出到其他地址族

afi

字符串

VRF 通告/导出的地址族

选择

  • "l2vpn"

safi

字符串

将前缀通告/导出到地址族

选择

  • "evpn"

afi

字符串

地址族

选择

  • "ipv4"

  • "ipv6"

  • "l2vpn"

  • "nsap"

  • "rtfilter"

  • "vpnv4"

  • "vpnv6"

aggregate_addresses

别名:aggregate_address

list / elements=dictionary

配置 BGP 聚合条目

address

字符串

聚合地址 (A.B.C.D)

advertise_map

字符串

设置通告属性的条件

as_confed_set

布尔值

生成 AS confed set 路径信息

选择

  • false

  • true

as_set

布尔值

生成 AS set 路径信息

选择

  • false

  • true

attribute_map

字符串

设置聚合属性

netmask

字符串

聚合掩码 (A.B.C.D)

summary_only

布尔值

从更新中筛选更具体的路由

选择

  • false

  • true

suppress_map

字符串

有条件地从更新中筛选更具体的路由

auto_summary

布尔值

启用自动网络号汇总

选择

  • false

  • true

bgp

字典

配置 BGP 聚合条目

additional_paths

字典

BGP 表中的附加路径

install

布尔值

要安装到 RIB 中的附加路径

选择

  • false

  • true

receive

布尔值

从邻居接收附加路径

选择

  • false

  • true

select

字典

选择路径的选择标准

all

布尔值

选择所有可用路径

选择

  • false

  • true

backup

布尔值

选择备份路径

选择

  • false

  • true

best

整数

选择最佳 N 个路径 (2-3)。

best_external

布尔值

选择最佳外部路径

选择

  • false

  • true

group_best

布尔值

选择组最佳路径

选择

  • false

  • true

send

布尔值

向邻居发送附加路径

选择

  • false

  • true

aggregate_timer

整数

配置聚合计时器

请参考供应商文档获取有效值

dampening

字典

启用路由抖动抑制

max_suppress

整数

抑制稳定路由的最大持续时间

请参考供应商文档获取有效值

penalty_half_time

整数

惩罚的半衰期

请参考供应商文档获取有效值

reuse_route_val

整数

开始重用路由的值

请参考供应商文档获取有效值

route_map

字符串

用于指定抑制标准的路由映射

suppress_route_val

整数

开始抑制路由的值

请参考供应商文档获取有效值

布尔值

将 DMZ 链路带宽用作 BGP 多路径的权重

选择

  • false

  • true

nexthop

字典

下一跳跟踪命令

route_map

字符串

用于有效下一跳的路由映射

trigger

字典

下一跳触发

delay

整数

设置触发下一跳跟踪的延迟

请参考供应商文档获取有效值

enable

布尔值

启用下一跳跟踪

选择

  • false

  • true

redistribute_internal

布尔值

允许将 iBGP 重新分配到 IGP(危险)

选择

  • false

  • true

route_map

布尔值

route-map 控制命令

让路由映射设置命令优先于 BGP 命令,例如下一跳不变

选择

  • false

  • true

scan_time

整数

配置后台扫描器间隔

请参考供应商文档获取有效值

slow_peer

list / elements=dictionary

下一跳触发

此选项已弃用,并替换为 slow_peer_options,此属性将在 2025-01-01 之后删除。

detection

字典

慢速对等体检测

enable

布尔值

启用慢速对等体检测

选择

  • false

  • true

threshold

整数

设置慢速对等体检测阈值

阈值(秒)

请参考供应商文档获取有效值

split_update_group

字典

配置慢速对等体拆分更新组

dynamic

布尔值

将慢速对等体动态拆分到慢速更新组

选择

  • false

  • true

permanent

布尔值

将慢速对等体永久保留在慢速更新组中

选择

  • false

  • true

slow_peer_options

字典

下一跳触发

detection

字典

慢速对等体检测

enable

布尔值

启用慢速对等体检测

选择

  • false

  • true

threshold

整数

设置慢速对等体检测阈值

阈值(秒)

请参考供应商文档获取有效值

split_update_group

字典

配置慢速对等体拆分更新组

dynamic

布尔值

将慢速对等体动态拆分到慢速更新组

选择

  • false

  • true

permanent

布尔值

将慢速对等体永久保留在慢速更新组中

选择

  • false

  • true

soft_reconfig_backup

布尔值

仅当未协商路由刷新时才使用软重配置入站

选择

  • false

  • true

update_group

布尔值

管理 BGP 更新组中的对等体

根据策略拆分更新组

将具有 as-override 的对等体保留在不同的更新组中

选择

  • false

  • true

default

布尔值

将命令设置为其默认值

选择

  • false

  • true

default_information

布尔值

默认信息的分发

分发默认路由

选择

  • false

  • true

default_metric

整数

设置重新分配的路由的指标

distance

字典

定义管理距离

external

整数

AS 外部路由的距离

internal

整数

AS 内部路由的距离

local

整数

本地路由的距离

maximum_paths

字典

通过多条路径转发数据包

eibgp

整数

eBGP 和 iBGP 路径都作为多路径

ibgp

整数

iBGP-多路径

paths

整数

路径数

maximum_secondary_paths

字典

最大辅助路径

eibgp

整数

eBGP 和 iBGP 路径作为辅助多路径

ibgp

整数

iBGP-辅助-多路径

paths

整数

辅助路径的数量

邻居

别名: neighbor

list / elements=dictionary

指定一个邻居路由器

激活

布尔值

为此邻居启用地址族

选择

  • false

  • true

附加路径

字典

与此邻居协商附加路径功能

禁用

布尔值

禁用此邻居的附加路径

选择

  • false

  • true

接收

布尔值

从邻居接收附加路径

选择

  • false

  • true

发送

布尔值

向此邻居发送附加路径

选择

  • false

  • true

地址

字符串

邻居地址 (A.B.C.D)

此选项已弃用,并被 neighbor_address 取代,此属性将在 2025-01-01 之后删除。

通告

字典

向此邻居通告

通告附加路径

全部

布尔值

选择所有可用路径

选择

  • false

  • true

最佳

整数

选择最佳 N 个路径 (2-3)。

组最佳

布尔值

选择组最佳路径

选择

  • false

  • true

通告映射

字典

指定用于条件通告的路由映射

存在映射

字符串

仅当前缀存在于条件中时才通告前缀

条件路由映射名称

名称

字符串

通告路由映射名称

不存在映射

字符串

仅当前缀不存在于条件中时才通告前缀

条件路由映射名称

通告间隔

整数

发送 BGP 路由更新之间的最小间隔

通告

字典

向此邻居通告

附加路径

字典

通告附加路径

全部

布尔值

选择所有可用路径

选择

  • false

  • true

最佳

整数

选择最佳 N 个路径 (2-3)。

组最佳

布尔值

选择组最佳路径

选择

  • false

  • true

最佳外部

布尔值

通告最佳外部(在 RR 上为最佳内部)路径

选择

  • false

  • true

多样化路径

字典

通告附加路径

备份

布尔值

多样化路径可以是备份路径

选择

  • false

  • true

多路径

布尔值

多样化路径可以是多路径

选择

  • false

  • true

AIGP

字典

在邻居上启用 AIGP

启用

字符串

在邻居上启用 AIGP

发送

字典

携带 AIGP 值的成本社团或 MED

成本社团

字典

携带 AIGP 值的成本扩展社团

ID

整数

社团 ID

请参考供应商文档获取有效值

插入点

字典

插入点

IGP 成本

布尔值

在 IGP 之后插入

选择

  • false

  • true

预最佳路径

布尔值

在开头插入

选择

  • false

  • true

可传递

布尔值

成本社团是可传递的

选择

  • false

  • true

MED

布尔值

携带 AIGP 值的 MED

选择

  • false

  • true

允许策略

布尔值

为此 IBGP 邻居启用策略支持

选择

  • false

  • true

允许 AS 输入

整数

接受 AS 路径中包含我的 AS 的路径

请参考供应商文档获取有效值

AS 覆盖

字典

在发送更新时覆盖匹配的 AS 号

设置

布尔值

启用 AS 覆盖

选择

  • false

  • true

水平分割

布尔值

在发送更新时维护水平分割

选择

  • false

  • true

BMP 激活

字典

激活 BGP 对等体的 BMP 监控

全部

布尔值

激活所有服务器的 BMP 监控

选择

  • false

  • true

服务器

整数

为服务器激活 BMP

BMP 服务器编号

请参考供应商文档获取有效值

能力

字典

向对等体通告能力

向对等体通告 ORF 能力

向此邻居通告前缀列表 ORF 能力

双向

布尔值

从/向此邻居发送和接收 ORF 的能力

选择

  • false

  • true

接收

布尔值

从该邻居接收 ORF 的能力

选择

  • false

  • true

发送

布尔值

向此邻居发送 ORF 的能力

选择

  • false

  • true

集群 ID

字符串

配置路由反射器集群 ID (对等体可能会重置)

路由反射器集群 ID,可以是 32 位数字,也可以是 IP 地址格式的路由反射器集群 ID (A.B.C.D)

默认源

字典

向此邻居发起默认路由

路由映射

字符串

用于指定发起默认路由标准的路由映射

设置

布尔值

将默认路由设置为此邻居

选择

  • false

  • true

描述

字符串

邻居特定描述

禁用连接检查

布尔值

使用环回地址的单跳 EBGP 对等体

选择

  • false

  • true

分发列表

字典

过滤到/来自此邻居的更新

ACL

字符串

ACL ID/名称

入站

布尔值

过滤传入更新

选择

  • false

  • true

出站

布尔值

过滤传出更新

选择

  • false

  • true

布尔值

传播 DMZ 链路带宽

选择

  • false

  • true

EBGP 多跳

字典

允许不在直接连接网络上的 EBGP 邻居

启用

布尔值

允许不在直接连接网络上的 EBGP 邻居

选择

  • false

  • true

跳数

整数

最大跳数

请参考供应商文档获取有效值

故障转移

字典

当对等路由丢失时会话故障

BFD

字典

使用 BFD 检测故障

多跳

布尔值

强制 BFD 多跳检测故障

选择

  • false

  • true

设置

布尔值

设置 BFD

选择

  • false

  • true

单跳

布尔值

强制 BFD 单跳检测故障

选择

  • false

  • true

路由映射

字符串

对等路由的路由映射

过滤列表

字典

建立 BGP 过滤器

AS 路径 ACL

整数

AS 路径访问列表

请参考供应商文档获取有效值

入站

布尔值

过滤传入更新

选择

  • false

  • true

出站

布尔值

过滤传出更新

选择

  • false

  • true

高可用模式

字典

高可用模式

禁用

布尔值

禁用平滑重启

选择

  • false

  • true

设置

布尔值

为此对等体设置高可用模式和平滑重启

选择

  • false

  • true

继承

字符串

继承模板

继承对等策略模板

内部 VPN 客户端

布尔值

在 ATTR_SET 中堆叠 iBGP-CE 邻居路径以进行 VPN 更新

选择

  • false

  • true

ipv6_address

别名: ipv6_adddress

字符串

邻居 IPv6 地址 (X:X:X:X::X)

此选项已弃用,并被 neighbor_address 取代,此属性将在 2025-01-01 之后删除。

local_as

字典

指定本地 AS 号

dual_as

布尔值

接受来自 ebgp 对等体的真实 AS 或本地 AS

选择

  • false

  • true

no_prepend

字典

不将本地 AS 前缀添加到来自 ebgp 对等体的更新中

replace_as

布尔值

在 EBGP 更新中用本地 AS 替换真实 AS

选择

  • false

  • true

set

布尔值

设置前缀

选择

  • false

  • true

number

字符串

用作本地 AS 的 AS 号

请参考供应商文档获取有效值

set

布尔值

设置本地 AS 号

选择

  • false

  • true

log_neighbor_changes

字典

记录邻居启动/关闭和重置原因

disable

布尔值

禁用记录邻居启动/关闭和重置

选择

  • false

  • true

set

布尔值

设置记录邻居启动/关闭和重置

选择

  • false

  • true

maximum_prefix

字典

建立 BGP 过滤器

number

整数

最大前缀数限制

请参考供应商文档获取有效值

restart

整数

超出限制后重启 BGP 连接

threshold_value

整数

生成警告消息的阈值 (%)

请参考供应商文档获取有效值

warning_only

布尔值

超出限制时仅给出警告消息

选择

  • false

  • true

neighbor_address

字符串

邻居地址 (A.B.C.D)

邻居标签

邻居 IPv6 地址 (X:X:X:X::X)

next_hop_unchanged

字典

将 iBGP 路径的下一跳不变地传播到此邻居

将所有路径(iBGP 和 eBGP)的下一跳不变地传播到此邻居

allpaths

布尔值

将所有路径(iBGP 和 eBGP)的下一跳不变地传播到此邻居

选择

  • false

  • true

set

布尔值

启用下一跳不变

选择

  • false

  • true

nexthop_self

字典

禁用此邻居的下一跳计算

all

布尔值

为 eBGP 和 iBGP 接收的路径启用下一跳自环

选择

  • false

  • true

set

布尔值

设置下一跳自环

选择

  • false

  • true

password_options

字典

设置带有加密类型的密码

encryption

整数

加密类型(0 表示禁用加密,7 表示专有)

pass_key

字符串

密码

path_attribute

字典

BGP 可选属性过滤

discard

字典

为此邻居丢弃匹配的路径属性

in

布尔值

执行入站路径属性过滤

选择

  • false

  • true

range

字典

路径属性范围

end

整数

路径属性范围结束值

请参考供应商文档获取有效值

start

整数

路径属性范围起始值

请参考供应商文档获取有效值

type

整数

路径属性类型

请参考供应商文档获取有效值

treat_as_withdraw

字典

将此邻居的匹配路径属性视为撤回

in

布尔值

执行入站路径属性过滤

选择

  • false

  • true

range

字典

路径属性范围

end

整数

路径属性范围结束值

请参考供应商文档获取有效值

start

整数

路径属性范围起始值

请参考供应商文档获取有效值

type

整数

路径属性类型

请参考供应商文档获取有效值

peer_group

布尔值

对等组的成员

选择

  • false

  • true

peer_group_name

字符串

对等组的成员

prefix_list

字典

过滤到/来自此邻居的更新

此选项已弃用,并被接受字典列表作为输入的 prefix_lists 替换

in

布尔值

过滤传入更新

选择

  • false

  • true

name

字符串

前缀列表的名称

out

布尔值

过滤传出更新

选择

  • false

  • true

prefix_lists

list / elements=dictionary

过滤到/来自此邻居的更新

in

布尔值

过滤传入更新

选择

  • false

  • true

name

字符串

前缀列表的名称

out

布尔值

过滤传出更新

选择

  • false

  • true

remote_as

字符串

指定 BGP 邻居

远程邻居的 AS

remove_private_as

字典

从出站更新中删除私有 AS 号

all

布尔值

删除所有私有 AS 号

选择

  • false

  • true

replace_as

布尔值

用本地 AS 替换所有私有 AS 号

选择

  • false

  • true

set

布尔值

从出站更新中删除私有 AS 号

选择

  • false

  • true

route_map

字典

将路由映射应用于邻居

此选项已弃用,并被接受字典列表作为输入的 route_maps 替换

in

布尔值

将映射应用于传入路由

选择

  • false

  • true

name

字符串

路由映射的名称

out

布尔值

将映射应用于出站路由

选择

  • false

  • true

route_maps

list / elements=dictionary

将路由映射应用于邻居

in

布尔值

将映射应用于传入路由

选择

  • false

  • true

name

字符串

路由映射的名称

out

布尔值

将映射应用于出站路由

选择

  • false

  • true

route_reflector_client

布尔值

将邻居配置为路由反射器客户端

选择

  • false

  • true

route_server_client

布尔值

将邻居配置为路由服务器客户端

选择

  • false

  • true

send_community

字典

向此邻居发送团体属性

both

布尔值

发送标准和扩展团体属性

选择

  • false

  • true

extended

布尔值

发送扩展团体属性

选择

  • false

  • true

set

布尔值

发送标准团体属性。

对于未指定发送团体类型的配置,保持向后兼容性。

选择

  • false

  • true

standard

布尔值

发送标准团体属性

选择

  • false

  • true

shutdown

字典

管理性地关闭此邻居

graceful

整数

正常关闭此邻居

以秒为单位的时间

请参考供应商文档获取有效值

set

布尔值

关闭

选择

  • false

  • true

slow_peer

list / elements=dictionary

配置慢速对等体

此选项已弃用,并替换为 slow_peer_options,此属性将在 2025-01-01 之后删除。

detection

字典

配置慢速对等体

disable

布尔值

禁用慢速对等体检测

选择

  • false

  • true

enable

布尔值

启用慢速对等体检测

选择

  • false

  • true

threshold

整数

设置慢速对等体检测阈值

split_update_group

字典

配置慢速对等体

dynamic

字典

配置慢速对等体

disable

布尔值

配置慢速对等体

选择

  • false

  • true

enable

布尔值

配置慢速对等体

选择

  • false

  • true

permanent

布尔值

配置慢速对等体

选择

  • false

  • true

static

布尔值

配置慢速对等体

选择

  • false

  • true

slow_peer_options

字典

配置慢速对等体选项

detection

字典

配置慢速对等体

disable

布尔值

禁用慢速对等体检测

选择

  • false

  • true

enable

布尔值

启用慢速对等体检测

选择

  • false

  • true

threshold

整数

设置慢速对等体检测阈值

split_update_group

字典

配置慢速对等体

dynamic

字典

配置慢速对等体

disable

布尔值

配置慢速对等体

选择

  • false

  • true

enable

布尔值

配置慢速对等体

选择

  • false

  • true

permanent

布尔值

配置慢速对等体

选择

  • false

  • true

static

布尔值

配置慢速对等体

选择

  • false

  • true

soft_reconfiguration

布尔值

每个邻居的软重配置

允许此邻居的入站软重配置

选择

  • false

  • true

soo

字符串

源站点扩展社区

tag

字符串

邻居标签

此选项已弃用,并被 neighbor_address 取代,此属性将在 2025-01-01 之后删除。

timers

字典

BGP 每个邻居的计时器

holdtime

整数

保持时间

interval

整数

保活间隔

min_holdtime

整数

来自邻居的最小保持时间

transport

字典

传输选项

connection_mode

字典

指定被动或主动连接

active

布尔值

主动建立 TCP 会话

选择

  • false

  • true

passive

布尔值

被动建立 TCP 会话

选择

  • false

  • true

multi_session

布尔值

使用多会话进行传输

选择

  • false

  • true

path_mtu_discovery

字典

使用传输路径 MTU 发现

disable

布尔值

禁用

选择

  • false

  • true

set

布尔值

使用路径 MTU 发现

选择

  • false

  • true

ttl_security

整数

BGP TTL 安全检查

最大跳数

请参考供应商文档获取有效值

unsuppress_map

字符串

路由映射以选择性地取消抑制被抑制的路由

version

整数

设置 BGP 版本以匹配邻居

邻居的 BGP 版本

请参考供应商文档获取有效值

weight

整数

为此邻居的路由设置默认权重

networks

别名: network

list / elements=dictionary

指定要通过 BGP 通告的网络

address

字符串

网络号 (A.B.C.D)

backdoor

布尔值

指定 BGP 后门路由

选择

  • false

  • true

evpn

布尔值

通告或导出到 EVPN 地址族

选择

  • false

  • true

mask

字符串

网络掩码 (A.B.C.D)

route_map

字符串

路由映射以修改属性

重新发布

list / elements=dictionary

从另一个路由协议重新发布信息

应用程序

字典

应用程序

度量

整数

重新发布路由的度量

名称

字符串

应用程序名称

route_map

字符串

路由映射引用

bgp

字典

边界网关协议 (BGP)

as_number

字符串

自治系统号

度量

整数

重新发布路由的度量

route_map

字符串

路由映射引用

连接的

字典

已连接

度量

整数

重新发布路由的度量

route_map

字符串

路由映射引用

设置

布尔值

重新发布自动建立的 IP 连接路由。

仅当未使用 metric 或 route_map 时才需要设置。

选择

  • false

  • true

eigrp

字典

增强型内部网关路由协议 (EIGRP)

as_number

字符串

自治系统号

度量

整数

重新发布路由的度量

route_map

字符串

路由映射引用

isis

字典

ISO IS-IS

area_tag

字符串

ISO 路由区域标签

clns

布尔值

OSI 动态路由的重新发布

选择

  • false

  • true

ip

布尔值

IP 动态路由的重新发布

选择

  • false

  • true

度量

整数

重新发布路由的度量

route_map

字符串

路由映射引用

iso_igrp

字典

用于 OSI 网络的 IGRP

area_tag

字符串

ISO 路由区域标签

route_map

字符串

路由映射引用

lisp

字典

定位符 ID 分离协议 (LISP)

度量

整数

重新发布路由的度量

route_map

字符串

路由映射引用

设置

布尔值

设置顶级属性

选择

  • false

  • true

mobile

字典

移动路由

度量

整数

重新发布路由的度量

route_map

字符串

路由映射引用

设置

布尔值

设置顶级属性

选择

  • false

  • true

odr

字典

按需存根路由

度量

整数

重新发布路由的度量

route_map

字符串

路由映射引用

设置

布尔值

设置顶级属性

选择

  • false

  • true

ospf

字典

开放最短路径优先 (OSPF)

include_connected

布尔值

包含已连接。仅适用于 IPv6 AFI

选择

  • false

  • true

match

字典

重新发布匹配的路由

external

布尔值

重新发布 OSPF 外部路由

此选项已弃用,并替换为 externals 选项,此属性将在 2025-01-01 后删除。

选择

  • false

  • true

externals

字典

重新发布 OSPF 外部路由

type_1

布尔值

重新发布 OSPF 外部 1 类路由

选择

  • false

  • true

type_2

布尔值

重新发布 OSPF 外部 1 类路由

选择

  • false

  • true

internal

布尔值

重新发布 OSPF 内部路由

选择

  • false

  • true

nssa_external

布尔值

重新发布 OSPF NSSA 外部路由

此选项已弃用,并替换为 nssa_externals 选项,此属性将在 2025-01-01 后删除。

选择

  • false

  • true

nssa_externals

字典

重新发布 OSPF NSSA 外部路由

type_1

布尔值

重新发布 NSSA 外部 1 类路由

选择

  • false

  • true

type_2

布尔值

重新发布 NSSA 外部 2 类路由

选择

  • false

  • true

type_1

布尔值

重新发布 NSSA 外部 1 类路由

此选项已弃用,并替换为 nssa_externals.type_1 选项,此属性将在 2025-01-01 后删除。

选择

  • false

  • true

type_2

布尔值

重新发布 NSSA 外部 2 类路由

此选项已弃用,并替换为 nssa_externals.type_2 选项,此属性将在 2025-01-01 后删除。

选择

  • false

  • true

度量

整数

重新发布路由的度量

process_id

整数

进程 ID

route_map

字符串

路由映射引用

vrf

字符串

VPN 路由/转发实例

ospfv3

字典

OSPFv3

match

字典

重新发布匹配的路由

external

布尔值

重新发布 OSPF 外部路由

此选项已弃用,并替换为 externals,此属性将在 2025-01-01 后删除。

选择

  • false

  • true

externals

字典

重新发布 OSPF 外部路由

type_1

布尔值

重新发布 OSPF 外部 1 类路由

选择

  • false

  • true

type_2

布尔值

重新发布 OSPF 外部 1 类路由

选择

  • false

  • true

internal

布尔值

重新发布 OSPF 内部路由

选择

  • false

  • true

nssa_external

布尔值

重新发布 OSPF 内部路由

此选项已弃用,并替换为 nssa_externals,此属性将在 2025-01-01 后删除。

选择

  • false

  • true

nssa_externals

字典

重新发布 OSPF NSSA 外部路由

type_1

布尔值

重新发布 NSSA 外部 1 类路由

选择

  • false

  • true

type_2

布尔值

重新发布 NSSA 外部 2 类路由

选择

  • false

  • true

type_1

布尔值

重新发布 NSSA 外部 1 类路由

此选项已弃用,并替换为 nssa_externals.type_1 选项,此属性将在 2025-01-01 后删除。

选择

  • false

  • true

type_2

布尔值

重新发布 NSSA 外部 2 类路由

此选项已弃用,并替换为 nssa_externals.type_2 选项,此属性将在 2025-01-01 后删除。

选择

  • false

  • true

度量

整数

重新发布路由的度量

process_id

整数

进程 ID

route_map

字符串

路由映射引用

rip

字典

路由信息协议 (RIP)

度量

整数

重新发布路由的度量

route_map

字符串

路由映射引用

设置

布尔值

设置顶级属性

选择

  • false

  • true

static

字典

静态路由

clns

布尔值

OSI 静态路由的重新发布

选择

  • false

  • true

ip

布尔值

IP 静态路由的重新发布

选择

  • false

  • true

度量

整数

重新发布路由的度量

route_map

字符串

路由映射引用

设置

布尔值

设置顶级属性

选择

  • false

  • true

vrf

字典

指定源 VRF

global

布尔值

全局 VRF

选择

  • false

  • true

名称

字符串

源 VRF 名称

safi

字符串

地址族修饰符

选择

  • "flowspec"

  • "mdt"

  • "multicast"

  • "mvpn"

  • "evpn"

  • "unicast"

snmp

字典

修改 SNMP 参数

context

字典

配置 SNMP 上下文

上下文名称

community

字典

配置 SNMP v2c 团体字符串和访问权限

acl

字符串

允许使用此团体字符串访问的标准 IP 访问列表

允许使用此团体字符串访问的扩展 IP 访问列表

访问列表名称

ipv6

字符串

指定 IPv6 命名访问列表

IPv6 访问列表名称

ro

布尔值

使用此团体字符串进行只读访问

选择

  • false

  • true

rw

布尔值

使用此团体字符串进行读写访问

选择

  • false

  • true

snmp_community

字符串

SNMP 团体字符串

名称

字符串

上下文名称

user

字典

配置 SNMP v3 用户

access

字典

指定与此组关联的访问列表

acl

字符串

SNMP 团体字符串

ipv6

字符串

指定 IPv6 命名访问列表

IPv6 访问列表名称

auth

字典

用户的身份验证参数

md5

字符串

使用 HMAC MD5 算法进行身份验证

用户的身份验证密码

sha

字符串

使用 HMAC SHA 算法进行身份验证

用户的身份验证密码

credential

布尔值

如果用户密码已配置并保存

选择

  • false

  • true

encrypted

布尔值

将密码指定为 MD5 或 SHA 摘要

选择

  • false

  • true

名称

字符串

SNMP 团体字符串

priv

字典

用户的加密参数

aes128

字符串

使用 128 位 AES 算法进行加密

aes192

字符串

使用 192 位 3DES 算法进行加密

aes256

字符串

使用 256 位 DES 算法进行加密

des

字符串

使用 56 位 DES 算法进行加密

des56

字符串

使用 56 位 DES 算法进行加密

table_map

字典

将外部条目属性映射到路由表

filter

布尔值

选择性路由下载

选择

  • false

  • true

名称

字符串

路由映射名称

vrf

字符串

为 VPN 路由/转发实例指定参数

as_number

字符串

自治系统号。

running_config

字符串

此选项仅在状态为 parsed 时使用。

此选项的值应该是通过执行命令 sh running-config | section ^router bgp 从 IOS 设备接收到的输出。

状态 parsedrunning_config 选项读取配置,并根据资源模块的 argspec 将其转换为 Ansible 结构化数据,然后该值将返回到结果中的 parsed 键中。

state

字符串

配置应保留的状态

状态 renderedgatheredparsed 不会对设备执行任何更改。

状态 rendered 会将 config 选项中的配置转换为特定于平台的 CLI 命令,这些命令将返回到结果中的 rendered 键中。对于状态 rendered,不需要与远程主机的活动连接。

状态 gathered 将从设备中获取运行配置,并将其转换为与资源模块 argspec 格式相同的结构化数据,该值将返回到结果中的 gathered 键中。

状态 parsedrunning_config 选项读取配置,并根据资源模块参数将其转换为 JSON 格式,该值将返回到结果中的 parsed 键中。running_config 选项的值应与在设备上执行的命令 show running-config | include ip route|ipv6 route 的输出格式相同。对于状态 parsed,不需要与远程主机的活动连接。

选择

  • "merged" ← (默认)

  • "replaced"

  • "overridden"

  • "deleted"

  • "gathered"

  • "rendered"

  • "parsed"

注释

注意

示例

# Using merged

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20

- name: Merge provided configuration with device configuration
  cisco.ios.ios_bgp_address_family:
    config:
      as_number: 65000
      address_family:
        - afi: ipv4
          safi: multicast
          vrf: blue
          aggregate_address:
            - address: 192.0.2.1
              netmask: 255.255.255.255
              as_confed_set: true
          bgp:
            aggregate_timer: 10
            dampening:
              penalty_half_time: 1
              reuse_route_val: 1
              suppress_route_val: 1
              max_suppress: 1
            slow_peer:
              - detection:
                  threshold: 150
          neighbor:
            - address: 198.51.100.1
              aigp:
                send:
                  cost_community:
                    id: 100
                    poi:
                      igp_cost: true
                      transitive: true
              slow_peer:
                - detection:
                    threshold: 150
              remote_as: 10
              route_map:
                - name: test-route-out
                  out: true
                - name: test-route-in
                  in: true
              route_server_client: true
          network:
            - address: 198.51.110.10
              mask: 255.255.255.255
              backdoor: true
          snmp:
            context:
              name: snmp_con
              community:
                snmp_community: community
                ro: true
                acl: 10
        - afi: ipv4
          safi: mdt
          bgp:
            dmzlink_bw: true
            dampening:
              penalty_half_time: 1
              reuse_route_val: 10
              suppress_route_val: 100
              max_suppress: 5
            soft_reconfig_backup: true
        - afi: ipv4
          safi: multicast
          aggregate_address:
            - address: 192.0.3.1
              netmask: 255.255.255.255
              as_confed_set: true
          default_metric: 12
          distance:
            external: 10
            internal: 10
            local: 100
          network:
            - address: 198.51.111.11
              mask: 255.255.255.255
              route_map: test
          table_map:
            name: test_tableMap
            filter: true
    state: merged

# Task Output:
# ------------
#
# before: {}
# commands:
#   - router bgp 65000
#   - address-family ipv4 multicast vrf blue
#   - bgp aggregate-timer 10
#   - bgp dampening 1 1 1 1
#   - bgp slow-peer detection threshold 150
#   - snmp context snmp_con community community ro 10
#   - neighbor 198.51.100.1 remote-as 10
#   - neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   - neighbor 198.51.100.1 slow-peer detection threshold 150
#   - network 198.51.110.10 mask 255.255.255.255 backdoor
#   - aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   - address-family ipv4 multicast
#   - default-metric 12
#   - distance bgp 10 10 100
#   - table-map test_tableMap filter
#   - network 198.51.111.11 mask 255.255.255.255 route-map test
#   - aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
#   - address-family ipv4 mdt
#   - bgp dmzlink-bw
#   - bgp soft-reconfig-backup
#   - bgp dampening 1 10 100 5
# after:
#   address_family:
#   - afi: ipv4
#     aggregate_addresses:
#     - address: 192.0.2.1
#       as_confed_set: true
#       netmask: 255.255.255.255
#     bgp:
#       aggregate_timer: 10
#       dampening:
#         max_suppress: 1
#         penalty_half_time: 1
#         reuse_route_val: 1
#         suppress_route_val: 1
#       slow_peer_options:
#         detection:
#           threshold: 150
#     neighbors:
#     - activate: true
#       aigp:
#         send:
#           cost_community:
#             id: 100
#             poi:
#               igp_cost: true
#               transitive: true
#       neighbor_address: 198.51.100.1
#       slow_peer_options:
#         detection:
#           threshold: 150
#     networks:
#     - address: 198.51.110.10
#       backdoor: true
#       mask: 255.255.255.255
#     snmp:
#       context:
#         community:
#           acl: '10'
#           ro: true
#           snmp_community: community
#         name: snmp_con
#   - afi: ipv4
#     aggregate_addresses:
#     - address: 192.0.3.1
#       as_confed_set: true
#       netmask: 255.255.255.255
#     default_metric: 12
#     distance:
#       external: 10
#       internal: 10
#       local: 100
#     networks:
#     - address: 198.51.111.11
#       mask: 255.255.255.255
#       route_map: test
#     safi: multicast
#     table_map:
#       filter: true
#       name: test_tableMap
#   - afi: ipv4
#     bgp:
#       dampening:
#         max_suppress: 5
#         penalty_half_time: 1
#         reuse_route_val: 10
#         suppress_route_val: 100
#       dmzlink_bw: true
#       soft_reconfig_backup: true
#     safi: mdt
#   as_number: '65000'

# After state:
# ------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  snmp context snmp_con community community RO 10
#  neighbor 198.51.100.1 remote-as 10
#  !
#  address-family ipv4
#   snmp context snmp_con community community RO 10
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 1 1 1 1
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#  exit-address-family
#  !
#  address-family ipv4 multicast
#   table-map test_tableMap filter
#   network 198.51.111.11 mask 255.255.255.255 route-map test
#   aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
#   default-metric 12
#   distance bgp 10 10 100
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family

# Using replaced

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  snmp context snmp_con community community RO 10
#  neighbor 198.51.100.1 remote-as 10
#  !
#  address-family ipv4
#   snmp context snmp_con community community RO 10
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 1 1 1 1
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#  exit-address-family
#  !
#  address-family ipv4 multicast
#   table-map test_tableMap filter
#   network 198.51.111.11 mask 255.255.255.255 route-map test
#   aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
#   default-metric 12
#   distance bgp 10 10 100
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family

- name: Replaces device configuration of listed AF BGP with provided configuration
  cisco.ios.ios_bgp_address_family:
    config:
      as_number: 65000
      address_family:
        - afi: ipv4
          safi: multicast
          vrf: blue
          aggregate_address:
            - address: 192.0.2.1
              netmask: 255.255.255.255
              as_confed_set: true
          bgp:
            aggregate_timer: 10
            dampening:
              penalty_half_time: 1
              reuse_route_val: 1
              suppress_route_val: 1
              max_suppress: 1
            slow_peer:
              - detection:
                  threshold: 150
          neighbor:
            - address: 198.51.110.1
              activate: true
              aigp:
                send:
                  cost_community:
                    id: 200
                    poi:
                      igp_cost: true
                      transitive: true
              slow_peer:
                - detection:
                    threshold: 150
              remote_as: 10
          network:
            - address: 198.51.110.10
              mask: 255.255.255.255
              backdoor: true
        - afi: ipv4
          safi: multicast
          bgp:
            aggregate_timer: 10
            dampening:
              penalty_half_time: 10
              reuse_route_val: 10
              suppress_route_val: 10
              max_suppress: 10
            slow_peer:
              - detection:
                  threshold: 200
          network:
            - address: 192.0.2.1
              mask: 255.255.255.255
              route_map: test
    state: replaced

# Task Output:
# ------------
# before:
#     address_family:
#     - afi: ipv4
#       aggregate_addresses:
#       - address: 192.0.2.1
#         as_confed_set: true
#         netmask: 255.255.255.255
#       bgp:
#         aggregate_timer: 10
#         dampening:
#           max_suppress: 1
#           penalty_half_time: 1
#           reuse_route_val: 1
#           suppress_route_val: 1
#         slow_peer_options:
#           detection:
#             threshold: 150
#       neighbors:
#       - activate: true
#         aigp:
#           send:
#             cost_community:
#               id: 100
#               poi:
#                 igp_cost: true
#                 transitive: true
#         neighbor_address: 198.51.100.1
#         slow_peer_options:
#           detection:
#             threshold: 150
#       networks:
#       - address: 198.51.110.10
#         backdoor: true
#         mask: 255.255.255.255
#       snmp:
#         context:
#           community:
#             acl: '10'
#             ro: true
#             snmp_community: community
#           name: snmp_con
#     - afi: ipv4
#       aggregate_addresses:
#       - address: 192.0.3.1
#         as_confed_set: true
#         netmask: 255.255.255.255
#       default_metric: 12
#       distance:
#         external: 10
#         internal: 10
#         local: 100
#       networks:
#       - address: 198.51.111.11
#         mask: 255.255.255.255
#         route_map: test
#       safi: multicast
#       table_map:
#         filter: true
#         name: test_tableMap
#     - afi: ipv4
#       bgp:
#         dampening:
#           max_suppress: 5
#           penalty_half_time: 1
#           reuse_route_val: 10
#           suppress_route_val: 100
#         dmzlink_bw: true
#         soft_reconfig_backup: true
#       safi: mdt
#     as_number: '65000'
# commands:
# - router bgp 65000
# - address-family ipv4 multicast vrf blue
# - bgp aggregate-timer 10
# - bgp dampening 1 1 1 1
# - bgp slow-peer detection threshold 150
# - neighbor 198.51.110.1 remote-as 10
# - neighbor 198.51.110.1 activate
# - neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive
# - neighbor 198.51.110.1 slow-peer detection threshold 150
# - network 198.51.110.10 mask 255.255.255.255 backdoor
# - aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# - address-family ipv4 multicast
# - no default-metric 12
# - no distance bgp 10 10 100
# - no table-map test_tableMap filter
# - bgp aggregate-timer 10
# - bgp dampening 10 10 10 10
# - bgp slow-peer detection threshold 200
# - network 192.0.2.1 mask 255.255.255.255 route-map test
# - no network 198.51.111.11 mask 255.255.255.255 route-map test
# - no aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# after:
#   address_family:
#   - afi: ipv4
#     aggregate_addresses:
#     - address: 192.0.2.1
#       as_confed_set: true
#       netmask: 255.255.255.255
#     bgp:
#       aggregate_timer: 10
#       dampening:
#         max_suppress: 1
#         penalty_half_time: 1
#         reuse_route_val: 1
#         suppress_route_val: 1
#       slow_peer_options:
#         detection:
#           threshold: 150
#     neighbors:
#     - activate: true
#       aigp:
#         send:
#           cost_community:
#             id: 100
#             poi:
#               igp_cost: true
#               transitive: true
#       neighbor_address: 198.51.100.1
#       slow_peer_options:
#         detection:
#           threshold: 150
#     - activate: true
#       aigp:
#         send:
#           cost_community:
#             id: 200
#             poi:
#               igp_cost: true
#               transitive: true
#       neighbor_address: 198.51.110.1
#       slow_peer_options:
#         detection:
#           threshold: 150
#     networks:
#     - address: 198.51.110.10
#       backdoor: true
#       mask: 255.255.255.255
#     snmp:
#       context:
#         community:
#           acl: '10'
#           ro: true
#           snmp_community: community
#         name: snmp_con
#   - afi: ipv4
#     bgp:
#       aggregate_timer: 10
#       dampening:
#         max_suppress: 10
#         penalty_half_time: 10
#         reuse_route_val: 10
#         suppress_route_val: 10
#       slow_peer_options:
#         detection:
#           threshold: 200
#     networks:
#     - address: 192.0.2.1
#       mask: 255.255.255.255
#       route_map: test
#     safi: multicast
#   - afi: ipv4
#     bgp:
#       dampening:
#         max_suppress: 5
#         penalty_half_time: 1
#         reuse_route_val: 10
#         suppress_route_val: 100
#       dmzlink_bw: true
#       soft_reconfig_backup: true
#     safi: mdt
#   as_number: '65000'

# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  snmp context snmp_con community community RO 10
#  neighbor 198.51.100.1 remote-as 10
#  neighbor 198.51.110.1 remote-as 10
#  !
#  address-family ipv4
#   snmp context snmp_con community community RO 10
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 1 1 1 1
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#   neighbor 198.51.110.1 activate
#   neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive
#   neighbor 198.51.110.1 slow-peer detection threshold 150
#  exit-address-family
#  !
#  address-family ipv4 multicast
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 200
#   bgp dampening 10 10 10 10
#   network 192.0.2.1 mask 255.255.255.255 route-map test
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family

# Using overridden

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  snmp context snmp_con community community RO 10
#  neighbor 198.51.100.1 remote-as 10
#  neighbor 198.51.110.1 remote-as 10
#  !
#  address-family ipv4
#   snmp context snmp_con community community RO 10
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 1 1 1 1
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#   neighbor 198.51.110.1 activate
#   neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive
#   neighbor 198.51.110.1 slow-peer detection threshold 150
#  exit-address-family
#  !
#  address-family ipv4 multicast
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 200
#   bgp dampening 10 10 10 10
#   network 192.0.2.1 mask 255.255.255.255 route-map test
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family

- name: Override device configuration of all AF BGP with provided configuration
  cisco.ios.ios_bgp_address_family:
    config:
      as_number: 65000
      address_family:
        - afi: ipv4
          safi: multicast
          vrf: blue
          aggregate_address:
            - address: 192.0.2.1
              netmask: 255.255.255.255
              as_confed_set: true
          bgp:
            aggregate_timer: 10
            dampening:
              penalty_half_time: 10
              reuse_route_val: 10
              suppress_route_val: 100
              max_suppress: 50
            slow_peer:
              - detection:
                  threshold: 150
          neighbor:
            - address: 198.51.110.1
              activate: true
              log_neighbor_changes:
                disable: true
              maximum_prefix:
                number: 1
                threshold_value: 10
                restart: 100
              slow_peer:
                - detection:
                    threshold: 150
              remote_as: 100
              version: 4
          network:
            - address: 198.51.110.10
              mask: 255.255.255.255
              backdoor: true
        - afi: ipv6
          safi: multicast
          default_information: true
          bgp:
            aggregate_timer: 10
            dampening:
              penalty_half_time: 10
              reuse_route_val: 10
              suppress_route_val: 10
              max_suppress: 10
            slow_peer:
              - detection:
                  threshold: 200
          network:
            - address: 2001:DB8:0:3::/64
              route_map: test_ipv6
    state: overridden

# Task Output:
# ------------
#
# before:
#     address_family:
#     - afi: ipv4
#       aggregate_addresses:
#       - address: 192.0.2.1
#         as_confed_set: true
#         netmask: 255.255.255.255
#       bgp:
#         aggregate_timer: 10
#         dampening:
#           max_suppress: 10
#           penalty_half_time: 10
#           reuse_route_val: 10
#           suppress_route_val: 10
#         slow_peer_options:
#           detection:
#             threshold: 200
#       default_information: true
#       neighbors:
#       - activate: true
#         aigp:
#           send:
#             cost_community:
#               id: 100
#               poi:
#                 igp_cost: true
#                 transitive: true
#         neighbor_address: 198.51.100.1
#         slow_peer_options:
#           detection:
#             threshold: 150
#       - activate: true
#         aigp:
#           send:
#             cost_community:
#               id: 200
#               poi:
#                 igp_cost: true
#                 transitive: true
#         maximum_prefix:
#           number: 1
#           restart: 100
#           threshold_value: 10
#         neighbor_address: 198.51.110.1
#         slow_peer_options:
#           detection:
#             threshold: 150
#       networks:
#       - address: 198.51.110.10
#         backdoor: true
#         mask: 255.255.255.255
#     - afi: ipv4
#       safi: multicast
#     - afi: ipv4
#       safi: mdt
#     - afi: ipv6
#       safi: multicast
#     as_number: '65000'
# commands:
# - router bgp 65000
# - address-family ipv4
# - no default-information originate
# - no bgp aggregate-timer 10
# - no bgp dampening 10 10 10 10
# - no bgp slow-peer detection threshold 200
# - no neighbor 198.51.100.1
# - no neighbor 198.51.110.1
# - no network 198.51.110.10 mask 255.255.255.255 backdoor
# - no aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# - address-family ipv4 multicast vrf blue
# - bgp aggregate-timer 10
# - bgp dampening 10 10 100 50
# - bgp slow-peer detection threshold 150
# - neighbor 198.51.110.1 remote-as 100
# - neighbor 198.51.110.1 activate
# - neighbor 198.51.110.1 disable
# - neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
# - neighbor 198.51.110.1 slow-peer detection threshold 150
# - neighbor 198.51.110.1 version 4
# - network 198.51.110.10 mask 255.255.255.255 backdoor
# - aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# - address-family ipv6 multicast
# - default-information originate
# - bgp aggregate-timer 10
# - bgp dampening 10 10 10 10
# - bgp slow-peer detection threshold 200
# after:
#   address_family:
#   - afi: ipv4
#     aggregate_addresses:
#     - address: 192.0.2.1
#       as_confed_set: true
#       netmask: 255.255.255.255
#     bgp:
#       aggregate_timer: 10
#       dampening:
#         max_suppress: 10
#         penalty_half_time: 10
#         reuse_route_val: 10
#         suppress_route_val: 10
#       slow_peer_options:
#         detection:
#           threshold: 200
#     default_information: true
#     neighbors:
#     - activate: true
#       aigp:
#         send:
#           cost_community:
#             id: 100
#             poi:
#               igp_cost: true
#               transitive: true
#       neighbor_address: 198.51.100.1
#       slow_peer_options:
#         detection:
#           threshold: 150
#     - activate: true
#       aigp:
#         send:
#           cost_community:
#             id: 200
#             poi:
#               igp_cost: true
#               transitive: true
#       maximum_prefix:
#         number: 1
#         restart: 100
#         threshold_value: 10
#       neighbor_address: 198.51.110.1
#       slow_peer_options:
#         detection:
#           threshold: 150
#     networks:
#     - address: 198.51.110.10
#       backdoor: true
#       mask: 255.255.255.255
#   - afi: ipv4
#     safi: multicast
#   - afi: ipv4
#     safi: mdt
#   - afi: ipv6
#     safi: multicast
#   as_number: '65000'

# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  neighbor 198.51.100.1 remote-as 10
#  neighbor 198.51.110.1 remote-as 100
#  neighbor 198.51.110.1 disable-connected-check
#  neighbor 198.51.110.1 version 4
#  !
#  address-family ipv4
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 200
#   bgp dampening 10 10 10 10
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#   neighbor 198.51.110.1 activate
#   neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive
#   neighbor 198.51.110.1 slow-peer detection threshold 150
#   neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
#   default-information originate
#  exit-address-family
#  !
#  address-family ipv4 multicast
#  exit-address-family
#  !
#  address-family ipv4 mdt
#  exit-address-family
#  !
#  address-family ipv6 multicast
#  exit-address-family

# Using deleted

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  neighbor 198.51.100.1 remote-as 10
#  neighbor 198.51.110.1 remote-as 100
#  neighbor 198.51.110.1 disable-connected-check
#  neighbor 198.51.110.1 version 4
#  !
#  address-family ipv4
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 200
#   bgp dampening 10 10 10 10
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#   neighbor 198.51.110.1 activate
#   neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive
#   neighbor 198.51.110.1 slow-peer detection threshold 150
#   neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
#   default-information originate
#  exit-address-family
#  !
#  address-family ipv4 multicast
#  exit-address-family
#  !
#  address-family ipv4 mdt
#  exit-address-family
#  !
#  address-family ipv6 multicast
#  exit-address-family

- name: "Delete AF BGP (Note: This won't delete the all configured AF BGP)"
  cisco.ios.ios_bgp_address_family:
    config:
      as_number: 65000
      address_family:
        - afi: ipv4
          safi: multicast
        - afi: ipv4
          safi: mdt
    state: deleted

# Task Output:
# ------------
#
# before:
#     address_family:
#     - afi: ipv4
#       aggregate_addresses:
#       - address: 192.0.2.1
#         as_confed_set: true
#         netmask: 255.255.255.255
#       bgp:
#         aggregate_timer: 10
#         dampening:
#           max_suppress: 10
#           penalty_half_time: 10
#           reuse_route_val: 10
#           suppress_route_val: 10
#         slow_peer_options:
#           detection:
#             threshold: 200
#       default_information: true
#       neighbors:
#       - activate: true
#         aigp:
#           send:
#             cost_community:
#               id: 100
#               poi:
#                 igp_cost: true
#                 transitive: true
#         neighbor_address: 198.51.100.1
#         slow_peer_options:
#           detection:
#             threshold: 150
#       - activate: true
#         aigp:
#           send:
#             cost_community:
#               id: 200
#               poi:
#                 igp_cost: true
#                 transitive: true
#         maximum_prefix:
#           number: 1
#           restart: 100
#           threshold_value: 10
#         neighbor_address: 198.51.110.1
#         slow_peer_options:
#           detection:
#             threshold: 150
#       networks:
#       - address: 198.51.110.10
#         backdoor: true
#         mask: 255.255.255.255
#     - afi: ipv4
#       safi: multicast
#     - afi: ipv4
#       safi: mdt
#     - afi: ipv6
#       safi: multicast
#     as_number: '65000'
# commands:
# - router bgp 65000
# - no address-family ipv4 multicast
# - no address-family ipv4 mdt
# after:
#   address_family:
#   - afi: ipv4
#     aggregate_addresses:
#     - address: 192.0.2.1
#       as_confed_set: true
#       netmask: 255.255.255.255
#     bgp:
#       aggregate_timer: 10
#       dampening:
#         max_suppress: 10
#         penalty_half_time: 10
#         reuse_route_val: 10
#         suppress_route_val: 10
#       slow_peer_options:
#         detection:
#           threshold: 200
#     default_information: true
#     neighbors:
#     - activate: true
#       aigp:
#         send:
#           cost_community:
#             id: 100
#             poi:
#               igp_cost: true
#               transitive: true
#       neighbor_address: 198.51.100.1
#       slow_peer_options:
#         detection:
#           threshold: 150
#     - activate: true
#       aigp:
#         send:
#           cost_community:
#             id: 200
#             poi:
#               igp_cost: true
#               transitive: true
#       maximum_prefix:
#         number: 1
#         restart: 100
#         threshold_value: 10
#       neighbor_address: 198.51.110.1
#       slow_peer_options:
#         detection:
#           threshold: 150
#     networks:
#     - address: 198.51.110.10
#       backdoor: true
#       mask: 255.255.255.255
#   - afi: ipv6
#     safi: multicast
#   as_number: '65000'

# After state:
# -------------
#
# vios#sh running-config | section ^router bg
# hostname#show running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  neighbor 198.51.100.1 remote-as 10
#  neighbor 198.51.110.1 remote-as 100
#  neighbor 198.51.110.1 disable-connected-check
#  neighbor 198.51.110.1 version 4
#  !
#  address-family ipv4
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 200
#   bgp dampening 10 10 10 10
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#   neighbor 198.51.110.1 activate
#   neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive
#   neighbor 198.51.110.1 slow-peer detection threshold 150
#   neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
#   default-information originate
#  exit-address-family
#  !
#  address-family ipv6 multicast
#  exit-address-family

# Using Deleted without any config passed (delete all)

# Before state:
# -------------
#
# vios#sh running-config | section ^router bg
# hostname#show running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  neighbor 198.51.100.1 remote-as 10
#  neighbor 198.51.110.1 remote-as 100
#  neighbor 198.51.110.1 disable-connected-check
#  neighbor 198.51.110.1 version 4
#  !
#  address-family ipv4
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 200
#   bgp dampening 10 10 10 10
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#   neighbor 198.51.110.1 activate
#   neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive
#   neighbor 198.51.110.1 slow-peer detection threshold 150
#   neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
#   default-information originate
#  exit-address-family
#  !
#  address-family ipv6 multicast
#  exit-address-family

- name: "Delete ALL of configured AF BGP"
  cisco.ios.ios_bgp_address_family:
    state: deleted

# Task Output:
# ------------
#
# before:
#   address_family:
#   - afi: ipv4
#     aggregate_addresses:
#     - address: 192.0.2.1
#       as_confed_set: true
#       netmask: 255.255.255.255
#     bgp:
#       aggregate_timer: 10
#       dampening:
#         max_suppress: 10
#         penalty_half_time: 10
#         reuse_route_val: 10
#         suppress_route_val: 10
#       slow_peer_options:
#         detection:
#           threshold: 200
#     default_information: true
#     neighbors:
#     - activate: true
#       aigp:
#         send:
#           cost_community:
#             id: 100
#             poi:
#               igp_cost: true
#               transitive: true
#       neighbor_address: 198.51.100.1
#       slow_peer_options:
#         detection:
#           threshold: 150
#     - activate: true
#       aigp:
#         send:
#           cost_community:
#             id: 200
#             poi:
#               igp_cost: true
#               transitive: true
#       maximum_prefix:
#         number: 1
#         restart: 100
#         threshold_value: 10
#       neighbor_address: 198.51.110.1
#       slow_peer_options:
#         detection:
#           threshold: 150
#     networks:
#     - address: 198.51.110.10
#       backdoor: true
#       mask: 255.255.255.255
#   - afi: ipv6
#     safi: multicast
#   as_number: '65000'
# commands:
# - router bgp 65000
# - no address-family ipv4
# - no address-family ipv6 multicast
# after:
#   address_family:
#   - afi: ipv4
#     bgp:
#       aggregate_timer: 10
#   as_number: '65000'

# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  neighbor 198.51.100.1 remote-as 10
#  neighbor 198.51.110.1 remote-as 100
#  neighbor 198.51.110.1 disable-connected-check
#  neighbor 198.51.110.1 version 4
#  !
#  address-family ipv4
#   bgp aggregate-timer 10
#   no neighbor 198.51.100.1 activate
#   no neighbor 198.51.110.1 activate
#  exit-address-family

# Using gathered

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  snmp context snmp_con community community RO 10
#  neighbor 198.51.100.1 remote-as 10
#  !
#  address-family ipv4
#   snmp context snmp_con community community RO 10
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 1 1 1 1
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#  exit-address-family
#  !
#  address-family ipv4 multicast
#   table-map test_tableMap filter
#   network 198.51.111.11 mask 255.255.255.255 route-map test
#   aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
#   default-metric 12
#   distance bgp 10 10 100
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family

- name: Gather listed AF BGP with provided configurations
  cisco.ios.ios_bgp_address_family:
    config:
    state: gathered

# Task Output:
# ------------
#
# gathered:
#     address_family:
#     - afi: ipv4
#       aggregate_addresses:
#       - address: 192.0.2.1
#         as_confed_set: true
#         netmask: 255.255.255.255
#       bgp:
#         aggregate_timer: 10
#         dampening:
#           max_suppress: 1
#           penalty_half_time: 1
#           reuse_route_val: 1
#           suppress_route_val: 1
#         slow_peer_options:
#           detection:
#             threshold: 150
#       neighbors:
#       - activate: true
#         aigp:
#           send:
#             cost_community:
#               id: 100
#               poi:
#                 igp_cost: true
#                 transitive: true
#         neighbor_address: 198.51.100.1
#         slow_peer_options:
#           detection:
#             threshold: 150
#       networks:
#       - address: 198.51.110.10
#         backdoor: true
#         mask: 255.255.255.255
#       snmp:
#         context:
#           community:
#             acl: '10'
#             ro: true
#             snmp_community: community
#           name: snmp_con
#     - afi: ipv4
#       aggregate_addresses:
#       - address: 192.0.3.1
#         as_confed_set: true
#         netmask: 255.255.255.255
#       default_metric: 12
#       distance:
#         external: 10
#         internal: 10
#         local: 100
#       networks:
#       - address: 198.51.111.11
#         mask: 255.255.255.255
#         route_map: test
#       safi: multicast
#       table_map:
#         filter: true
#         name: test_tableMap
#     - afi: ipv4
#       bgp:
#         dampening:
#           max_suppress: 5
#           penalty_half_time: 1
#           reuse_route_val: 10
#           suppress_route_val: 100
#         dmzlink_bw: true
#         soft_reconfig_backup: true
#       safi: mdt
#     as_number: '65000'

# Using rendered

- name: Rendered the provided configuration with the existing running configuration
  cisco.ios.ios_bgp_address_family:
    config:
      as_number: 65000
      address_family:
        - afi: ipv4
          safi: multicast
          vrf: blue
          aggregate_address:
            - address: 192.0.2.1
              netmask: 255.255.255.255
              as_confed_set: true
          bgp:
            aggregate_timer: 10
            dampening:
              penalty_half_time: 1
              reuse_route_val: 1
              suppress_route_val: 1
              max_suppress: 1
            slow_peer:
              - detection:
                  threshold: 150
          neighbor:
            - address: 198.51.100.1
              aigp:
                send:
                  cost_community:
                    id: 100
                    poi:
                      igp_cost: true
                      transitive: true
              slow_peer:
                - detection:
                    threshold: 150
              remote_as: 10
              route_maps:
                - name: test-route
                  out: true
              route_server_client: true
          network:
            - address: 198.51.110.10
              mask: 255.255.255.255
              backdoor: true
          snmp:
            context:
              name: snmp_con
              community:
                snmp_community: community
                ro: true
                acl: 10
        - afi: ipv4
          safi: mdt
          bgp:
            dmzlink_bw: true
            dampening:
              penalty_half_time: 1
              reuse_route_val: 10
              suppress_route_val: 100
              max_suppress: 5
            soft_reconfig_backup: true
    state: rendered

# Task Output:
# ------------
#
# rendered:
# - router bgp 65000
# - address-family ipv4 multicast vrf blue
# - bgp aggregate-timer 10
# - bgp dampening 1 1 1 1
# - bgp slow-peer detection threshold 150
# - snmp context snmp_con community community ro 10
# - neighbor 198.51.100.1 remote-as 10
# - neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# - neighbor 198.51.100.1 slow-peer detection threshold 150
# - network 198.51.110.10 mask 255.255.255.255 backdoor
# - aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# - address-family ipv4 mdt
# - bgp dmzlink-bw
# - bgp soft-reconfig-backup
# - bgp dampening 1 10 100 5

# Using parsed

# File: parsed.cfg
# ----------------
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20
#  !
#  address-family ipv4 multicast
#   table-map test_tableMap filter
#   network 1.1.1.1 mask 255.255.255.255 route-map test
#   aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
#   default-metric 12
#   distance bgp 10 10 100
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family
#  !

- name: Parse the commands for provided configuration
  cisco.ios.ios_bgp_address_family:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# Task Output:
# ------------
#
# parsed:
#     address_family:
#     - afi: ipv4
#       aggregate_addresses:
#       - address: 192.0.2.1
#         as_confed_set: true
#         netmask: 255.255.255.255
#       bgp:
#         aggregate_timer: 10
#         dampening:
#           max_suppress: 1
#           penalty_half_time: 1
#           reuse_route_val: 1
#           suppress_route_val: 1
#         slow_peer_options:
#           detection:
#             threshold: 150
#       neighbors:
#       - activate: true
#         aigp:
#           send:
#             cost_community:
#               id: 100
#               poi:
#                 igp_cost: true
#                 transitive: true
#         neighbor_address: 198.51.100.1
#         slow_peer_options:
#           detection:
#             threshold: 150
#       networks:
#       - address: 198.51.110.10
#         backdoor: true
#         mask: 255.255.255.255
#       snmp:
#         context:
#           community:
#             acl: '10'
#             ro: true
#             snmp_community: community
#           name: snmp_con
#     - afi: ipv4
#       aggregate_addresses:
#       - address: 192.0.3.1
#         as_confed_set: true
#         netmask: 255.255.255.255
#       default_metric: 12
#       distance:
#         external: 10
#         internal: 10
#         local: 100
#       networks:
#       - address: 198.51.111.11
#         mask: 255.255.255.255
#         route_map: test
#       safi: multicast
#       table_map:
#         filter: true
#         name: test_tableMap
#     - afi: ipv4
#       bgp:
#         dampening:
#           max_suppress: 5
#           penalty_half_time: 1
#           reuse_route_val: 10
#           suppress_route_val: 100
#         dmzlink_bw: true
#         soft_reconfig_backup: true
#       safi: mdt
#     as_number: '65000'

返回值

常见的返回值记录在此处,以下是此模块特有的字段

描述

after

字典

模块执行后的结果配置。

返回值: 当发生更改时

示例: "此输出将始终与模块参数规范格式相同。\n"

before

字典

模块执行前的配置。

返回值:状态mergedreplacedoverriddendeletedpurged

示例: "此输出将始终与模块参数规范格式相同。\n"

commands

列表 / 元素=字符串

推送到远程设备的一组命令。

返回值:状态mergedreplacedoverriddendeletedpurged

示例: ["router bgp 65000", "address-family ipv4 multicast", "table-map test_tableMap filter", "network 1.1.1.1 mask 255.255.255.255 route-map test", "aggregate-address 192.0.3.1 255.255.255.255 as-confed-set"]

gathered

列表 / 元素=字符串

从远程设备收集的有关网络资源的事实,以结构化数据的形式呈现。

返回值:状态gathered

示例: ["此输出将始终与模块参数规范格式相同。\n"]

parsed

列表 / 元素=字符串

根据模块参数规范,将 running_config 选项中提供的设备本地配置解析为结构化数据。

返回值:状态parsed

示例: ["此输出将始终与模块参数规范格式相同。\n"]

rendered

列表 / 元素=字符串

任务中提供的配置以设备本地格式呈现(离线)。

返回值:状态rendered

示例: ["router bgp 65000", "address-family ipv4 multicast", "table-map test_tableMap filter", "network 1.1.1.1 mask 255.255.255.255 route-map test", "aggregate-address 192.0.3.1 255.255.255.255 as-confed-set"]

作者

  • Sagar Paul (@KB-perByte)

  • Sumit Jaiswal (@justjais)