cisco.ios.ios_bgp_global 模块 – 用于配置 BGP 的资源模块。

注意

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

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

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

要在 Playbook 中使用它,请指定:cisco.ios.ios_bgp_global

cisco.ios 1.3.0 中的新增功能

概要

  • 此模块配置和管理 Cisco IOS 上全局 BGP 的属性。

参数

参数

注释

config

字典

用于 BGP 配置的选项字典。

aggregate_addresses

列表 / 元素=字典

配置 BGP 聚合条目

address

字符串

指定聚合地址

advertise_map

字符串

设置通告属性的条件

as_confed_set

布尔值

生成 AS 联盟集路径信息

选项

  • false

  • true

as_set

布尔值

生成 AS 集路径信息

选项

  • false

  • true

attribute_map

字符串

设置聚合的属性

netmask

字符串

指定聚合掩码

summary_only

布尔值

从更新中过滤更具体的路由

选项

  • false

  • true

suppress_map

字符串

有条件地从更新中过滤更具体的路由

as_number

字符串

自治系统号

auto_summary

布尔值

启用自动网络号汇总

选项

  • false

  • true

bgp

字典

启用地址族并进入其配置模式

additional_paths

字典

BGP 表中的其他路径

install

布尔值

要安装到 RIB 中的其他路径

选项

  • false

  • true

receive

布尔值

从邻居接收其他路径

选项

  • false

  • true

select

字典

选择路径的选择标准

all

布尔值

选择所有可用路径

选项

  • false

  • true

best

整数

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

best_external

布尔值

选择最佳外部路径

选项

  • false

  • true

group_best

布尔值

选择组最佳路径

选项

  • false

  • true

send

布尔值

向邻居发送其他路径

选项

  • false

  • true

advertise_best_external

布尔值

向内部对等方通告最佳外部路径

选项

  • false

  • true

aggregate_timer

整数

配置聚合计时器

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

always_compare_med

布尔值

允许比较来自不同邻居的 MED

选项

  • false

  • true

asnotation

布尔值

更改默认的 as plain 表示法

asdot 表示法

选项

  • false

  • true

bestpath_options

字典

更改默认的最佳路径选择

aigp

布尔值

如果两个路径都没有 aigp,则在最佳路径比较中忽略

ignore

选项

  • false

  • true

compare_routerid

布尔值

比较相同的 EBGP 路径的路由器 ID

选项

  • false

  • true

cost_community

布尔值

成本社区

选项

  • false

  • true

igp_metric

布尔值

igp 指标

在最佳路径选择中忽略 igp 指标

选项

  • false

  • true

med

字典

MED 属性

confed

布尔值

比较联盟路径之间的 MED

选项

  • false

  • true

missing_as_worst

布尔值

将缺失的 MED 视为最不优选的

选项

  • false

  • true

client_to_client

字典

配置客户端到客户端的路由反射

all

布尔值

集群间和集群内(默认)

选项

  • false

  • true

intra_cluster

字符串

集群内反射

集群 ID 的集群内反射

set

布尔值

设置允许的路由反射

选项

  • false

  • true

cluster_id

字符串

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

A.B.C.D/请参阅供应商文档以获取有效的路由反射器集群 ID

confederation

字典

AS 联盟参数

identifier

字符串

设置路由域联盟 AS

AS 号

peers

字符串

BGP 联盟中的对等 AS

AS 号

consistency_checker

字典

一致性检查器

auto_repair

字典

自动修复

interval

整数

设置 BGP 一致性检查器

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

set

布尔值

启用自动修复

选项

  • false

  • true

error_message

字典

记录错误消息

interval

整数

设置 BGP 一致性检查器

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

set

布尔值

启用错误消息

选项

  • false

  • true

dampening

字典

启用路由翻动抑制

max_suppress

整数

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

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

penalty_half_time

整数

惩罚的半衰期

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

reuse_route_val

整数

开始重用路由的值

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

route_map

字符串

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

suppress_route_val

整数

开始抑制路由的值

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

default

字典

配置 BGP 默认值

ipv4_unicast

布尔值

默认情况下激活对等方的 ipv4-unicast

选项

  • false

  • true ←(默认)

route_target

字典

根据路由目标属性控制行为

filter

布尔值

控制自动 VPN 路由目标过滤

选项

  • false

  • true ←(默认)

deterministic_med

布尔值

在来自相邻 AS 通告的路径中选择最佳 MED 路径

选项

  • false

  • true

布尔值

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

选项

  • false

  • true

enforce_first_as

布尔值

强制执行 EBGP 路由的第一个 AS(默认)

选项

  • false

  • true

enhanced_error

布尔值

启用 BGP 增强错误处理

选项

  • false

  • true

fast_external_fallover

布尔值

如果与直接连接的外部对等方的链路中断,则立即重置会话

选项

  • false

  • true

graceful_restart

字典

平滑重启功能参数

extended

布尔值

启用平滑重启扩展

选项

  • false

  • true

restart_time

整数

设置重启并恢复正常所需的最大时间

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

set

布尔值

设置平滑重启

选项

  • false

  • true

stalepath_time

整数

设置保持重启对等方陈旧路径的最大时间

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

graceful_shutdown

字典

平滑关机功能参数

community

字符串

为 Gshut 路由设置 Community

社区号/aa:nn 格式的社区号

local_preference

整数

为 Gshut 路由设置本地首选项

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

neighbors

字典

平滑关闭所有邻居

activate

布尔值

激活所有邻居的平滑关机

选项

  • false

  • true

time

整数

以秒为单位的时间

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

vrfs

字典

平滑关闭所有 VRF 邻居

activate

布尔值

激活所有邻居的平滑关机

选项

  • false

  • true

time

整数

以秒为单位的时间

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

inject_maps

列表 / 元素=字典

指定要注入的前缀的路由图

copy_attributes

布尔值

从聚合复制属性

选项

  • false

  • true

exist_map_name

字符串

路由图名称

name

字符串

路由图名称

listen

字典

邻居子网范围侦听器

limit

整数

设置动态子网范围邻居的最大限制

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

range

字典

子网网络范围

host_with_subnet

字符串

IPv4 子网范围 (A.B.C.D/nn)

IPv6 子网范围 (X:X:X:X::X/<0-128>)

peer_group

字符串

对等组的成员

log_neighbor_changes

布尔值

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

选项

  • false

  • true

maxas_limit

整数

允许来自任何邻居的 AS-PATH 属性,并限制 AS 的数量

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

maxcommunity_limit

整数

允许来自任何邻居的 COMMUNITY 属性,并限制社团的数量

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

maxextcommunity_limit

整数

允许来自任何邻居的 EXTENDED COMMUNITY 属性,并限制扩展社团的数量

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

nexthop

字典

下一跳跟踪命令

route_map

字符串

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

trigger

字典

下一跳跟踪

delay

整数

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

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

enable

布尔值

启用下一跳跟踪

选项

  • false

  • true

