cisco.nxos.nxos_bgp_address_family 模块 – BGP 地址族资源模块。
注意
此模块是 cisco.nxos 集合 (版本 9.2.1) 的一部分。
如果您使用的是 ansible
包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install cisco.nxos
。
要在 playbook 中使用它,请指定: cisco.nxos.nxos_bgp_address_family
。
cisco.nxos 2.0.0 中的新增功能
概要
此模块管理运行 Cisco NX-OS 的设备上的 BGP 地址族配置。
参数
参数 |
注释 |
---|---|
BGP 进程配置列表。 |
|
地址族相关配置。 |
|
附加路径配置。 |
|
安装备份路径。 选项
|
|
附加路径接收能力。 选项
|
|
附加路径选择 |
|
附加路径选择的路由映射 |
|
附加路径发送能力 选项
|
|
启用通告 EVPN 路由。 选项
|
|
为类型 5 路由通告物理 IP。 选项
|
|
使用系统 MAC 通告额外的 EVPN RT-2。 选项
|
|
地址族指示器。 选项
|
|
配置 BGP 聚合前缀 |
|
从特定路由中选择属性信息。 |
|
生成 AS-SET 信息。 选项
|
|
设置聚合的属性信息。 |
|
聚合前缀。 |
|
不要通告更多详细信息。 选项
|
|
有条件地过滤更具体的路由。 |
|
允许 EVPN 路由中的以太网标签字段中的 VNI。 选项
|
|
配置客户机到客户机的路由反射。 |
|
允许路由反射。 选项
|
|
抑制 IGP 度量相关更改。 |
|
配置路由扑动抑制。 |
|
衰减半衰期。 |
|
稳定路由的最大抑制时间。 |
|
应用路由映射以指定抑制标准。 |
|
设置路由扑动抑制。 选项
|
|
开始重用路由的值。 |
|
开始抑制路由的值。 |
|
控制默认信息的分配。 |
|
分发默认路由。 选项
|
|
设置重新分发路由的度量。 |
|
配置管理距离。 |
|
EBGP 路由的距离。 |
|
IBGP 路由的距离。 |
|
本地路由的距离。 |
|
将网关 IP 导出到 VRF 的类型 5 EVPN 路由 选项
|
|
指定要注入的前缀的路由映射。 |
|
从聚合复制属性。 选项
|
|
指定存在条件的路由映射。 |
|
路由映射名称。 |
|
通过多路径路径转发数据包。 |
|
为 EBGP 和 IBGP 路径配置多路径。 |
|
并行路径的数量。 |
|
为 IBGP 路径配置多路径。 |
|
并行路径的数量。 |
|
为本地路径配置多路径。 |
|
并行路径的数量。 |
|
为本地和远程路径配置多路径。 |
|
并行路径的数量。 |
|
并行路径的数量。 |
|
配置要通告的 IP 前缀。 |
|
CIDR 格式的 IP 前缀。 |
|
路由映射名称。 |
|
下一跳跟踪。 |
|
路由映射名称。 |
|
设置触发下一跳跟踪的延迟。 |
|
影响可达性的下一跳更改。 延迟值(毫秒)。 |
|
其他下一跳更改。 延迟值(毫秒)。 |
|
配置重新分发。 |
|
指定协议的标识符。 |
|
协议的名称。 选项
|
|
约束重新分发的路由映射策略。 |
|
基于目标 VPN 扩展社区保留路由。 |
|
指定目标 VPN 扩展社区 |
|
所有路由,无论目标 VPN 社区如何 选项
|
|
应用路由映射以过滤路由。 |
|
子地址族指示器。 选项
|
|
仅向对等体通告活动路由。 选项
|
|
在将 OSPF 路由发送到 RIB 之前用于过滤/修改 OSPF 路由的策略。 |
|
阻止将 OSPF 路由发送到 RIB。 选项
|
|
路由映射名称。 |
|
配置 bgp 相关计时器。 |
|
配置用于批量前缀处理的 bestpath 延迟计时器值。 |
|
Bestpath 延迟时间(毫秒)。 |
|
最大 bestpath 延迟时间(毫秒)。 |
|
虚拟路由器上下文。 |
|
延迟初始 bestpath,直到重新分发的 IGP 收敛。 选项
|
|
路由器的自治系统编号。 |
|
此选项仅与 state 为 *parsed* 时使用。 此选项的值应为通过执行命令 show running-config | section ‘^router bgp’ 从 NX-OS 设备接收到的输出。 state 为 *parsed* 将从 |
|
配置应保留的状态。 仅`deleted`状态会移除此模块管理的BGP属性,不会完全否定BGP进程。 更多详情请参考示例。 选项
|
注释
注意
已在NX-OS 9.3.6上测试。
不支持Cisco MDS
要管理BGP邻居地址族配置,请使用 cisco.nxos.nxos_bgp_neighbor_address_family 模块。
此模块适用于连接
network_cli
和httpapi
。
示例
# Using merged
# Before state:
# -------------
# Nexus9000v# show running-config | section "^router bgp"
# Nexus9000v#
- name: Merge the provided configuration with the existing running configuration
cisco.nxos.nxos_bgp_address_family:
config:
as_number: 65536
address_family:
- afi: ipv4
safi: multicast
networks:
- prefix: 192.0.2.32/27
- prefix: 192.0.2.64/27
route_map: rmap1
nexthop:
route_map: rmap2
trigger_delay:
critical_delay: 120
non_critical_delay: 180
- afi: ipv4
safi: unicast
vrf: site-1
default_information:
originate: true
aggregate_address:
- prefix: 203.0.113.0/24
as_set: true
summary_only: true
- afi: ipv6
safi: multicast
vrf: site-1
redistribute:
- protocol: ospfv3
id: 100
route_map: rmap-ospf-1
- protocol: eigrp
id: 101
route_map: rmap-eigrp-1
# Task output:
# ------------
# before: {}
#
# commands:
# - router bgp 65536
# - address-family ipv4 multicast
# - nexthop route-map rmap2
# - nexthop trigger-delay critical 120 non-critical 180
# - network 192.0.2.32/27
# - network 192.0.2.64/27 route-map rmap1
# - vrf site-1
# - address-family ipv4 unicast
# - default-information originate
# - aggregate-address 203.0.113.0/24 as-set summary-only
# - address-family ipv6 multicast
# - redistribute ospfv3 100 route-map rmap-ospf-1
# - redistribute eigrp 101 route-map rmap-eigrp-1
#
# after:
# as_number: "65536"
# address_family:
# - afi: ipv4
# safi: multicast
# networks:
# - prefix: 192.0.2.32/27
# - prefix: 192.0.2.64/27
# route_map: rmap1
# nexthop:
# route_map: rmap2
# trigger_delay:
# critical_delay: 120
# non_critical_delay: 180
# - afi: ipv4
# safi: unicast
# vrf: site-1
# default_information:
# originate: true
# aggregate_address:
# - prefix: 203.0.113.0/24
# as_set: true
# summary_only: true
# - afi: ipv6
# safi: multicast
# vrf: site-1
# redistribute:
# - id: "100"
# protocol: ospfv3
# route_map: rmap-ospf-1
# - id: "101"
# protocol: eigrp
# route_map: rmap-eigrp-1
# After state:
# ------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
# address-family ipv4 multicast
# nexthop route-map rmap2
# nexthop trigger-delay critical 120 non-critical 180
# network 192.0.2.32/27
# network 192.0.2.64/27 route-map rmap1
# vrf site-1
# address-family ipv4 unicast
# default-information originate
# aggregate-address 203.0.113.0/24 as-set summary-only
# address-family ipv6 multicast
# redistribute ospfv3 100 route-map rmap-ospf-1
# redistribute eigrp 101 route-map rmap-eigrp-1
#
# Using replaced
# Before state:
# -------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
# address-family ipv4 multicast
# nexthop route-map rmap2
# nexthop trigger-delay critical 120 non-critical 180
# network 192.0.2.32/27
# network 192.0.2.64/27 route-map rmap1
# vrf site-1
# address-family ipv4 unicast
# default-information originate
# aggregate-address 203.0.113.0/24 as-set summary-only
# address-family ipv6 multicast
# redistribute ospfv3 100 route-map rmap-ospf-1
# redistribute eigrp 101 route-map rmap-eigrp-1
- name: Replace configuration of specified AFs
cisco.nxos.nxos_bgp_address_family:
config:
as_number: 65536
address_family:
- afi: ipv4
safi: multicast
networks:
- prefix: 192.0.2.64/27
route_map: rmap1
nexthop:
route_map: rmap2
trigger_delay:
critical_delay: 120
non_critical_delay: 180
aggregate_address:
- prefix: 203.0.113.0/24
as_set: true
summary_only: true
- afi: ipv4
safi: unicast
vrf: site-1
state: replaced
# Task output:
# ------------
# before:
# as_number: "65536"
# address_family:
# - afi: ipv4
# safi: multicast
# networks:
# - prefix: 192.0.2.32/27
# - prefix: 192.0.2.64/27
# route_map: rmap1
# nexthop:
# route_map: rmap2
# trigger_delay:
# critical_delay: 120
# non_critical_delay: 180
# - afi: ipv4
# safi: unicast
# vrf: site-1
# default_information:
# originate: true
# aggregate_address:
# - prefix: 203.0.113.0/24
# as_set: true
# summary_only: true
# - afi: ipv6
# safi: multicast
# vrf: site-1
# redistribute:
# - id: "100"
# protocol: ospfv3
# route_map: rmap-ospf-1
# - id: "101"
# protocol: eigrp
# route_map: rmap-eigrp-1
#
# commands:
# - router bgp 65536
# - address-family ipv4 multicast
# - no network 192.0.2.32/27
# - aggregate-address 203.0.113.0/24 as-set summary-only
# - vrf site-1
# - address-family ipv4 unicast
# - no default-information originate
# - no aggregate-address 203.0.113.0/24 as-set summary-only
#
# after:
# as_number: "65536"
# address_family:
# - afi: ipv4
# safi: multicast
# networks:
# - prefix: 192.0.2.64/27
# route_map: rmap1
# nexthop:
# route_map: rmap2
# trigger_delay:
# critical_delay: 120
# non_critical_delay: 180
# aggregate_address:
# - prefix: 203.0.113.0/24
# as_set: true
# summary_only: true
#
# - afi: ipv4
# safi: unicast
# vrf: site-1
#
# - afi: ipv6
# safi: multicast
# vrf: site-1
# redistribute:
# - protocol: ospfv3
# id: "100"
# route_map: rmap-ospf-1
# - protocol: eigrp
# id: "101"
# route_map: rmap-eigrp-1
# After state:
# ------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
# address-family ipv4 multicast
# nexthop route-map rmap2
# nexthop trigger-delay critical 120 non-critical 180
# network 192.0.2.64/27 route-map rmap1
# aggregate-address 203.0.113.0/24 as-set summary-only
# vrf site-1
# address-family ipv4 unicast
# address-family ipv6 multicast
# redistribute ospfv3 100 route-map rmap-ospf-1
# redistribute eigrp 101 route-map rmap-eigrp-1
# Using overridden
# Before state:
# -------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
# address-family ipv4 multicast
# nexthop route-map rmap2
# nexthop trigger-delay critical 120 non-critical 180
# network 192.0.2.32/27
# network 192.0.2.64/27 route-map rmap1
# vrf site-1
# address-family ipv4 unicast
# default-information originate
# aggregate-address 203.0.113.0/24 as-set summary-only
# address-family ipv6 multicast
# redistribute ospfv3 100 route-map rmap-ospf-1
# redistribute eigrp 101 route-map rmap-eigrp-1
- name: Override all BGP AF configuration with provided configuration
cisco.nxos.nxos_bgp_address_family: &overridden
config:
as_number: 65536
address_family:
- afi: ipv4
safi: multicast
networks:
- prefix: 192.0.2.64/27
route_map: rmap1
aggregate_address:
- prefix: 203.0.113.0/24
as_set: true
summary_only: true
- afi: ipv4
safi: unicast
vrf: site-1
state: overridden
# Task output:
# ------------
# before:
# as_number: "65536"
# address_family:
# - afi: ipv4
# safi: multicast
# networks:
# - prefix: 192.0.2.32/27
# - prefix: 192.0.2.64/27
# route_map: rmap1
# nexthop:
# route_map: rmap2
# trigger_delay:
# critical_delay: 120
# non_critical_delay: 180
# - afi: ipv4
# safi: unicast
# vrf: site-1
# default_information:
# originate: true
# aggregate_address:
# - prefix: 203.0.113.0/24
# as_set: true
# summary_only: true
# - afi: ipv6
# safi: multicast
# vrf: site-1
# redistribute:
# - id: "100"
# protocol: ospfv3
# route_map: rmap-ospf-1
# - id: "101"
# protocol: eigrp
# route_map: rmap-eigrp-1
#
# commands:
# - router bgp 65536
# - vrf site-1
# - no address-family ipv6 multicast
# - exit
# - address-family ipv4 multicast
# - no nexthop route-map rmap2
# - no nexthop trigger-delay critical 120 non-critical 180
# - aggregate-address 203.0.113.0/24 as-set summary-only
# - no network 192.0.2.32/27
# - vrf site-1
# - address-family ipv4 unicast
# - no default-information originate
# - no aggregate-address 203.0.113.0/24 as-set summary-only
#
# after:
# as_number: "65536"
# address_family:
# - afi: ipv4
# safi: multicast
# networks:
# - prefix: 192.0.2.64/27
# route_map: rmap1
# aggregate_address:
# - prefix: 203.0.113.0/24
# as_set: true
# summary_only: true
# - afi: ipv4
# safi: unicast
# vrf: site-1
#
# After state:
# ------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
# address-family ipv4 multicast
# network 192.0.2.64/27 route-map rmap1
# aggregate-address 203.0.113.0/24 as-set summary-only
# vrf site-1
# address-family ipv4 unicast
#
# Using deleted to remove specified AFs
# Before state:
# -------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
# address-family ipv4 multicast
# nexthop route-map rmap2
# nexthop trigger-delay critical 120 non-critical 180
# network 192.0.2.32/27
# network 192.0.2.64/27 route-map rmap1
# vrf site-1
# address-family ipv4 unicast
# default-information originate
# aggregate-address 203.0.113.0/24 as-set summary-only
# address-family ipv6 multicast
# redistribute ospfv3 100 route-map rmap-ospf-1
# redistribute eigrp 101 route-map rmap-eigrp-1
- name: Delete specified BGP AFs
cisco.nxos.nxos_bgp_address_family:
config:
as_number: 65536
address_family:
- afi: ipv4
safi: multicast
- vrf: site-1
afi: ipv6
safi: multicast
state: deleted
# Task output:
# ------------
# before:
# as_number: "65536"
# address_family:
# - afi: ipv4
# safi: multicast
# networks:
# - prefix: 192.0.2.32/27
# - prefix: 192.0.2.64/27
# route_map: rmap1
# nexthop:
# route_map: rmap2
# trigger_delay:
# critical_delay: 120
# non_critical_delay: 180
# - afi: ipv4
# safi: unicast
# vrf: site-1
# default_information:
# originate: true
# aggregate_address:
# - prefix: 203.0.113.0/24
# as_set: true
# summary_only: true
# - afi: ipv6
# safi: multicast
# vrf: site-1
# redistribute:
# - id: "100"
# protocol: ospfv3
# route_map: rmap-ospf-1
# - id: "101"
# protocol: eigrp
# route_map: rmap-eigrp-1
#
# commands:
# - router bgp 65563
# - no address-family ipv4 multicast
# - vrf site-1
# - no address-family ipv6 multicast
#
# after:
# as_number: "65536"
# address_family:
# - afi: ipv4
# safi: unicast
# vrf: site-1
# default_information:
# originate: true
# aggregate_address:
# - prefix: 203.0.113.0/24
# as_set: true
# summary_only: true
# After state:
# ------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
# vrf site-1
# address-family ipv4 unicast
# default-information originate
# aggregate-address 203.0.113.0/24 as-set summary-only
# Using deleted to remove all BGP AFs
# Before state:
# -------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
# address-family ipv4 multicast
# nexthop route-map rmap2
# nexthop trigger-delay critical 120 non-critical 180
# network 192.0.2.32/27
# network 192.0.2.64/27 route-map rmap1
# vrf site-1
# address-family ipv4 unicast
# default-information originate
# aggregate-address 203.0.113.0/24 as-set summary-only
# address-family ipv6 multicast
# redistribute ospfv3 100 route-map rmap-ospf-1
# redistribute eigrp 101 route-map rmap-eigrp-1
- name: Delete all BGP AFs
cisco.nxos.nxos_bgp_address_family:
state: deleted
# Task output:
# ------------
# before:
# as_number: "65536"
# address_family:
# - afi: ipv4
# safi: multicast
# networks:
# - prefix: 192.0.2.32/27
# - prefix: 192.0.2.64/27
# route_map: rmap1
# nexthop:
# route_map: rmap2
# trigger_delay:
# critical_delay: 120
# non_critical_delay: 180
# - afi: ipv4
# safi: unicast
# vrf: site-1
# default_information:
# originate: true
# aggregate_address:
# - prefix: 203.0.113.0/24
# as_set: true
# summary_only: true
# - afi: ipv6
# safi: multicast
# vrf: site-1
# redistribute:
# - id: "100"
# protocol: ospfv3
# route_map: rmap-ospf-1
# - id: "101"
# protocol: eigrp
# route_map: rmap-eigrp-1
#
# commands:
# - router bgp 65563
# - no address-family ipv4 multicast
# - vrf site-1
# - no address-family ipv4 unicast
# - no address-family ipv6 multicast
#
# after:
# as_number: "65536"
# After state:
# ------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
# Nexus9000v#
# Using rendered
- name: Render platform specific configuration lines with state rendered (without connecting to the device)
cisco.nxos.nxos_bgp_address_family:
config:
as_number: 65536
address_family:
- afi: ipv4
safi: multicast
networks:
- prefix: 192.0.2.32/27
- prefix: 192.0.2.64/27
route_map: rmap1
nexthop:
route_map: rmap2
trigger_delay:
critical_delay: 120
non_critical_delay: 180
- afi: ipv4
safi: unicast
vrf: site-1
default_information:
originate: true
aggregate_address:
- prefix: 203.0.113.0/24
as_set: true
summary_only: true
- afi: ipv6
safi: multicast
vrf: site-1
redistribute:
- protocol: ospfv3
id: 100
route_map: rmap-ospf-1
- protocol: eigrp
id: 101
route_map: rmap-eigrp-1
state: rendered
# Task Output:
# ------------
# rendered:
# - router bgp 65536
# - address-family ipv4 multicast
# - nexthop route-map rmap2
# - nexthop trigger-delay critical 120 non-critical 180
# - network 192.0.2.32/27
# - network 192.0.2.64/27 route-map rmap1
# - vrf site-1
# - address-family ipv4 unicast
# - default-information originate
# - aggregate-address 203.0.113.0/24 as-set summary-only
# - address-family ipv6 multicast
# - redistribute ospfv3 100 route-map rmap-ospf-1
# - redistribute eigrp 101 route-map rmap-eigrp-1
# Using parsed
# parsed.cfg
# ------------
# router bgp 65536
# address-family ipv4 multicast
# nexthop route-map rmap2
# nexthop trigger-delay critical 120 non-critical 180
# network 192.0.2.32/27
# network 192.0.2.64/27 route-map rmap1
# vrf site-1
# address-family ipv4 unicast
# default-information originate
# aggregate-address 203.0.113.0/24 as-set summary-only
# address-family ipv6 multicast
# redistribute ospfv3 100 route-map rmap-ospf-1
# redistribute eigrp 101 route-map rmap-eigrp-1
- name: Parse externally provided BGP AF config
cisco.nxos.nxos_bgp_address_family:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Task output:
# ------------
# parsed:
# as_number: "65536"
# address_family:
# - afi: ipv4
# safi: multicast
# networks:
# - prefix: 192.0.2.32/27
# - prefix: 192.0.2.64/27
# route_map: rmap1
# nexthop:
# route_map: rmap2
# trigger_delay:
# critical_delay: 120
# non_critical_delay: 180
# - afi: ipv4
# safi: unicast
# vrf: site-1
# default_information:
# originate: true
# aggregate_address:
# - prefix: 203.0.113.0/24
# as_set: true
# summary_only: true
# - afi: ipv6
# safi: multicast
# vrf: site-1
# redistribute:
# - id: "100"
# protocol: ospfv3
# route_map: rmap-ospf-1
# - id: "101"
# protocol: eigrp
# route_map: rmap-eigrp-1
返回值
常见的返回值已在 此处 文档中说明,以下是此模块独有的字段
键 |
描述 |
---|---|
模块执行后的最终配置。 返回:发生更改时 示例: |
|
模块执行之前的配置。 返回:当state 为 示例: |
|
推送到远程设备的命令集。 返回:当state 为 示例: |
|
从远程设备收集的关于网络资源的事实信息,以结构化数据的形式呈现。 返回:当state 为 示例: |
|
根据模块argspec,将`running_config`选项中提供的设备原生配置解析为结构化数据。 返回:当state 为 示例: |
|
以设备原生格式呈现的任务中提供的配置(离线)。 返回:当state 为 示例: |