cisco.nxos.nxos_bgp_address_family module – BGP Address Family resource module.
Note
This module is part of the cisco.nxos collection (version 9.2.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install cisco.nxos
.
To use it in a playbook, specify: cisco.nxos.nxos_bgp_address_family
.
New in cisco.nxos 2.0.0
Synopsis
This module manages BGP Address Family configuration on devices running Cisco NX-OS.
Parameters
Parameter |
Comments |
---|---|
A list of BGP process configuration. |
|
Address Family related configurations. |
|
Additional paths configuration. |
|
Install backup path. Choices:
|
|
Additional paths Receive capability. Choices:
|
|
Additional paths selection |
|
Route-map for additional paths selection |
|
Additional paths Send capability Choices:
|
|
Enable advertising EVPN routes. Choices:
|
|
Advertise physical ip for type-5 route. Choices:
|
|
Advertise extra EVPN RT-2 with system MAC. Choices:
|
|
Address Family indicator. Choices:
|
|
Configure BGP aggregate prefixes |
|
Select attribute information from specific routes. |
|
Generate AS-SET information. Choices:
|
|
Set attribute information of aggregate. |
|
Aggregate prefix. |
|
Do not advertise more specifics. Choices:
|
|
Conditionally filter more specific routes. |
|
Allow VNI in Ethernet Tag field in EVPN route. Choices:
|
|
Configure client-to-client route reflection. |
|
Reflection of routes permitted. Choices:
|
|
Dampen IGP metric-related changes. |
|
Configure route flap dampening. |
|
Decay half life. |
|
Maximum suppress time for stable route. |
|
Apply route-map to specify dampening criteria. |
|
Set route flap dampening. Choices:
|
|
Value to start reusing a route. |
|
Value to start suppressing a route. |
|
Control distribution of default information. |
|
Distribute a default route. Choices:
|
|
Set metric of redistributed routes. |
|
Configure administrative distance. |
|
Distance for EBGP routes. |
|
Distance for IBGP routes. |
|
Distance for local routes. |
|
Export Gateway IP to Type-5 EVPN routes for VRF Choices:
|
|
Routemap which specifies prefixes to inject. |
|
Copy attributes from aggregate. Choices:
|
|
Routemap which specifies exist condition. |
|
Route-map name. |
|
Forward packets over multipath paths. |
|
Configure multipath for both EBGP and IBGP paths. |
|
Number of parallel paths. |
|
Configure multipath for IBGP paths. |
|
Number of parallel paths. |
|
Configure multipath for local paths. |
|
Number of parallel paths. |
|
Configure multipath for local and remote paths. |
|
Number of parallel paths. |
|
Number of parallel paths. |
|
Configure an IP prefix to advertise. |
|
IP prefix in CIDR format. |
|
Route-map name. |
|
Nexthop tracking. |
|
Route-map name. |
|
Set the delay to trigger nexthop tracking. |
|
Nexthop changes affecting reachability. Delay value (miliseconds). |
|
Other nexthop changes. Delay value (miliseconds). |
|
Configure redistribution. |
|
The identifier for the protocol specified. |
|
The name of the protocol. Choices:
|
|
The route map policy to constrain redistribution. |
|
Retain the routes based on Target VPN Extended Communities. |
|
Specify Target VPN Extended Communities |
|
All the routes regardless of Target-VPN community Choices:
|
|
Apply route-map to filter routes. |
|
Sub Address Family indicator. Choices:
|
|
Advertise only active routes to peers. Choices:
|
|
Policy for filtering/modifying OSPF routes before sending them to RIB. |
|
Block the OSPF routes from being sent to RIB. Choices:
|
|
The Route Map name. |
|
Configure bgp related timers. |
|
Configure bestpath defer timer value for batch prefix processing. |
|
Bestpath defer time (mseconds). |
|
Maximum bestpath defer time (mseconds). |
|
Virtual Router Context. |
|
Delay initial bestpath until redistributed IGPs have converged. Choices:
|
|
Autonomous System Number of the router. |
|
This option is used only with state parsed. The value of this option should be the output received from the NX-OS device by executing the command show running-config | section ‘^router bgp’. The state parsed reads the configuration from |
|
The state the configuration should be left in. State deleted only removes BGP attributes that this modules manages and does not negate the BGP process completely. Refer to examples for more details. Choices:
|
Notes
Note
Tested against NX-OS 9.3.6.
Unsupported for Cisco MDS
For managing BGP neighbor address family configurations please use the cisco.nxos.nxos_bgp_neighbor_address_family module.
This module works with connection
network_cli
andhttpapi
.
Examples
# 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
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The resulting configuration after module execution. Returned: when changed Sample: |
|
The configuration prior to the module execution. Returned: when state is Sample: |
|
The set of commands pushed to the remote device. Returned: when state is Sample: |
|
Facts about the network resource gathered from the remote device as structured data. Returned: when state is Sample: |
|
The device native config provided in running_config option parsed into structured data as per module argspec. Returned: when state is Sample: |
|
The provided configuration in the task rendered in device-native format (offline). Returned: when state is Sample: |