nopeerup_delay_options

字典

设置 BGP 在开始更新延迟或优雅重启计时器之前等待第一个对等体启动的时间(以秒为单位)

cold_boot

整数

在冷启动时等待第一个对等体启动的时间

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

nsf_switchover

整数

在 NSF 切换后等待第一个对等体启动的时间

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

post_boot

整数

在系统已启动且所有对等体都关闭后,等待第一个对等体启动的时间

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

user_initiated

整数

在管理员用户手动清除 BGP 对等体后,等待第一个对等体启动的时间

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

recursion

布尔值

下一跳的递归规则

通过主机递归下一跳

选项

  • false

  • true

redistribute_internal

布尔值

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

选项

  • false

  • true

refresh

字典

refresh

max_eor_time

整数

配置刷新最大 EOR 时间

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

stalepath_time

整数

配置刷新过时路径时间

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

regexp

布尔值

选择正则表达式引擎

启用有界执行时间正则表达式引擎

选项

  • false

  • true

route_map

布尔值

route-map 控制命令

使路由映射设置命令优先于 BGP 命令(例如下一跳不变)

选项

  • false

  • true

router_id

字典

覆盖配置的路由器标识符(对等体将重置)

address

字符串

手动配置的路由器标识符(A.B.C.D)

interface

字符串

使用接口上的 IPv4 地址

vrf

布尔值

vrf 特定的路由器 ID 配置

自动分配每个 vrf 的 bgp 路由器 ID

选项

  • false

  • true

scan_time

整数

配置后台扫描器间隔

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

slow_peer

字典

配置慢速对等体

detection

字典

慢速对等体检测

set

布尔值

慢速对等体检测

选项

  • false

  • true

threshold

整数

设置慢速对等体检测阈值

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

split_update_group

字典

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

dynamic

布尔值

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

选项

  • false

  • true

permanent

布尔值

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

选项

  • false

  • true

snmp

布尔值

BGP SNMP 选项

BGP SNMP 陷阱选项

使用 cbgp Peer2Type 作为陷阱索引的一部分

选项

  • false

  • true

soft_reconfig_backup

布尔值

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

选项

  • false

  • true

sso

布尔值

状态切换

仅对支持路由刷新的对等体启用 SSO

选项

  • false

  • true

suppress_inactive

布尔值

禁止路由表中不存在的路由

选项

  • false

  • true

transport

布尔值

全局启用/禁用传输会话参数

传输路径 MTU 发现

选项

  • false

  • true

update_delay

整数

设置发送更新的最大初始延迟

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

update_group

布尔值

管理 bgp 更新组中的对等体

根据策略拆分更新组

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

选项

  • false

  • true

upgrade_cli

字典

升级到分层 AFI 模式

af_mode

布尔值

升级到 AFI 模式

选项

  • false

  • true

set

布尔值

启用升级到分层 AFI 模式

选项

  • false

  • true

bmp

字典

BGP 监控协议

buffer_size

整数

BMP 缓冲区大小

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

initial_refresh

字典

初始刷新选项

delay

整数

初始刷新之前的延迟

skip

布尔值

跳过所有刷新

选项

  • false

  • true

server

整数

服务器信息

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

server_options

字典

bmp 服务器选项

activate

布尔值

激活服务器

选项

  • false

  • true

address

字典

跳过所有刷新

host

字符串

主机地址

port

整数

BMP 服务器的端口号

default_information

布尔值

控制默认信息的分配

分配默认路由

选项

  • false

  • true

default_metric

整数

设置重新分配的路由的度量值

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

distance

字典

定义管理距离

admin

字典

管理距离

acl

字符串

IP 标准访问列表编号

IP 标准扩展访问列表编号

标准访问列表名称

address

字符串

IP 源地址 (A.B.C.D)

distance

整数

管理距离

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

wildcard_bit

字符串

通配符位 (A.B.C.D)

bgp

字典

BGP 距离

routes_external

整数

AS 外部路由的距离

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

routes_internal

整数

AS 内部路由的距离

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

routes_local

整数

本地路由的距离

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

mbgp

字典

MBGP 距离

routes_external

整数

AS 外部路由的距离

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

routes_internal

整数

AS 内部路由的距离

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

routes_local

整数

本地路由的距离

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

distributes

列表 / 元素=字典

过滤路由更新中的网络

acl

字符串

IP 访问列表编号/名称

gateway

字符串

过滤路由更新中的前缀

in

布尔值

过滤传入的路由更新

选项

  • false

  • true

interface

字符串

接口详细信息

out

布尔值

过滤传出的路由更新

选项

  • false

  • true

prefix

字符串

根据网关过滤传入的更新

maximum_paths

字典

通过多条路径转发数据包

eibgp

整数

将 eBGP 和 iBGP 路径都作为多路径

ibgp

整数

iBGP 多路径

paths

整数

路径数

maximum_secondary_paths

字典

最大辅助路径数

eibgp

整数

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

ibgp

整数

iBGP-secondary-multipath

paths

整数

辅助路径数

neighbors

别名:neighbor

列表 / 元素=字典

指定邻居路由器

activate

布尔值

为此邻居启用地址族

选项

  • false

  • true

additional_paths

字典

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

disable

布尔值

为此邻居禁用附加路径

选项

  • false

  • true

receive

布尔值

从邻居接收其他路径

选项

  • false

  • true

send

布尔值

向邻居发送其他路径

选项

  • false

  • true

advertise

字典

向此邻居通告

additional_paths

字典

通告附加路径

all

布尔值

选择所有可用路径

选项

  • false

  • true

best

整数

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

group_best

布尔值

选择组最佳路径

选项

  • false

  • true

best_external

布尔值

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

选项

  • false

  • true

diverse_path

字典

通告附加路径

backup

布尔值

不同的路径可以是备份路径

选项

  • false

  • true

mpath

布尔值

不同的路径可以是多路径

选项

  • false

  • true

advertise_map

字典

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

exist_map

字符串

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

条件路由映射名称

name

字符串

通告路由映射名称

non_exist_map

字符串

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

条件路由映射名称

advertisement_interval

整数

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

aigp

字典

邻居上的 AIGP

enable

布尔值

启用 AIGP

选项

  • false

  • true

send

字典

携带 AIGP VALUE 的成本社团或 MED

cost_community

字典

携带 AIGP 值的成本扩展社团

id

整数

社团 ID

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

poi

字典

插入点

igp_cost

布尔值

IGP 后的插入点

选项

  • false

  • true

pre_bestpath

布尔值

在开始时的插入点

选项

  • false

  • true

transitive

布尔值

成本社团是可传递的

选项

  • false

  • true

med

布尔值

携带 AIGP 值的 Med

选项

  • false

  • true

allow_policy

布尔值

为此 IBGP 邻居启用策略支持

选项

  • false

  • true

allowas_in

整数

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

as_override

布尔值

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

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

选项

  • false

  • true

bmp_activate

字典

为 BGP 对等体激活 BMP 监控

