cisco.iosxr.iosxr_bgp_address_family module – Resource module to configure BGP Address family.
Note
This module is part of the cisco.iosxr collection (version 6.1.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.iosxr
.
To use it in a playbook, specify: cisco.iosxr.iosxr_bgp_address_family
.
New in cisco.iosxr 2.0.0
Synopsis
This module configures and manages the attributes of BGP address family on Cisco IOS-XR platforms.
Parameters
Parameter |
Comments |
---|---|
A list of configurations for BGP address family. |
|
Enable address family and enter its config mode |
|
BGP additional-paths commands Choices:
|
|
Advertise best-external path. Choices:
|
|
address family. Choices:
|
|
Configure BGP aggregate entries. |
|
Generate AS confed set path information. Choices:
|
|
Generate AS set path information. Choices:
|
|
Policy to condition advertisement, suppression, and attributes. |
|
Filter more specific routes from updates. Choices:
|
|
IPv4 Aggregate address and mask or masklength. |
|
Allocate labels. |
|
Allocate labels for all prefixes. Choices:
|
|
Use a route policy to select prefixes for label allocation. |
|
Allow sending default originate route to VPN neighbor. Choices:
|
|
Configure AS Path loop checking for outbound updates. Choices:
|
|
BGP Commands. |
|
Configure attribute download for this address-family. Choices:
|
|
Change default route selection criteria. |
|
BGP origin-AS knobs. |
|
BGP origin-AS knobs. |
|
BGP bestpath selection will allow ‘invalid’ origin-AS Choices:
|
|
BGP origin-AS knobs. |
|
BGP bestpath selection will use origin-AS validity Choices:
|
|
Configure client to client route reflection. |
|
disable client to client reflection of cluster id. |
|
ID of Cluster for which reflection is to be disabled. |
|
ID of Cluster for which reflection is to be disabled. |
|
disable cluster id. Choices:
|
|
disable reflection. Choices:
|
|
Enable route-flap dampening |
|
Route policy to specify criteria for dampening. |
|
Enable dampening. Choices:
|
|
Half-life time for the penalty |
|
Specify delay for batching import processing. |
|
milliseconds part <0-999>. |
|
Delay, seconds part <0-10>. |
|
Specify delay for batching label processing |
|
milliseconds part <0-999>. |
|
Delay, seconds part <0-10>. |
|
BGP origin-AS knobs. |
|
BGP origin-AS validation knobs. |
|
Disable RPKI origin-AS validation. Choices:
|
|
Signal origin-AS validity towards peers. |
|
Signal origin-AS validity towards iBGP peers Choices:
|
|
Configure background scanner interval for this address-family Example- <5-3600>. |
|
Martian check default Choices:
|
|
Define an administrative distance. |
|
Distance for local routes <1-255>. |
|
Distance for routes external to the AS <1-255>. |
|
Distance for routes internal to the AS <1-255>. |
|
Dynamic MED Interval. |
|
Enable global table multicast. Choices:
|
|
Install remote mvpn routes in default vrf.This is applicable for mvpn afi. Choices:
|
|
label configuration. |
|
Set per CE label mode Choices:
|
|
Set per perfix label mode. Choices:
|
|
Set per VRF label mode. Choices:
|
|
Use a route policy to select prefixes for label allocation mode. |
|
Forward packets over multiple paths. |
|
ebgp-multipath. |
|
<2-64> Number of paths (limit includes backup path). |
|
Order candidate multipaths for selection as per configured number(cisco-support). Choices:
|
|
Allow multipaths only from marked neighbors Choices:
|
|
eiBGP-multipath. |
|
<2-64> Number of paths (limit includes backup path). |
|
Order candidate multipaths for selection as per configured number(cisco-support). Choices:
|
|
Allow multipaths only from marked neighbors Choices:
|
|
iBGP-multipath. |
|
<2-64> Number of paths (limit includes backup path). |
|
Order candidate multipaths for selection as per configured number(cisco-support). Choices:
|
|
Allow multipaths only from marked neighbors Choices:
|
|
Allow multipaths to have different BGP nexthop IGP metrics. |
|
Order candidate multipaths for selection as per configured number(cisco-support). Choices:
|
|
Allow multipaths only from marked neighbors Choices:
|
|
set unequal_cost. Choices:
|
|
Enable single forwarder selection for all Choices:
|
|
Enable single forwarder selection for PE with highest ip address. Choices:
|
|
Specify a network to announce via BGP. |
|
Specify a BGP backdoor route. |
|
Specify a network to announce via BGP. |
|
Route-policy to modify the attributes. |
|
Nexthop |
|
Set minimum prefix-length for nexthop resolution. Choices:
|
|
Policy to filter out nexthop notification. |
|
For critical notification |
|
For non critical notification. |
|
Configure optimal-route-reflection group. |
|
ORR group name - maximum 32 characters. |
|
IPv4 primary address. |
|
IPv4 secondary address |
|
Name of the policy. |
|
Redistribute information from another routing protocol. |
|
Redistribute EIGRP external routes.applicable for eigrp. Choices:
|
|
Redistribute OSPF external routes.applicable for ospf. Choices:
|
|
Identifier for the routing protocol for configuring redistribute information. Example-application name, eigrp/is-is instance name, ospf tag Valid for protocols ‘ospf’, ‘eigrp’, ‘isis’ and ‘application’. |
|
Redistribute EIGRP internal routes.applicable for eigrp. Choices:
|
|
Redistribute routes from the specified ISIS levels. Redistribute ISIS level 1 routes Redistribute ISIS level 1 inter-area routes Redistribute ISIS level 2 ISIS routes Choices:
|
|
Specifies the metric for redistributed routes. |
|
Redistribute OSPF NSSA external routes.applicable for ospf. Choices:
|
|
Specifies the protocol for configuring redistribute information. Choices:
|
|
Specifies the route policy reference. |
|
Label retention time in minutes <3-60>. |
|
Route target RIB installation. Choices:
|
|
Address Family modifier Choices:
|
|
Enable segmented multicast.This is applicable for mvpn afi. Choices:
|
|
Configure policy for installation of routes to RIB. |
|
BGP Update generation configuration. |
|
Update limit. |
|
Update limit for sub-groups. |
|
Update limit for address-family. |
|
Update limit for eBGP sub-groups<1-512. |
|
Update limit for iBGP sub-groups<1-512. |
|
Wait for route install. Choices:
|
|
VRF name. |
|
configuration is for all vrfs and its applicable for afi vpn6 and modifier unicast. |
|
Label-related configuration. |
|
Set per CE label mode Choices:
|
|
Set per VRF label mode. Choices:
|
|
Use a route policy to select prefixes for label allocation mode. |
|
Source import route-targets from import-policy. Choices:
|
|
Configure policy for installation of routes to RIB. |
|
Define or modify weight. |
|
set reset_on_import. Choices:
|
|
disable reset_on_import. Choices:
|
|
Autonomous system number. |
|
This option is used only with state parsed. The value of this option should be the output received from the Iosxr device by executing the command show running-config router bgp. The state parsed reads the configuration from |
|
The state the configuration should be left in. Choices:
|
Notes
Note
This module works with connection
network_cli
.
Examples
# Using merged
# Before state:
# -------------
# RP/0/0/CPU0:iosxr-02#show running-config router bgp
# Sat Feb 20 03:49:43.618 UTC
# router bgp 65536
# bgp router-id 192.0.2.1
# address-family vpnv4 unicast
# vrf vrf1
# rd auto
- name: Merge the provided configuration with the existing running configuration
cisco.iosxr.iosxr_bgp_address_family:
state: merged
config:
as_number: '65536'
address_family:
- afi: ipv4
safi: unicast
vrf: vrf1
dynamic_med: 9
redistribute:
- protocol: connected
metric: 10
- afi: ipv4
safi: unicast
dynamic_med: 10
redistribute:
- protocol: application
id: test1
metric: 10
bgp:
scan_time: 20
attribute_download: true
advertise_best_external: true
allocate_label:
all: true
# Task output
# -------------
# commands:
# - router bgp 65536
# - address-family ipv4 unicast
# - advertise best-external
# - allocate-label all
# - bgp attribute-download
# - bgp scan-time 20
# - dynamic-med interval 10
# - redistribute application test1 metric 10
# - vrf vrf1
# - address-family ipv4 unicast
# - dynamic-med interval 9
# - redistribute connected metric 10
#
#
# after:
# as_number: "65536"
# address_family:
# - afi: "ipv4"
# safi: "unicast"
# vrf: vrf1
# dynamic_med: 9
# redistribute:
# - protocol: connected
# metric: 10
# - afi: "ipv4"
# safi: "unicast"
# dynamic_med: 10
# redistribute:
# - protocol: application
# id: "test1"
# metric: 10
# bgp:
# scan_time: 20
# attribute_download: true
# advertise_best_external: true
# allocate_label:
# all: true
#
# After state:
# -------------
# RP/0/0/CPU0:iosxr-02#show running-config router bgp
# Sat Feb 20 03:49:43.618 UTC
# router bgp 65536
# bgp router-id 192.0.1.1
# address-family ipv4 unicast
# advertise best-external
# allocate-label all
# bgp attribute-download
# bgp scan-time 20
# address-family vpnv4 unicast
# vrf vrf1
# rd auto
# address-family ipv4 unicast
# dynamic-med interval 9
# redistribute connected metric 10
#
# Using replaced
# Before state:
# -------------
# RP/0/0/CPU0:iosxr-02#show running-config router bgp
# Sat Feb 20 03:49:43.618 UTC
# router bgp 65536
# bgp router-id 192.0.1.1
# address-family ipv4 unicast
# advertise best-external
# allocate-label all
# bgp attribute-download
# bgp scan-time 20
# address-family vpnv4 unicast
# vrf vrf1
# rd auto
# address-family ipv4 unicast
# dynamic-med interval 9
# redistribute connected metric 10
#
#
- name: Replace the provided configuration with the existing running configuration
cisco.iosxr.iosxr_bgp_address_family:
state: replaced
config:
as_number: '65536'
address_family:
- afi: ipv4
safi: unicast
vrf: vrf1
dynamic_med: 10
# Task output
# -------------
# commands:
# - router bgp 65536
# - vrf vrf1
# - address-family ipv4 unicast
# - dynamic-med interval 10
# - no redistribute connected metric 10
#
# after:
# as_number: "65536"
# address_family:
# - afi: "ipv4"
# safi: "unicast"
# vrf: vrf1
# dynamic_med: 10
# - afi: "ipv4"
# safi: "unicast"
# dynamic_med: 10
# redistribute:
# - protocol: application
# id: "test1"
# metric: 10
# bgp:
# scan_time: 20
# attribute_download: true
# advertise_best_external: true
# allocate_label:
# all: true
# After state:
# -------------
# RP/0/0/CPU0:iosxr-02#show running-config router bgp
# Sat Feb 20 03:49:43.618 UTC
# router bgp 65536
# bgp router-id 192.0.1.1
# address-family ipv4 unicast
# advertise best-external
# allocate-label all
# bgp attribute-download
# bgp scan-time 20
# address-family vpnv4 unicast
# vrf vrf1
# rd auto
# address-family ipv4 unicast
# dynamic-med interval 10
#
#
# Using overridden
# Before state:
# -------------
# RP/0/0/CPU0:iosxr-02#show running-config router bgp
# Sat Feb 20 03:49:43.618 UTC
# router bgp 65536
# bgp router-id 192.0.1.1
# address-family ipv4 unicast
# advertise best-external
# allocate-label all
# bgp attribute-download
# bgp scan-time 20
# address-family vpnv4 unicast
# vrf vrf1
# rd auto
# address-family ipv4 unicast
# dynamic-med interval 9
# redistribute connected metric 10
#
#
- name: Override the provided configuration with the existing running configuration
cisco.iosxr.iosxr_bgp_address_family:
state: overridden
config:
as_number: '65536'
address_family:
- afi: ipv4
safi: unicast
vrf: vrf1
dynamic_med: 10
# Task output
# -------------
# commands:
# - router bgp 65536
# - no address-family ipv4 unicast
# - vrf vrf1
# - address-family ipv4 unicast
# - dynamic-med interval 10
# - no redistribute connected metric 10
#
#
# after:
# as_number: "65536"
# address_family:
# - afi: "ipv4"
# safi: "unicast"
# vrf: vrf1
# dynamic_med: 10
#
# After state:
# -------------
# RP/0/0/CPU0:iosxr-02#show running-config router bgp
# Sat Feb 20 03:49:43.618 UTC
# router bgp 65536
# bgp router-id 192.0.1.1
# address-family vpnv4 unicast
# vrf vrf1
# rd auto
# address-family ipv4 unicast
# dynamic-med interval 10
#
#
# Using deleted
# Before state:
# -------------
# RP/0/0/CPU0:iosxr-02#show running-config router bgp
# Sat Feb 20 03:49:43.618 UTC
# router bgp 65536
# bgp router-id 192.0.1.1
# address-family ipv4 unicast
# advertise best-external
# allocate-label all
# bgp attribute-download
# bgp scan-time 20
# address-family vpnv4 unicast
# vrf vrf1
# rd auto
# address-family ipv4 unicast
# dynamic-med interval 9
# redistribute connected metric 10
#
#
- name: Delete the provided configuration
cisco.iosxr.iosxr_bgp_address_family:
state: deleted
config:
# Task output
# -------------
# commands:
# - router bgp 65536
# - no address-family ipv4 unicast
# - vrf vrf1
# - no address-family ipv4 unicast
#
#
# after:
# as_number: "65536"
#
#
# After state:
# -------------
# RP/0/0/CPU0:iosxr-02#show running-config router bgp
# Sat Feb 20 03:49:43.618 UTC
# router bgp 65536
# bgp router-id 192.0.1.1
# address-family vpnv4 unicast
# vrf vrf1
# rd auto
#
# Using rendered
# -------------
#
- name: rendered state example
cisco.iosxr.iosxr_bgp_address_family:
state: rendered
config:
as_number: '65536'
address_family:
- afi: ipv4
safi: unicast
vrf: vrf1
dynamic_med: 9
redistribute:
- protocol: connected
metric: 10
- afi: ipv4
safi: unicast
dynamic_med: 10
redistribute:
- protocol: application
id: test1
metric: 10
bgp:
scan_time: 20
attribute_download: true
advertise_best_external: true
allocate_label:
all: true
# Task output
# -------------
# commands:
# - router bgp 65536
# - address-family ipv4 unicast
# - advertise best-external
# - allocate-label all
# - bgp attribute-download
# - bgp scan-time 20
# - dynamic-med interval 10
# - redistribute application test1 metric 10
# - vrf vrf1
# - address-family ipv4 unicast
# - dynamic-med interval 9
# - redistribute connected metric 10
#
# Using gathered
# -------------
- name: Gather existing running configuration
cisco.iosxr.iosxr_bgp_address_family:
state: gathered
config:
as_number: '65536'
address_family:
- afi: ipv4
safi: unicast
vrf: vrf1
dynamic_med: 9
redistribute:
- protocol: connected
metric: 10
- afi: ipv4
safi: unicast
dynamic_med: 10
redistribute:
- protocol: application
id: test1
metric: 10
bgp:
scan_time: 20
attribute_download: true
advertise_best_external: true
allocate_label:
all: true
# gathered:
# as_number: "65536"
# address_family:
# - afi: "ipv4"
# safi: "unicast"
# vrf: vrf1
# dynamic_med: 9
# redistribute:
# - protocol: connected
# metric: 10
# - afi: "ipv4"
# safi: "unicast"
# dynamic_med: 10
# redistribute:
# - protocol: application
# id: "test1"
# metric: 10
# bgp:
# scan_time: 20
# attribute_download: true
# advertise_best_external: true
# allocate_label:
# all: true
#
# Using parsed
#
# parsed.cfg
# ------------
# router bgp 65536
# bgp router-id 192.0.1.1
# address-family ipv4 unicast
# advertise best-external
# allocate-label all
# bgp attribute-download
# bgp scan-time 20
# address-family vpnv4 unicast
# vrf vrf1
# rd auto
# address-family ipv4 unicast
# dynamic-med interval 9
# redistribute connected metric 10
#
- name: Parse externally provided BGP neighbor AF config
cisco.iosxr.iosxr_bgp_address_family:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Task output (redacted)
# -----------------------
# parsed:
# as_number: "65536"
# address_family:
# - afi: "ipv4"
# safi: "unicast"
# vrf: vrf1
# dynamic_med: 9
# redistribute:
# - protocol: connected
# metric: 10
# - afi: "ipv4"
# safi: "unicast"
# dynamic_med: 10
# redistribute:
# - protocol: application
# id: "test1"
# metric: 10
# bgp:
# scan_time: 20
# attribute_download: true
# advertise_best_external: true
# allocate_label:
# all: true