cisco.nxos.nxos_bgp_templates 模块 – BGP 模板资源模块。
注意
此模块是 cisco.nxos 集合 (版本 9.2.1) 的一部分。
如果您使用的是 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install cisco.nxos
。
要在剧本中使用它,请指定: cisco.nxos.nxos_bgp_templates
。
cisco.nxos 4.2.0 中的新增功能
概要
此模块管理在运行 Cisco NX-OS 的设备上的 BGP 模板。
参数
参数 |
注释 |
---|---|
BGP 模板列表。 |
|
路由器的自治系统编号。 |
|
配置 BGP 对等体模板。 |
|
为对等体配置地址族。 |
|
指定用于条件通告的路由映射。 |
|
条件路由映射,仅当条件中存在前缀时才通告。 |
|
条件路由映射,仅当条件中不存在前缀时才通告。 |
|
路由映射名称。 |
|
发送 BGP 路由更新之间的最小间隔。 |
|
地址族指示器。 选项
|
|
接受 AS 路径中包含我的 AS 的路径。 |
|
AS 编号出现的次数,默认为 3。 |
|
激活 allowas-in 属性。 选项
|
|
发送更新时覆盖匹配的 AS 号。 选项
|
|
向对等体通告能力。 |
|
附加路径能力。 |
|
附加路径接收能力。 选项
|
|
附加路径发送能力。 选项
|
|
向此对等体发起默认路由。 |
|
路由映射,用于指定发起默认路由的条件。 |
|
设置 default-originate 属性。 选项
|
|
禁用在通告时检查对等体 AS 号。 选项
|
|
过滤列表的名称。 |
|
将策略应用于传入路由。 |
|
将策略应用于传出路由。 |
|
继承对等体策略模板。 |
|
要继承的对等体策略模板。 |
|
来自此邻居的最大前缀数。 |
|
生成警告的阈值百分比。 |
|
最大前缀限制。 |
|
超过限制后重新启动 bgp 连接。 |
|
仅在超过限制时给出警告消息。 选项
|
|
将我们的地址设置为 nexthop(非反射)。 |
|
将我们的地址设置为所有路由的 nexthop。 选项
|
|
设置 next-hop-self 属性。 选项
|
|
如果可能,计算第三方 nexthop。 选项
|
|
应用前缀列表。 |
|
将策略应用于传入路由。 |
|
将策略应用于传出路由。 |
|
将路由映射应用于邻居。 |
|
要应用于传入路由的策略名称。 |
|
要应用于传出路由的策略名称。 |
|
将邻居配置为路由反射器客户端。 选项
|
|
子地址族指示器。 选项
|
|
将社区属性发送给此邻居。 选项
|
|
软重新配置。 |
|
始终执行传入软重新配置。 选项
|
|
设置 soft-reconfiguration inbound 属性。 选项
|
|
指定源站点 extcommunity。 |
|
仅向对等体通告活动路由。 选项
|
|
路由映射,用于选择性地取消抑制被抑制的路由。 |
|
设置来自此邻居的路由的默认权重。 |
|
邻居的双向快速检测。 |
|
多跳会话。 |
|
配置 BFD 会话间隔参数。 |
|
最小 RX 间隔。 |
|
检测乘数。 |
|
TX 间隔(毫秒)。 |
|
设置 BFD 多跳。 选项
|
|
为此邻居设置 BFD。 选项
|
|
单跳会话。 选项
|
|
指定用于激活对等体 BMP 监控的服务器 ID。 |
|
能力。 |
|
抑制 4 字节 AS 能力。 选项
|
|
邻居特定的描述。 |
|
禁用直接连接对等体的检查。 选项
|
|
不要与此邻居协商能力。 选项
|
|
设置TCP传输的DSCP值。 |
|
动态能力 选项
|
|
指定远程对端的Multihop TTL。 |
|
此邻居的优雅关机。 |
|
发送优雅关机社区。 |
|
应用路由映射来修改出站属性。 |
|
设置activate。 选项
|
|
继承模板。 |
|
要继承的对等会话模板。 |
|
指定eBGP邻居的本地AS号。 |
|
记录邻居上下线事件的消息。 |
|
禁用邻居上下线事件的日志记录。 选项
|
|
设置log-neighbor-changes。 选项
|
|
低内存情况下的行为。 |
|
内存压力下不关闭此对等端。 选项
|
|
BGP对等端模板的名称。 |
|
为邻居配置密码。 |
|
0 指定未加密的邻居密码。 3 指定接下来将使用3DES加密的邻居密码。 7 指定接下来将使用Cisco 7型加密的邻居密码。 |
|
身份验证密码。 |
|
BGP路径属性可选过滤。 |
|
操作。 选项
|
|
路径属性范围。 |
|
路径属性范围结束值。 |
|
路径属性范围起始值。 |
|
路径属性类型 |
|
指定邻居的自治系统编号。 |
|
从出站更新中删除私有AS号。 |
|
全部。 选项
|
|
替换。 选项
|
|
删除私有AS。 选项
|
|
管理性地关闭此邻居。 选项
|
|
配置keepalive和hold定时器。 |
|
保持时间(秒)。 |
|
Keepalive间隔(秒)。 |
|
BGP传输连接。 |
|
指定连接类型。 |
|
仅允许被动连接设置。 选项
|
|
启用TTL安全机制。 |
|
指定远程对端的跳数。 |
|
指定BGP会话和更新的源。 |
|
此选项仅与状态 *parsed* 一起使用。 此选项的值应为通过执行命令 **show running-config bgp | section ‘template’** 从NX-OS设备接收到的输出。 状态 *parsed* 从 |
|
配置应保留的状态。 有关更多详细信息,请参阅示例。 选项
|
注释
注意
在NX-OS 9.3.6上进行了测试。
不支持Cisco MDS
此模块可与连接
network_cli
和httpapi
配合使用。
示例
# Using merged
# Before state:
# --------------
#
# nxos9k# show running-config | section "^router bgp"
# nxos9k#
- name: Merge the provided configuration with the existing running configuration
cisco.nxos.nxos_bgp_templates:
config:
as_number: 65536
neighbor:
- name: neighbor_tmplt_1
address_family:
- afi: ipv4
safi: unicast
advertise_map:
route_map: rmap1
non_exist_map: nemap1
advertisement_interval: 60
disable_peer_as_check: true
bmp_activate_server: 2
capability:
suppress_4_byte_as: true
description: Test_BGP_PEER_TEMPLATE_1
local_as: 65536
remote_as: 65001
- name: neighbor_tmplt_2
description: Test_BGP_PEER_TEMPLATE_2
address_family:
- afi: ipv4
safi: multicast
advertise_map:
route_map: rmap1
exist_map: emap1
as_override: true
filter_list:
inbound: flist1
outbound: flist2
inherit:
peer_session: psession1
timers:
holdtime: 100
keepalive: 45
# Task Output:
# ------------
# before: {}
#
# commands:
# - router bgp 65536
# - template peer neighbor_tmplt_1
# - bmp-activate-server 2
# - capability suppress 4-byte-as
# - description Test_BGP_PEER_TEMPLATE_1
# - local-as 65536
# - remote-as 65001
# - address-family ipv4 unicast
# - advertise-map rmap1 non-exist-map nemap1
# - advertisement-interval 60
# - disable-peer-as-check
# - template peer neighbor_tmplt_2
# - description Test_BGP_PEER_TEMPLATE_2
# - inherit peer-session psession1
# - timers 45 100
# - address-family ipv4 multicast
# - advertise-map rmap1 exist-map emap1
# - as-override
# - filter-list flist1 in
# - filter-list flist2 out
#
# after:
# as_number: "65536"
# neighbor:
# - name: neighbor_tmplt_1
# address_family:
# - afi: ipv4
# safi: unicast
# advertise_map:
# non_exist_map: nemap1
# route_map: rmap1
# advertisement_interval: 60
# disable_peer_as_check: true
# bmp_activate_server: 2
# capability:
# suppress_4_byte_as: true
# description: Test_BGP_PEER_TEMPLATE_1
# local_as: "65536"
# remote_as: "65001"
#
# - name: neighbor_tmplt_2
# description: Test_BGP_PEER_TEMPLATE_2
# address_family:
# - afi: ipv4
# safi: multicast
# advertise_map:
# exist_map: emap1
# route_map: rmap1
# as_override: true
# filter_list:
# inbound: flist1
# outbound: flist2
# inherit:
# peer_session: psession1
# timers:
# holdtime: 100
# keepalive: 45
# After state:
# --------------
#
# nxos9k# show running-config | section "^router bgp"
# router bgp 65536
# template peer neighbor_tmplt_1
# capability suppress 4-byte-as
# bmp-activate-server 2
# description Test_BGP_PEER_TEMPLATE_1
# local-as 65536
# remote-as 65001
# address-family ipv4 unicast
# advertise-map rmap1 non-exist-map nemap1
# advertisement-interval 60
# disable-peer-as-check
# template peer neighbor_tmplt_2
# description Test_BGP_PEER_TEMPLATE_2
# inherit peer-session psession1
# timers 45 100
# address-family ipv4 multicast
# advertise-map rmap1 exist-map emap1
# as-override
# filter-list flist1 in
# filter-list flist2 out
# Using replaced
# Before state:
# -------------
#
# nxos9k# show running-config | section "^router bgp"
# router bgp 65536
# template peer neighbor_tmplt_1
# capability suppress 4-byte-as
# description Test_BGP_PEER_TEMPLATE_1
# bmp-activate-server 2
# local-as 65536
# remote-as 65001
# address-family ipv4 unicast
# advertise-map rmap1 non-exist-map nemap1
# advertisement-interval 60
# disable-peer-as-check
# template peer neighbor_tmplt_2
# description Test_BGP_PEER_TEMPLATE_2
# inherit peer-session psession1
# timers 45 100
# address-family ipv4 multicast
# advertise-map rmap1 exist-map emap1
# as-override
# filter-list flist1 in
# filter-list flist2 out
- name: Replace BGP templates configuration with provided configuration
cisco.nxos.nxos_bgp_templates:
config:
as_number: 65536
neighbor:
- name: neighbor_tmplt_1
address_family:
- afi: ipv4
safi: unicast
advertise_map:
route_map: rmap1
non_exist_map: nemap1
advertisement_interval: 60
disable_peer_as_check: true
inherit:
peer_session: psession1
description: Test_BGP_PEER_TEMPLATE_1
local_as: 65537
state: replaced
# Task output:
# ------------
#
# before:
# as_number: "65536"
# neighbor:
# - name: neighbor_tmplt_1
# address_family:
# - afi: ipv4
# safi: unicast
# advertise_map:
# non_exist_map: nemap1
# route_map: rmap1
# advertisement_interval: 60
# disable_peer_as_check: true
# bmp_activate_server: 2
# capability:
# suppress_4_byte_as: true
# description: Test_BGP_PEER_TEMPLATE_1
# local_as: "65536"
# remote_as: "65001"
#
# - name: neighbor_tmplt_2
# description: Test_BGP_PEER_TEMPLATE_2
# address_family:
# - afi: ipv4
# safi: multicast
# advertise_map:
# exist_map: emap1
# route_map: rmap1
# as_override: true
# filter_list:
# inbound: flist1
# outbound: flist2
# inherit:
# peer_session: psession1
# timers:
# holdtime: 100
# keepalive: 45
#
# commands:
# - router bgp 65536
# - template peer neighbor_tmplt_1
# - no bmp-activate-server 2
# - no capability suppress 4-byte-as
# - inherit peer-session psession1
# - local-as 65537
# - no remote-as 65001
#
# after:
# as_number: "65536"
# neighbor:
# - name: neighbor_tmplt_1
# address_family:
# - afi: ipv4
# safi: unicast
# advertise_map:
# non_exist_map: nemap1
# route_map: rmap1
# advertisement_interval: 60
# disable_peer_as_check: true
# description: Test_BGP_PEER_TEMPLATE_1
# inherit:
# peer_session: psession1
# local_as: "65537"
#
# - name: neighbor_tmplt_2
# description: Test_BGP_PEER_TEMPLATE_2
# address_family:
# - afi: ipv4
# safi: multicast
# advertise_map:
# exist_map: emap1
# route_map: rmap1
# as_override: true
# filter_list:
# inbound: flist1
# outbound: flist2
# inherit:
# peer_session: psession1
# timers:
# holdtime: 100
# keepalive: 45
# After state:
# ------------
#
# nxos9k# show running-config | section "^router bgp"
# router bgp 65536
# template peer neighbor_tmplt_1
# inherit peer-session psession1
# description Test_BGP_PEER_TEMPLATE_1
# local-as 65537
# address-family ipv4 unicast
# advertise-map rmap1 non-exist-map nemap1
# advertisement-interval 60
# disable-peer-as-check
# template peer neighbor_tmplt_2
# description Test_BGP_PEER_TEMPLATE_2
# inherit peer-session psession1
# bmp-activate-server 2
# timers 45 100
# address-family ipv4 multicast
# advertise-map rmap1 exist-map emap1
# as-override
# filter-list flist1 in
# filter-list flist2 out
# Using overridden
#
# Before state:
# -------------
#
# nxos9k# show running-config | section "^router bgp"
# router bgp 65536
# template peer neighbor_tmplt_1
# capability suppress 4-byte-as
# description Test_BGP_PEER_TEMPLATE_1
# bmp-activate-server 2
# local-as 65536
# remote-as 65001
# address-family ipv4 unicast
# advertise-map rmap1 non-exist-map nemap1
# advertisement-interval 60
# disable-peer-as-check
# template peer neighbor_tmplt_2
# description Test_BGP_PEER_TEMPLATE_2
# inherit peer-session psession1
# timers 45 100
# address-family ipv4 multicast
# advertise-map rmap1 exist-map emap1
# as-override
# filter-list flist1 in
# filter-list flist2 out
- name: Override BGP templates configuration with provided configuration
cisco.nxos.nxos_bgp_templates:
config:
as_number: 65536
neighbor:
- name: neighbor_tmplt_1
address_family:
- afi: ipv4
safi: unicast
advertise_map:
route_map: rmap1
non_exist_map: nemap1
advertisement_interval: 60
disable_peer_as_check: true
inherit:
peer_session: psession1
description: Test_BGP_PEER_TEMPLATE_1
local_as: 65537
state: overridden
# Task output:
# ------------
#
# before:
# as_number: "65536"
# neighbor:
# - name: neighbor_tmplt_1
# address_family:
# - afi: ipv4
# safi: unicast
# advertise_map:
# non_exist_map: nemap1
# route_map: rmap1
# advertisement_interval: 60
# disable_peer_as_check: true
# bmp_activate_server: 2
# capability:
# suppress_4_byte_as: true
# description: Test_BGP_PEER_TEMPLATE_1
# local_as: "65536"
# remote_as: "65001"
#
# - name: neighbor_tmplt_2
# description: Test_BGP_PEER_TEMPLATE_2
# address_family:
# - afi: ipv4
# safi: multicast
# advertise_map:
# exist_map: emap1
# route_map: rmap1
# as_override: true
# filter_list:
# inbound: flist1
# outbound: flist2
# inherit:
# peer_session: psession1
# timers:
# holdtime: 100
# keepalive: 45
#
# commands:
# - router bgp 65536
# - template peer neighbor_tmplt_1
# - no bmp-activate-server 2
# - no capability suppress 4-byte-as
# - inherit peer-session psession1
# - local-as 65537
# - no remote-as 65001
# - no template peer neighbor_tmplt_2
#
# after:
# as_number: "65536"
# neighbor:
# - name: neighbor_tmplt_1
# address_family:
# - afi: ipv4
# safi: unicast
# advertise_map:
# non_exist_map: nemap1
# route_map: rmap1
# advertisement_interval: 60
# disable_peer_as_check: true
# description: Test_BGP_PEER_TEMPLATE_1
# inherit:
# peer_session: psession1
# local_as: "65537"
# After state:
# ------------
#
# nxos9k# show running-config | section "^router bgp"
# router bgp 65536
# template peer neighbor_tmplt_1
# inherit peer-session psession1
# description Test_BGP_PEER_TEMPLATE_1
# local-as 65537
# address-family ipv4 unicast
# advertise-map rmap1 non-exist-map nemap1
# advertisement-interval 60
# disable-peer-as-check
# Using deleted
# Before state:
# --------------
#
# nxos9k# show running-config | section "^router bgp"
# router bgp 65536
# template peer neighbor_tmplt_1
# capability suppress 4-byte-as
# description Test_BGP_PEER_TEMPLATE_1
# bmp-activate-server 2
# local-as 65536
# remote-as 65001
# address-family ipv4 unicast
# advertise-map rmap1 non-exist-map nemap1
# advertisement-interval 60
# disable-peer-as-check
# template peer neighbor_tmplt_2
# description Test_BGP_PEER_TEMPLATE_2
# inherit peer-session psession1
# timers 45 100
# address-family ipv4 multicast
# advertise-map rmap1 exist-map emap1
# as-override
# filter-list flist1 in
# filter-list flist2 out
- name: Delete BGP configs handled by this module
cisco.nxos.nxos_bgp_templates:
state: deleted
# Task output:
# ------------
#
# before:
# as_number: "65536"
# neighbor:
# - name: neighbor_tmplt_1
# address_family:
# - afi: ipv4
# safi: unicast
# advertise_map:
# non_exist_map: nemap1
# route_map: rmap1
# advertisement_interval: 60
# disable_peer_as_check: true
# bmp_activate_server: 2
# capability:
# suppress_4_byte_as: true
# description: Test_BGP_PEER_TEMPLATE_1
# local_as: "65536"
# remote_as: "65001"
#
# - name: neighbor_tmplt_2
# description: Test_BGP_PEER_TEMPLATE_2
# address_family:
# - afi: ipv4
# safi: multicast
# advertise_map:
# exist_map: emap1
# route_map: rmap1
# as_override: true
# filter_list:
# inbound: flist1
# outbound: flist2
# inherit:
# peer_session: psession1
# timers:
# holdtime: 100
# keepalive: 45
#
# commands:
# - router bgp 65536
# - no template peer neighbor_tmplt_1
# - no template peer neighbor_tmplt_2
#
# after: {}
# After state:
# -------------
# nxos9k# show running-config | section "^router bgp"
# nxos9k#
返回值
常见的返回值已在此处记录 此处,以下是此模块特有的字段
键 |
描述 |
---|---|
模块执行后的结果配置。 返回:已更改时 示例: |
|
模块执行之前的配置。 返回:当state 为 示例: |
|
推送到远程设备的命令集。 返回:当state 为 示例: |
|
从远程设备收集的关于网络资源的事实,以结构化数据的形式呈现。 返回:当state 为 示例: |
|
根据模块argspec将 *running_config* 选项中提供的设备原生配置解析为结构化数据。 返回:当state 为 示例: |
|
以设备原生格式(离线)呈现的任务中提供的配置。 返回:当state 为 示例: |