all

布尔值

为所有服务器激活 BMP 监控

选项

  • false

  • true

server

整数

为服务器激活 BMP

BMP 服务器编号

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

capability

字典

向对等体通告功能

向对等体通告 ORF 功能

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

both

布尔值

向/从该邻居发送和接收 ORF 的功能

选项

  • false

  • true

receive

布尔值

从该邻居接收 ORF 的功能

选项

  • false

  • true

send

布尔值

向该邻居发送 ORF 的功能

选项

  • false

  • true

cluster_id

字符串

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

路由反射器群集 ID 为 32 位值,或路由反射器群集 ID 为 IP 地址格式 (A.B.C.D)

default_originate

字典

向此邻居发起默认路由

route_map

字符串

指定发起默认路由条件的路由映射

set

布尔值

向此邻居发起默认路由

选项

  • false

  • true

description

字符串

邻居特定描述

disable_connected_check

布尔值

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

选项

  • false

  • true

distribute_list

字典

过滤与此邻居之间来往的更新

acl

字符串

IP 访问列表编号/名称

in

布尔值

过滤传入的更新

选项

  • false

  • true

out

布尔值

过滤传出的更新

选项

  • false

  • true

布尔值

传播 DMZ 链路带宽

选项

  • false

  • true

ebgp_multihop

字典

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

enable

布尔值

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

选项

  • false

  • true

hop_count

整数

最大跳数

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

fall_over

字典

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

bfd

字典

使用 BFD 检测故障

multi_hop

布尔值

强制 BFD 多跳检测故障

选项

  • false

  • true

set

布尔值

设置 bfd

选项

  • false

  • true

single_hop

布尔值

强制 BFD 单跳检测故障

选项

  • false

  • true

route_map

字符串

对等路由的路由映射

filter_list

字典

建立 BGP 过滤器

in

布尔值

过滤传入的更新

选项

  • false

  • true

out

布尔值

过滤传出的更新

选项

  • false

  • true

path_acl

字符串

AS 路径访问列表

ha_mode

字典

高可用性模式

disable

布尔值

禁用平滑重启

选项

  • false

  • true

set

布尔值

为此对等体设置 ha-mode 和平滑重启

选项

  • false

  • true

inherit

字符串

继承模板

继承对等会话模板和模板名称

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

字典

从此对等体接受的最大前缀数

max_no

整数

最大前缀限制数

restart

整数

超出限制后重启 BGP 连接

threshold_val

整数

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

warning_only

布尔值

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

选项

  • false

  • true

neighbor_address

字符串

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

邻居标签

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

next_hop_self

字典

禁用此邻居的下一跳计算

all

布尔值

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

选项

  • false

  • true

set

布尔值

启用下一跳自

选项

  • false

  • true

next_hop_unchanged

字典

为此邻居传播 iBGP 路径的下一跳不变

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

allpaths

布尔值

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

选项

  • 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

字符串

对等组的成员

remote_as

字符串

指定 BGP 邻居

远程邻居的 AS

remove_private_as

字典

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

all

布尔值

删除所有私有 AS 号

选项

  • false

  • true

replace_as

布尔值

将所有私有 AS 号替换为本地 AS

选项

  • false

  • true

set

布尔值

删除私有 AS 号

选项

  • false

  • true

route_maps

列表 / 元素=字典

将路由映射列表应用于邻居

in

布尔值

将映射应用于传入路由

选项

  • false

  • true

name

字符串

将所有私有 AS 号替换为本地 AS

out

布尔值

将映射应用于传出路由

选项

  • false

  • true

route_reflector_client

布尔值

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

选项

  • false

  • true

route_server_client

字典

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

context

字符串

为邻居指定路由服务器上下文

路由服务器上下文名称

set

布尔值

设置路由服务器客户端

选项

  • false

  • true

send_community

字典

将 Community 属性发送到此邻居

both

布尔值

发送标准和扩展 Community 属性

选项

  • false

  • true

extended

布尔值

发送扩展 Community 属性

选项

  • false

  • true

set

布尔值

设置发送到此邻居的 Community 属性

选项

  • false

  • true

standard

布尔值

发送标准 Community 属性

选项

  • false

  • true

send_label

字典

将 NLRI + MPLS 标签发送到此对等体

explicit_null

布尔值

通告显式 Null 标签代替隐式 Null

选项

  • false

  • true

set

布尔值

设置将 NLRI + MPLS 标签发送到此对等体

选项

  • false

  • true

shutdown

字典

管理性关闭此邻居

community

整数

为 Gshut 路由设置 Community

graceful

整数

平滑关闭此邻居

以秒为单位的时间

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

local_preference

布尔值

为 Gshut 路由设置本地首选项

选项

  • false

  • true

set

布尔值

关闭

选项

  • false

  • true

slow_peer

字典

配置慢速对等体

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

timers

字典

BGP 每个邻居计时器

holdtime

整数

保持时间

interval

整数

保活间隔

min_holdtime

整数

来自邻居的最小保持时间

translate_update

字典

将更新转换为 MBGP 格式

nlri

字典

指定要转换到的 nlri 类型

multicast

布尔值

将更新转换为组播 nlri

选项

  • false

  • true

unicast

布尔值

将更新处理为单播 nlri

选项

  • false

  • true

set

布尔值

设置转换更新

选项

  • false

  • true

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

字符串

路由映射,用于有选择地取消抑制被抑制的路由

路由映射的名称

update_source

字符串

路由更新的源

version

整数

设置 BGP 版本以匹配邻居

邻居的 BGP 版本

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

weight

整数

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

networks

列表 / 元素=字典

指定要通过 BGP 公告的网络

address

字符串

指定网络地址

backdoor

布尔值

指定 BGP 后门路由

选项

  • false

  • true

netmask

字符串

指定网络掩码

route_map

字符串

用于修改属性的路由映射

redistribute

列表 / 元素=字典

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

application

字典

应用

metric

整数

重新分配路由的指标

name

字符串

应用程序名称

route_map

字符串

路由映射引用

bgp

字典

边界网关协议 (BGP)

as_number

字符串

自治系统号

metric

整数

重新分配路由的指标

route_map

字符串

路由映射引用

connected

字典

已连接

metric

整数

重新分配路由的指标

route_map

字符串

路由映射引用

set

布尔值

设置顶级属性

选项

  • false

  • true

eigrp

字典

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

as_number

字符串

自治系统号

metric

整数

重新分配路由的指标

route_map

字符串

路由映射引用

isis

字典

ISO IS-IS

area_tag

字符串

ISO 路由区域标记

clns

布尔值

OSI 动态路由的重新分配

选项

  • false

  • true

ip

布尔值

IP 动态路由的重新分配

选项

  • false

  • true

metric

整数

重新分配路由的指标

route_map

字符串

路由映射引用

iso_igrp

字典

用于 OSI 网络的 IGRP

area_tag

字符串

ISO 路由区域标记

route_map

字符串

路由映射引用

lisp

字典

定位符 ID 分离协议 (LISP)

metric

整数

重新分配路由的指标

route_map

字符串

路由映射引用

set

布尔值

设置顶级属性

选项

  • false

  • true

mobile

字典

移动路由

metric

整数

重新分配路由的指标

route_map

字符串

路由映射引用

set

布尔值

设置顶级属性

选项

  • false

  • true

odr

字典

按需存根路由

metric

整数

重新分配路由的指标

route_map

字符串

路由映射引用

set

布尔值

设置顶级属性

选项

  • false

  • true

ospf

字典

开放最短路径优先 (OSPF)

match

字典

按需存根路由

external

布尔值

重新分配 OSPF 外部路由

选项

  • false

  • true

internal

布尔值

重新分配 OSPF 内部路由

选项

  • false

  • true

nssa_external

布尔值

重新分配 OSPF NSSA 外部路由

选项

  • false

  • true

type_1

布尔值

重新分配 NSSA 外部 1 类路由

选项

  • false

  • true

type_2

布尔值

重新分配 NSSA 外部 2 类路由

选项

  • false

  • true

metric

整数

重新分配路由的指标

process_id

整数

进程 ID

route_map

字符串

路由映射引用

vrf

字符串

VPN 路由/转发实例

ospfv3

字典

OSPFv3

match

字典

按需存根路由

external

布尔值

重新分配 OSPF 外部路由

选项

  • false

  • true

internal

布尔值

重新分配 OSPF 内部路由

选项

  • false

  • true

nssa_external

布尔值

重新分配 OSPF NSSA 外部路由

选项

  • false

  • true

type_1

布尔值

重新分配 NSSA 外部 1 类路由

选项

  • false

  • true

type_2

布尔值

重新分配 NSSA 外部 2 类路由

选项

  • false

  • true

metric

整数

重新分配路由的指标

process_id

整数

进程 ID

route_map

字符串

路由映射引用

rip

字典

路由信息协议 (RIP)

metric

整数

重新分配路由的指标

route_map

字符串

路由映射引用

set

布尔值

设置顶级属性

选项

  • false

  • true

static

字典

静态路由

clns

布尔值

OSI 静态路由的重新分配

选项

  • false

  • true

ip

布尔值

IP 静态路由的重新分配

选项

  • false

  • true

metric

整数

重新分配路由的指标

route_map

字符串

路由映射引用

set

布尔值

设置顶级属性

选项

  • false

  • true

vrf

字典

指定源 VRF

global

布尔值

全局 VRF

选项

  • false

  • true

name

字符串

源 VRF 名称

synchronization

布尔值

执行 IGP 同步

选项

  • false

  • true

table_map

字典

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

filter

布尔值

选择性路由下载

选项

  • false

  • true

name

字符串

路由图名称

template

字典

进入模板命令模式

peer_policy

字符串

用于策略参数的模板配置

peer_session

字符串

用于会话参数的模板配置

timers

字典

调整路由计时器

BGP 计时器

holdtime

整数

保持时间

keepalive

整数

保活间隔

min_holdtime

整数

来自邻居的最小保持时间

running_config

字符串

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

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

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

state

字符串

配置应保留的状态

对于 replaced 和 overridden 状态,该模块具有声明性类似的行为。

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

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

状态 gathered 将从设备获取正在运行的配置,并根据资源模块 argspec 将其转换为结构化数据,并且该值将在结果中的 gathered 键中返回。

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

选项

  • "merged" ← (默认)

  • "replaced"

  • "overridden"

  • "deleted"

  • "purged"

  • "gathered"

  • "rendered"

  • "parsed"

Notes

注意

Examples

# Using merged

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp

- name: Merge provided configuration with device configuration
  cisco.ios.ios_bgp_global:
    config:
      as_number: 65000
      bgp:
        advertise_best_external: true
        bestpath:
          - compare_routerid: true
        dampening:
          penalty_half_time: 1
          reuse_route_val: 1
          suppress_route_val: 1
          max_suppress: 1
        default:
          ipv4_unicast: false
          route_target:
            filter: true
        graceful_shutdown:
          neighbors:
            time: 50
          community: 100
          local_preference: 100
        log_neighbor_changes: true
        nopeerup_delay:
          - post_boot: 10
      networks:
        - address: 192.0.2.3
        - address: 192.0.2.2
      neighbor:
        - address: 192.0.2.1
          description: merge neighbor
          remote_as: 100
          aigp:
            send:
              cost_community:
                id: 100
                poi:
                  igp_cost: true
                  transitive: true
          route_map:
            name: test-route
            out: true
      redistribute:
        - connected:
            metric: 10
      timers:
        keepalive: 100
        holdtime: 200
        min_holdtime: 150
    state: merged

# Task Output:
# ------------
#
# before: {}
# commands:
# - router bgp 65000
# - timers bgp 100 200 150
# - bgp advertise-best-external
# - bgp bestpath compare-routerid
# - no bgp default ipv4-unicast
# - bgp dampening 1 1 1 1
# - bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# - bgp log-neighbor-changes
# - bgp nopeerup-delay post-boot 10
# - network 192.0.2.3
# - network 192.0.2.2
# - neighbor 192.0.2.1 remote-as 100
# - neighbor 192.0.2.1 description merge neighbor
# - neighbor 192.0.2.1 aigp send cost-community 100 poi igp-cost transitive
# - neighbor 192.0.2.1 route-map test-route out
# - redistribute connected metric 10
# after:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       compare_routerid: true
#     dampening:
#       max_suppress: 1
#       penalty_half_time: 1
#       reuse_route_val: 1
#       suppress_route_val: 1
#     default:
#       ipv4_unicast: false
#       route_target:
#         filter: true
#     graceful_shutdown:
#       community: '100'
#       local_preference: 100
#       neighbors:
#         time: 50
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       post_boot: 10
#   neighbors:
#   - aigp:
#       send:
#         cost_community:
#           id: 100
#           poi:
#             igp_cost: true
#             transitive: true
#     description: merge neighbor
#     neighbor_address: 192.0.2.1
#     remote_as: '100'
#     route_maps:
#     - name: test-route
#       out: true
#   networks:
#   - address: 192.0.2.2
#   - address: 192.0.2.3
#   redistribute:
#   - connected:
#       metric: 10
#       set: true
#   timers:
#     holdtime: 200
#     keepalive: 100
#     min_holdtime: 150

# After state:
# ------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  no bgp default ipv4-unicast
#  bgp log-neighbor-changes
#  bgp nopeerup-delay post-boot 10
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  bgp bestpath compare-routerid
#  bgp dampening 1 1 1 1
#  bgp advertise-best-external
#  network 192.0.2.2
#  network 192.0.2.3
#  timers bgp 100 200 150
#  redistribute connected metric 10
#  neighbor 192.0.2.1 remote-as 100
#  neighbor 192.0.2.1 description merge neighbor
#  neighbor 192.0.2.1 aigp send cost-community 100 poi igp-cost transitive
#  neighbor 192.0.2.1 route-map test-route out

# Using replaced

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp nopeerup-delay post-boot 10
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  bgp bestpath compare-routerid
#  bgp dampening 1 1 1 1
#  network 192.0.2.2
#  network 192.0.2.3
#  bgp advertise-best-external
#  neighbor 198.0.2.1 remote-as 100
#  neighbor 198.0.2.1 description merge neighbor
#  neighbor 198.0.2.1 aigp send cost-community 100 poi igp-cost transitive
#  neighbor 198.0.2.1 route-map test-route out

- name: Replaces device configuration of listed global BGP with provided configuration
  cisco.ios.ios_bgp_global:
    config:
      as_number: 65000
      bgp:
        advertise_best_external: true
        bestpath:
          - med:
              confed: true
        log_neighbor_changes: true
        nopeerup_delay:
          - post_boot: 10
            cold_boot: 20
      networks:
        - address: 192.0.2.4
      neighbor:
        - address: 192.0.2.5
          description: replace neighbor
          remote_as: 100
          slow_peer:
            detection:
              disable: true
    state: replaced

# Task Output:
# ------------
#
# before:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       compare_routerid: true
#     dampening:
#       max_suppress: 1
#       penalty_half_time: 1
#       reuse_route_val: 1
#       suppress_route_val: 1
#     default:
#       ipv4_unicast: true
#       route_target:
#         filter: true
#     graceful_shutdown:
#       community: '100'
#       local_preference: 100
#       neighbors:
#         time: 50
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       post_boot: 10
#   neighbors:
#   - aigp:
#       send:
#         cost_community:
#           id: 100
#           poi:
#             igp_cost: true
#             transitive: true
#     description: merge neighbor
#     neighbor_address: 198.0.2.1
#     remote_as: '100'
#     route_maps:
#     - name: test-route
#       out: true
#   networks:
#   - address: 192.0.2.2
#   - address: 192.0.2.3
#
# commands:
# - router bgp 65000
# - no bgp bestpath compare-routerid
# - bgp bestpath med confed
# - no bgp dampening 1 1 1 1
# - no bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# - bgp nopeerup-delay cold-boot 20
# - network 192.0.2.4
# - no network 192.0.2.2
# - no network 192.0.2.3
# - neighbor 192.0.2.5 remote-as 100
# - neighbor 192.0.2.5 description replace neighbor
# - neighbor 192.0.2.5 slow-peer detection disable
# - no neighbor 198.0.2.1
# after:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       med:
#         confed: true
#     default:
#       ipv4_unicast: true
#       route_target:
#         filter: true
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       cold_boot: 20
#       post_boot: 10
#   neighbors:
#   - description: replace neighbor
#     neighbor_address: 192.0.2.5
#     remote_as: '100'
#     slow_peer:
#       detection:
#         disable: true
#   networks:
#   - address: 192.0.2.4

# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20
#  bgp nopeerup-delay post-boot 10
#  bgp bestpath med confed
#  bgp advertise-best-external
#  network 192.0.2.4
#  neighbor 192.0.2.5 remote-as 100
#  neighbor 192.0.2.5 description replace neighbor
#  neighbor 192.0.2.5 slow-peer detection disable

# Using Deleted

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp nopeerup-delay post-boot 10
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  bgp bestpath compare-routerid
#  bgp dampening 1 1 1 1
#  bgp advertise-best-external
#  neighbor 192.0.2.1 remote-as 100
#  neighbor 192.0.2.1 description merge neighbor
#  neighbor 192.0.2.1 aigp send cost-community 100 poi igp-cost transitive
#  neighbor 192.0.2.1 route-map test-route out

- name: "Delete global BGP (Note: This won't delete the configured global BGP)"
  cisco.ios.ios_bgp_global:
    config:
      as_number: 65000
    state: deleted

# Task Output:
# ------------
#
# before:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       compare_routerid: true
#     dampening:
#       max_suppress: 1
#       penalty_half_time: 1
#       reuse_route_val: 1
#       suppress_route_val: 1
#     default:
#       ipv4_unicast: true
#       route_target:
#         filter: true
#     graceful_shutdown:
#       community: '100'
#       local_preference: 100
#       neighbors:
#         time: 50
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       post_boot: 10
#   neighbors:
#   - aigp:
#       send:
#         cost_community:
#           id: 100
#           poi:
#             igp_cost: true
#             transitive: true
#     description: merge neighbor
#     neighbor_address: 192.0.2.1
#     remote_as: '100'
#     route_maps:
#     - name: test-route
#       out: true
# commands:
# - router bgp 65000
# - no bgp advertise-best-external
# - no bgp bestpath compare-routerid
# - no bgp dampening 1 1 1 1
# - no bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# - no bgp log-neighbor-changes
# - no bgp nopeerup-delay post-boot 10
# - no neighbor 192.0.2.1
# after:
#   as_number: '65000'

# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000

# Using Deleted without any config passed

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp nopeerup-delay post-boot 10
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  bgp bestpath compare-routerid
#  bgp dampening 1 1 1 1
#  bgp advertise-best-external
#  neighbor 192.0.2.1 remote-as 100
#  neighbor 192.0.2.1 description merge neighbor
#  neighbor 192.0.2.1 aigp send cost-community 100 poi igp-cost transitive
#  neighbor 192.0.2.1 route-map test-route out

- name: Delete global BGP without config
  cisco.ios.ios_bgp_global:
    state: deleted

# Task Output:
# ------------
#
# before:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       compare_routerid: true
#     dampening:
#       max_suppress: 1
#       penalty_half_time: 1
#       reuse_route_val: 1
#       suppress_route_val: 1
#     default:
#       ipv4_unicast: true
#       route_target:
#         filter: true
#     graceful_shutdown:
#       community: '100'
#       local_preference: 100
#       neighbors:
#         time: 50
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       post_boot: 10
#   neighbors:
#   - aigp:
#       send:
#         cost_community:
#           id: 100
#           poi:
#             igp_cost: true
#             transitive: true
#     description: merge neighbor
#     neighbor_address: 192.0.2.1
#     remote_as: '100'
#     route_maps:
#     - name: test-route
#       out: true
# commands:
# - router bgp 65000
# - no bgp advertise-best-external
# - no bgp bestpath compare-routerid
# - no bgp dampening 1 1 1 1
# - no bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# - no bgp nopeerup-delay post-boot 10
# - no neighbor 198.51.100.1
# after:
#   as_number: '65000'

# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000

# Using purged - would delete all configuration

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp nopeerup-delay post-boot 10
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  bgp bestpath compare-routerid
#  bgp dampening 1 1 1 1
#  bgp advertise-best-external
#  neighbor 192.0.2.1 remote-as 100
#  neighbor 192.0.2.1 description merge neighbor
#  neighbor 192.0.2.1 aigp send cost-community 100 poi igp-cost transitive
#  neighbor 192.0.2.1 route-map test-route out

- name:
    "Delete the configured global BGP (Note: This WILL delete the the configured
    global BGP)"
  cisco.ios.ios_bgp_global:
    state: purged

# Task Output:
# ------------
#
# before:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       compare_routerid: true
#     default:
#       ipv4_unicast: true
#       route_target:
#         filter: true
#     dampening:
#       max_suppress: 1
#       penalty_half_time: 1
#       reuse_route_val: 1
#       suppress_route_val: 1
#     graceful_shutdown:
#       community: '100'
#       local_preference: 100
#       neighbors:
#         time: 50
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       post_boot: 10
#   neighbors:
#   - aigp:
#       send:
#         cost_community:
#           id: 100
#           poi:
#             igp_cost: true
#             transitive: true
#     description: merge neighbor
#     neighbor_address: 192.0.2.1
#     remote_as: '100'
#     route_maps:
#     - name: test-route
#       out: true
# commands:
#  - no router bgp 65000
# after: {}

# After state:
# -------------
#
# vios#sh running-config | section ^router bgp

# Using gathered

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay post-boot 10
#  bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
#  bgp bestpath compare-routerid
#  bgp dampening 1 1 1 1
#  bgp advertise-best-external
#  network 192.0.2.3
#  timers bgp 100 200 150
#  redistribute connected metric 10
#  neighbor 192.0.2.1 remote-as 100
#  neighbor 192.0.2.1 description merge neighbor
#  neighbor 192.0.2.1 aigp send cost-community 100 poi igp-cost transitive
#  neighbor 192.0.2.1 route-map test-route out

- name: Gather facts for bgp_global
  cisco.ios.ios_bgp_global:
    config:
    state: gathered

# Task Output:
# ------------
#
# gathered:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       compare_routerid: true
#     dampening:
#       max_suppress: 1
#       penalty_half_time: 1
#       reuse_route_val: 1
#       suppress_route_val: 1
#     default:
#       ipv4_unicast: true
#       route_target:
#         filter: true
#     graceful_shutdown:
#       community: '100'
#       local_preference: 100
#       neighbors:
#         time: 50
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       post_boot: 10
#   neighbors:
#   - aigp:
#       send:
#         cost_community:
#           id: 100
#           poi:
#             igp_cost: true
#             transitive: true
#     description: merge neighbor
#     neighbor_address: 192.0.2.1
#     remote_as: '100'
#     route_maps:
#     - name: test-route
#       out: true
#   networks:
#   - address: 192.0.2.3
#   redistribute:
#   - connected:
#       metric: 10
#       set: true
#   timers:
#     holdtime: 200
#     keepalive: 100
#     min_holdtime: 150

# Using Rendered

- name: Rendered the provided configuration with the existing running configuration
  cisco.ios.ios_bgp_global:
    config:
      aggregate_addresses:
        - address: 192.0.2.1
          attribute_map: testMap1
          netmask: 255.255.255.0
          summary_only: true
        - address: 192.0.2.2
          as_set: true
          netmask: 255.255.255.0
        - address: 192.0.2.3
          as_set: true
          netmask: 255.255.255.0
      as_number: "65000"
      auto_summary: true
      bgp:
        additional_paths:
          install: true
          receive: true
        aggregate_timer: 0
        always_compare_med: true
        asnotation: true
        bestpath_options:
          aigp: true
          compare_routerid: true
          med:
            confed: true
            missing_as_worst: true
        confederation:
          identifier: "22"
        consistency_checker:
          error_message:
            interval: 10
            set: true
        dampening:
          route_map: routeMap1Test
        deterministic_med: true
        graceful_restart:
          restart_time: 2
          stalepath_time: 22
        graceful_shutdown:
          community: "77"
          local_preference: 230
          vrfs:
            time: 31
        inject_maps:
          - copy_attributes: true
            exist_map_name: Testmap3
            name: map2
          - copy_attributes: true
            exist_map_name: Testmap2
            name: map1
        listen:
          limit: 200
          range:
            host_with_subnet: 192.0.2.1/24
            peer_group: PaulNetworkGroup
        log_neighbor_changes: true
        maxas_limit: 2
        maxcommunity_limit: 3
        maxextcommunity_limit: 3
        nexthop:
          route_map: RouteMap1
          trigger:
            delay: 2
        nopeerup_delay_options:
          cold_boot: 2
          nsf_switchover: 10
          post_boot: 22
          user_initiated: 22
        recursion: true
        redistribute_internal: true
        refresh:
          max_eor_time: 700
          stalepath_time: 800
        router_id:
          vrf: true
        scan_time: 22
        slow_peer:
          detection:
            threshold: 345
          split_update_group:
            dynamic: true
            permanent: true
        sso: true
        suppress_inactive: true
        update_delay: 2
        update_group: true
      bmp:
        buffer_size: 22
        server: 2
      distance:
        bgp:
          routes_external: 2
          routes_internal: 3
          routes_local: 4
        mbgp:
          routes_external: 2
          routes_internal: 3
          routes_local: 5
      distributes:
        - in: true
          prefix: prefixTest
        - gateway: gatewayTest
          out: true
        - acl: "300"
          interface: Loopback0
          out: true
      maximum_paths:
        ibgp: 2
        paths: 2
      maximum_secondary_paths:
        ibgp: 22
        paths: 22
      neighbors:
        - neighbor_address: 192.0.2.10
          remote_as: "64500"
          update_source: Loopback1
        - activate: true
          neighbor_address: 192.0.2.11
          remote_as: "45000"
          send_community:
            extended: true
        - activate: true
          neighbor_address: 192.0.2.12
          remote_as: "45000"
        - neighbor_address: 192.0.2.13
          remote_as: "6553601"
        - advertise:
            diverse_path:
              backup: true
          neighbor_address: 192.0.2.8
          route_reflector_client: true
        - neighbor_address: 192.0.2.9
          remote_as: "64500"
          route_maps:
            - in: true
              name: rmp1
            - in: true
              name: rmp2
          update_source: Loopback0
        - activate: true
          advertise:
            additional_paths:
              group_best: true
          neighbor_address: 2001:DB8::1037
        - neighbor_address: testNebTag
          peer_group: "5"
          soft_reconfiguration: true
          version: 4
      networks:
        - address: 192.0.2.15
          backdoor: true
          netmask: 55.255.255.0
          route_map: mp1
        - address: 192.0.2.16
          backdoor: true
          netmask: 255.255.255.0
          route_map: mp2
        - address: 192.0.2.17
          backdoor: true
          netmask: 255.255.255.0
          route_map: mp2
      redistribute:
        - static:
            metric: 33
            route_map: rmp1
            set: true
        - application:
            metric: 22
            name: app1
        - application:
            metric: 33
            name: app2
            route_map: mp1
        - connected:
            metric: 22
            set: true
        - mobile:
            metric: 211
            set: true
    state: rendered

# Task Output:
# ------------
#
# rendered:
# - router bgp 65000
# - auto-summary
# - bmp buffer-size 22
# - bmp server 2
# - distance bgp 2 3 4
# - distance mbgp 2 3 5
# - maximum-paths 2
# - maximum-paths ibgp 2
# - maximum-secondary-paths 22
# - maximum-secondary-paths ibgp 22
# - bgp additional-paths install receive
# - bgp aggregate-timer 0
# - bgp always-compare-med
# - bgp asnotation dot
# - bgp bestpath aigp ignore
# - bgp bestpath compare-routerid
# - bgp bestpath med confed missing-as-worst
# - bgp confederation identifier 22
# - bgp consistency-checker error-message interval 10
# - bgp dampening route-map routeMap1Test
# - bgp deterministic-med
# - bgp graceful-restart restart-time 2
# - bgp graceful-restart stalepath-time 22
# - bgp graceful-shutdown all vrfs 31 local-preference 230 community 77
# - bgp listen limit 200
# - bgp listen range 192.0.2.1/24 peer-group PaulNetworkGroup
# - bgp log-neighbor-changes
# - bgp maxas-limit 2
# - bgp maxcommunity-limit 3
# - bgp maxextcommunity-limit 3
# - bgp nexthop route-map RouteMap1
# - bgp nexthop trigger delay 2
# - bgp nopeerup-delay cold-boot 2
# - bgp nopeerup-delay post-boot 22
# - bgp nopeerup-delay nsf-switchover 10
# - bgp nopeerup-delay user-initiated 22
# - bgp recursion host
# - bgp redistribute-internal
# - bgp refresh max-eor-time 700
# - bgp refresh stalepath-time 800
# - bgp router-id vrf auto-assign
# - bgp scan-time 22
# - bgp slow-peer detection threshold 345
# - bgp slow-peer split-update-group dynamic permanent
# - bgp sso route-refresh-enable
# - bgp suppress-inactive
# - bgp update-delay 2
# - bgp update-group split as-override
# - bgp inject-map map2 exist-map Testmap3 copy-attributes
# - bgp inject-map map1 exist-map Testmap2 copy-attributes
# - distribute-list prefix prefixTest in
# - distribute-list gateway gatewayTest out
# - distribute-list 300 out Loopback0
# - aggregate-address 192.0.2.1 255.255.255.0 summary-only attribute-map testMap1
# - aggregate-address 192.0.2.2 255.255.255.0 as-set
# - aggregate-address 192.0.2.3 255.255.255.0 as-set
# - network 192.0.2.15 mask 55.255.255.0 route-map mp1 backdoor
# - network 192.0.2.16 mask 255.255.255.0 route-map mp2 backdoor
# - network 192.0.2.17 mask 255.255.255.0 route-map mp2 backdoor
# - neighbor 192.0.2.10 remote-as 64500
# - neighbor 192.0.2.10 update-source Loopback1
# - neighbor 192.0.2.11 remote-as 45000
# - neighbor 192.0.2.11 activate
# - neighbor 192.0.2.11 send-community extended
# - neighbor 192.0.2.12 remote-as 45000
# - neighbor 192.0.2.12 activate
# - neighbor 192.0.2.13 remote-as 6553601
# - neighbor 192.0.2.8 advertise diverse-path backup
# - neighbor 192.0.2.8 route-reflector-client
# - neighbor 192.0.2.9 remote-as 64500
# - neighbor 192.0.2.9 update-source Loopback0
# - neighbor 192.0.2.9 route-map rmp1 in
# - neighbor 192.0.2.9 route-map rmp2 in
# - neighbor 2001:DB8::1037 activate
# - neighbor 2001:DB8::1037 advertise additional-paths group-best
# - neighbor testNebTag peer-group 5
# - neighbor testNebTag soft-reconfiguration inbound
# - neighbor testNebTag version 4
# - redistribute static metric 33 route-map rmp1
# - redistribute application app1 metric 22
# - redistribute application app2 metric 33 route-map mp1
# - redistribute connected metric 22
# - redistribute mobile metric 211

# Using parsed

# File: parsed.cfg
# ----------------
#
# router bgp 65000
#  auto-summary
#  bmp buffer-size 22
#  bmp server 2
#  distance bgp 2 3 4
#  distance mbgp 2 3 5
#  maximum-paths 2
#  maximum-paths ibgp 2
#  maximum-secondary-paths 22
#  maximum-secondary-paths ibgp 22
#  description checking description as line
#  bgp additional-paths install receive
#  bgp aggregate-timer 0
#  bgp always-compare-med
#  bgp asnotation dot
#  bgp bestpath aigp ignore
#  bgp bestpath compare-routerid
#  bgp bestpath med confed missing-as-worst
#  bgp confederation identifier 22
#  bgp consistency-checker error-message interval 10
#  bgp dampening route-map routeMap1Test
#  bgp deterministic-med
#  bgp graceful-restart restart-time 2
#  bgp graceful-restart stalepath-time 22
#  bgp graceful-shutdown all vrfs 31 local-preference 230 community 77
#  bgp listen limit 200
#  bgp listen range 192.0.2.1/24 peer-group PaulNetworkGroup
#  bgp log-neighbor-changes
#  bgp maxas-limit 2
#  bgp maxcommunity-limit 3
#  bgp maxextcommunity-limit 3
#  bgp nexthop route-map RouteMap1
#  bgp nexthop trigger delay 2
#  bgp nopeerup-delay cold-boot 2
#  bgp nopeerup-delay post-boot 22
#  bgp nopeerup-delay nsf-switchover 10
#  bgp nopeerup-delay user-initiated 22
#  bgp recursion host
#  bgp redistribute-internal
#  bgp refresh max-eor-time 700
#  bgp refresh stalepath-time 800
#  bgp router-id vrf auto-assign
#  bgp scan-time 22
#  bgp slow-peer detection threshold 345
#  bgp slow-peer split-update-group dynamic permanent
#  bgp sso route-refresh-enable
#  bgp suppress-inactive
#  bgp update-delay 2
#  bgp update-group split as-override
#  bgp inject-map map2 exist-map Testmap3 copy-attributes
#  bgp inject-map map1 exist-map Testmap2 copy-attributes
#  distribute-list prefix prefixTest in
#  distribute-list gateway gatewayTest out
#  distribute-list 300 out Loopback0
#  aggregate-address 192.0.2.1 255.255.255.0 summary-only attribute-map testMap1
#  aggregate-address 192.0.2.2 255.255.255.0 as-set
#  aggregate-address 192.0.2.3 255.255.255.0 as-set
#  network 192.0.2.15 mask 55.255.255.0 route-map mp1 backdoor
#  network 192.0.2.16 mask 255.255.255.0 route-map mp2 backdoor
#  network 192.0.2.17 mask 255.255.255.0 route-map mp2 backdoor
#  neighbor 192.0.2.8 advertise diverse-path backup
#  neighbor 192.0.2.8 route-reflector-client
#  neighbor 192.0.2.9 remote-as 64500
#  neighbor 192.0.2.9 update-source Loopback0
#  neighbor 192.0.2.9 route-map rmp1 in
#  neighbor 192.0.2.9 route-map rmp2 in
#  neighbor 192.0.2.10 remote-as 64500
#  neighbor 192.0.2.10 update-source Loopback1
#  neighbor 192.0.2.11 remote-as 45000
#  neighbor 192.0.2.11 activate
#  neighbor 192.0.2.11 send-community extended
#  neighbor 192.0.2.12 remote-as 45000
#  neighbor 192.0.2.12 activate
#  neighbor 192.0.2.13 remote-as 6553601
#  neighbor 192.0.2.13 shutdown graceful 10 community 20
#  neighbor 2001:DB8::1037 activate
#  neighbor 2001:DB8::1037 advertise additional-paths group-best
#  neighbor testNebTag peer-group 5
#  neighbor testNebTag soft-reconfiguration inbound
#  neighbor testNebTag version 4
#  redistribute static metric 33 route-map rmp1
#  redistribute application app1 metric 22
#  redistribute application app2 metric 33 route-map mp1
#  redistribute connected metric 22
#  redistribute mobile metric 21

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

# Task Output:
# ------------
#
# parsed:
#     aggregate_addresses:
#     - address: 192.0.2.1
#       attribute_map: testMap1
#       netmask: 255.255.255.0
#       summary_only: true
#     - address: 192.0.2.2
#       as_set: true
#       netmask: 255.255.255.0
#     - address: 192.0.2.3
#       as_set: true
#       netmask: 255.255.255.0
#     as_number: '65000'
#     auto_summary: true
#     bgp:
#       additional_paths:
#         install: true
#         receive: true
#       aggregate_timer: 0
#       always_compare_med: true
#       asnotation: true
#       bestpath_options:
#         aigp: true
#         compare_routerid: true
#         med:
#           confed: true
#           missing_as_worst: true
#       confederation:
#         identifier: '22'
#       consistency_checker:
#         error_message:
#           interval: 10
#           set: true
#       dampening:
#         route_map: routeMap1Test
#       deterministic_med: true
#       graceful_restart:
#         restart_time: 2
#         stalepath_time: 22
#       graceful_shutdown:
#         community: '77'
#         local_preference: 230
#         vrfs:
#           time: 31
#       inject_maps:
#       - copy_attributes: true
#         exist_map_name: Testmap3
#         name: map2
#       - copy_attributes: true
#         exist_map_name: Testmap2
#         name: map1
#       listen:
#         limit: 200
#         range:
#           host_with_subnet: 192.0.2.1/24
#           peer_group: PaulNetworkGroup
#       log_neighbor_changes: true
#       maxas_limit: 2
#       maxcommunity_limit: 3
#       maxextcommunity_limit: 3
#       nexthop:
#         route_map: RouteMap1
#         trigger:
#           delay: 2
#       nopeerup_delay_options:
#         cold_boot: 2
#         nsf_switchover: 10
#         post_boot: 22
#         user_initiated: 22
#       recursion: true
#       redistribute_internal: true
#       refresh:
#         max_eor_time: 700
#         stalepath_time: 800
#       router_id:
#         vrf: true
#       scan_time: 22
#       slow_peer:
#         detection:
#           threshold: 345
#         split_update_group:
#           dynamic: true
#           permanent: true
#       sso: true
#       suppress_inactive: true
#       update_delay: 2
#       update_group: true
#     bmp:
#       buffer_size: 22
#       server: 2
#     distance:
#       bgp:
#         routes_external: 2
#         routes_internal: 3
#         routes_local: 4
#       mbgp:
#         routes_external: 2
#         routes_internal: 3
#         routes_local: 5
#     distributes:
#     - in: true
#       prefix: prefixTest
#     - gateway: gatewayTest
#       out: true
#     - acl: '300'
#       interface: Loopback0
#       out: true
#     maximum_paths:
#       ibgp: 2
#       paths: 2
#     maximum_secondary_paths:
#       ibgp: 22
#       paths: 22
#     neighbors:
#     - neighbor_address: 192.0.2.10
#       remote_as: '64500'
#       update_source: Loopback1
#     - activate: true
#       neighbor_address: 192.0.2.11
#       remote_as: '45000'
#       send_community:
#         extended: true
#     - activate: true
#       neighbor_address: 192.0.2.12
#       remote_as: '45000'
#     - neighbor_address: 192.0.2.13
#       remote_as: '6553601'
#     - advertise:
#         diverse_path:
#           backup: true
#       neighbor_address: 192.0.2.8
#       route_reflector_client: true
#     - neighbor_address: 192.0.2.9
#       remote_as: '64500'
#       route_maps:
#       - in: true
#         name: rmp1
#       - in: true
#         name: rmp2
#       update_source: Loopback0
#     - activate: true
#       advertise:
#         additional_paths:
#           group_best: true
#       neighbor_address: 2001:DB8::1037
#     - neighbor_address: testNebTag
#       peer_group: '5'
#       soft_reconfiguration: true
#       version: 4
#     networks:
#     - address: 192.0.2.15
#       backdoor: true
#       netmask: 55.255.255.0
#       route_map: mp1
#     - address: 192.0.2.16
#       backdoor: true
#       netmask: 255.255.255.0
#       route_map: mp2
#     - address: 192.0.2.17
#       backdoor: true
#       netmask: 255.255.255.0
#       route_map: mp2
#     redistribute:
#     - static:
#         metric: 33
#         route_map: rmp1
#         set: true
#     - application:
#         metric: 22
#         name: app1
#     - application:
#         metric: 33
#         name: app2
#         route_map: mp1
#     - connected:
#         metric: 22
#         set: true
#     - mobile:
#         metric: 21
#         set: true

Return Values

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

Key

描述

after

字典

模块执行后的结果配置。

Returned: when changed

Sample: "此 输出将始终与模块 argspec 的格式相同。\n"

before

字典

模块执行之前的配置。

返回:statemerged, replaced, overridden, deletedpurged 时返回

Sample: "此 输出将始终与模块 argspec 的格式相同。\n"

commands

列表 / 元素=字符串

推送到远程设备的命令集合。

返回:statemerged, replaced, overridden, deletedpurged 时返回

示例: ["router bgp 65000", "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive", "bgp graceful-shutdown all neighbors 50 local-preference 100 community 100"]

gathered

列表 / 元素=字符串

从远程设备收集的关于网络资源的结构化数据。

返回:stategathered 时返回

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

parsed

列表 / 元素=字符串

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

返回:stateparsed 时返回

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

rendered

列表 / 元素=字符串

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

返回:staterendered 时返回

示例: ["router bgp 65000", "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive", "bgp graceful-shutdown all neighbors 50 local-preference 100 community 100"]

作者

  • Sumit Jaiswal (@justjais)

  • Sagar Paul (@KB-perByte)