cisco.ios.ios_bgp_address_family – BGP Address family resource module
Note
This plugin is part of the cisco.ios collection (version 2.6.0).
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.ios
.
To use it in a playbook, specify: cisco.ios.ios_bgp_address_family
.
New in version 1.2.0: of cisco.ios
Parameters
Parameter |
Comments |
---|---|
A list of configurations for bgp address family. |
|
A list of configurations for bgp address family. |
|
Address Family Choices:
|
|
Configure BGP aggregate entries |
|
Aggregate address(A.B.C.D) |
|
Set condition to advertise attribute |
|
Generate AS confed set path information Choices:
|
|
Generate AS set path information Choices:
|
|
Set attributes of aggregate |
|
Aggregate mask(A.B.C.D) |
|
Filter more specific routes from updates Choices:
|
|
Conditionally filter more specific routes from updates |
|
Enable automatic network number summarization Choices:
|
|
Configure BGP aggregate entries |
|
Additional paths in the BGP table |
|
Receive additional paths from neighbors Choices:
|
|
Selection criteria to pick the paths |
|
Select all available paths Choices:
|
|
Select best N paths (2-3). |
|
Select group-best path Choices:
|
|
Send additional paths to neighbors Choices:
|
|
Configure Aggregation Timer Please refer vendor documentation for valid values |
|
Enable route-flap dampening |
|
Maximum duration to suppress a stable route Please refer vendor documentation for valid values |
|
Half-life time for the penalty Please refer vendor documentation for valid values |
|
Value to start reusing a route Please refer vendor documentation for valid values |
|
Route-map to specify criteria for dampening |
|
Value to start suppressing a route Please refer vendor documentation for valid values |
|
Use DMZ Link Bandwidth as weight for BGP multipaths Choices:
|
|
Nexthop tracking commands |
|
Route map for valid nexthops |
|
Nexthop triggering |
|
Set the delay to tigger nexthop tracking Please refer vendor documentation for valid values |
|
Enable nexthop tracking Choices:
|
|
Allow redistribution of iBGP into IGPs (dangerous) Choices:
|
|
route-map control commands Have route-map set commands take priority over BGP commands such as next-hop unchanged Choices:
|
|
Configure background scanner interval Please refer vendor documentation for valid values |
|
Nexthop triggering |
|
Slow-peer detection |
|
Enable slow-peer detection Choices:
|
|
Set the slow-peer detection threshold Threshold value (seconds) Please refer vendor documentation for valid values |
|
Configure slow-peer split-update-group |
|
Dynamically split the slow peer to slow-update group Choices:
|
|
Keep the slow-peer permanently in slow-update group Choices:
|
|
Use soft-reconfiguration inbound only when route-refresh is not negotiated Choices:
|
|
Manage peers in bgp update groups Split update groups based on Policy Keep peers with as-override in different update groups Choices:
|
|
Set a command to its defaults Choices:
|
|
Distribution of default information Distribute default route Choices:
|
|
Set metric of redistributed routes |
|
Define an administrative distance |
|
Distance for routes external to the AS |
|
Distance for routes internal to the AS |
|
Distance for local routes |
|
Specify a neighbor router |
|
Enable the Address Family for this Neighbor Choices:
|
|
Negotiate additional paths capabilities with this neighbor |
|
Disable additional paths for this neighbor Choices:
|
|
Receive additional paths from neighbors Choices:
|
|
Send additional paths to this neighbor Choices:
|
|
Neighbor address (A.B.C.D) |
|
Advertise to this neighbor Advertise additional paths |
|
Select all available paths Choices:
|
|
Select best N paths (2-3). |
|
Select group-best path Choices:
|
|
specify route-map for conditional advertisement |
|
advertise prefix only if prefix is in the condition exists condition route-map name |
|
advertise route-map name |
|
advertise prefix only if prefix in the condition does not exist condition route-map name |
|
Minimum interval between sending BGP routing updates |
|
Enable a AIGP on neighbor |
|
Enable a AIGP on neighbor |
|
Cost community or MED carrying AIGP VALUE |
|
Cost extended community carrying AIGP Value |
|
Community ID Please refer vendor documentation for valid values |
|
Point of Insertion |
|
Point of Insertion After IGP Choices:
|
|
Point of Insertion At Beginning Choices:
|
|
Cost community is Transitive Choices:
|
|
Med carrying AIGP Value Choices:
|
|
Enable the policy support for this IBGP Neighbor Choices:
|
|
Accept as-path with my AS present in it Please refer vendor documentation for valid values |
|
Override matching AS-number while sending update |
|
Enable AS override Choices:
|
|
Maintain Split Horizon while sending update Choices:
|
|
Activate the BMP monitoring for a BGP peer |
|
Activate BMP monitoring for all servers Choices:
|
|
Activate BMP for server BMP Server Number Please refer vendor documentation for valid values |
|
Advertise capability to the peer Advertise ORF capability to the peer Advertise prefixlist ORF capability to this neighbor |
|
Capability to SEND and RECEIVE the ORF to/from this neighbor Choices:
|
|
Capability to RECEIVE the ORF from this neighbor Choices:
|
|
Capability to SEND the ORF to this neighbor Choices:
|
|
Configure Route-Reflector Cluster-id (peers may reset) Route-Reflector Cluster-id as 32 bit quantity, or Route-Reflector Cluster-id in IP address format (A.B.C.D) |
|
Originate default route to this neighbor |
|
Route-map to specify criteria to originate default |
|
Set default route to this neighbor Choices:
|
|
Neighbor specific description |
|
one-hop away EBGP peer using loopback address Choices:
|
|
Filter updates to/from this neighbor |
|
ACL id/name |
|
Filter incoming updates Choices:
|
|
Filter outgoing updates Choices:
|
|
Propagate the DMZ link bandwidth Choices:
|
|
Allow EBGP neighbors not on directly connected networks |
|
Allow EBGP neighbors not on directly connected networks Choices:
|
|
Maximum hop count Please refer vendor documentation for valid values |
|
Session fall on peer route lost |
|
Use BFD to detect failure |
|
Force BFD multi-hop to detect failure Choices:
|
|
set bfd Choices:
|
|
Force BFD single-hop to detect failure Choices:
|
|
Route map for peer route |
|
Establish BGP filters |
|
AS path access list Please refer vendor documentation for valid values |
|
Filter incoming updates Choices:
|
|
Filter outgoing updates Choices:
|
|
high availability mode |
|
disable graceful-restart Choices:
|
|
set ha-mode and graceful-restart for this peer Choices:
|
|
Inherit a template Inherit a peer-policy template |
|
Stack iBGP-CE Neighbor Path in ATTR_SET for vpn update Choices:
|
|
Neighbor ipv6 address (X:X:X:X::X) |
|
Specify a local-as number |
|
Accept either real AS or local AS from the ebgp peer Choices:
|
|
Do not prepend local-as to updates from ebgp peers |
|
Replace real AS with local AS in the EBGP updates Choices:
|
|
Set prepend Choices:
|
|
AS number used as local AS Please refer vendor documentation for valid values |
|
set local-as number Choices:
|
|
Log neighbor up/down and reset reason |
|
disable Log neighbor up/down and reset Choices:
|
|
set Log neighbor up/down and reset Choices:
|
|
Establish BGP filters |
|
maximum no. of prefix limit Please refer vendor documentation for valid values |
|
Restart bgp connection after limit is exceeded |
|
Threshold value (%) at which to generate a warning msg Please refer vendor documentation for valid values |
|
Only give warning message when limit is exceeded Choices:
|
|
Disable the next hop calculation for this neighbor This option is DEPRECATED and is replaced with nexthop_self which accepts dict as input this attribute will be removed after 2023-06-01. Choices:
|
|
Propagate next hop unchanged for iBGP paths to this neighbor Choices:
|
|
Disable the next hop calculation for this neighbor |
|
Enable next-hop-self for both eBGP and iBGP received paths Choices:
|
|
set the next hop self Choices:
|
|
Set a password |
|
BGP optional attribute filtering |
|
Discard matching path-attribute for this neighbor |
|
Perform inbound path-attribute filtering Choices:
|
|
path attribute range |
|
path attribute range end value Please refer vendor documentation for valid values |
|
path attribute range start value Please refer vendor documentation for valid values |
|
path attribute type Please refer vendor documentation for valid values |
|
Treat-as-withdraw matching path-attribute for this neighbor |
|
Perform inbound path-attribute filtering Choices:
|
|
path attribute range |
|
path attribute range end value Please refer vendor documentation for valid values |
|
path attribute range start value Please refer vendor documentation for valid values |
|
path attribute type Please refer vendor documentation for valid values |
|
Member of the peer-group Choices:
|
|
Filter updates to/from this neighbor This option is DEPRECATED and is replaced with prefix_lists which accepts list of dict as input |
|
Filter incoming updates Choices:
|
|
Name of a prefix list |
|
Filter outgoing updates Choices:
|
|
Filter updates to/from this neighbor |
|
Filter incoming updates Choices:
|
|
Name of a prefix list |
|
Filter outgoing updates Choices:
|
|
Specify a BGP neighbor AS of remote neighbor |
|
Remove private AS number from outbound updates |
|
Remove all private AS numbers Choices:
|
|
Replace all private AS numbers with local AS Choices:
|
|
Remove private AS number from outbound updates Choices:
|
|
Apply route map to neighbor This option is DEPRECATED and is replaced with route_maps which accepts list of dict as input |
|
Apply map to incoming routes Choices:
|
|
Name of route map |
|
Apply map to outbound routes Choices:
|
|
Apply route map to neighbor |
|
Apply map to incoming routes Choices:
|
|
Name of route map |
|
Apply map to outbound routes Choices:
|
|
Configure a neighbor as Route Reflector client Choices:
|
|
Configure a neighbor as Route Server client Choices:
|
|
Send Community attribute to this neighbor |
|
Send Standard and Extended Community attributes Choices:
|
|
Send Extended Community attribute Choices:
|
|
Send Standard Community attribute Choices:
|
|
Administratively shut down this neighbor |
|
Gracefully shut down this neighbor time in seconds Please refer vendor documentation for valid values |
|
shut down Choices:
|
|
Configure slow-peer |
|
Configure slow-peer |
|
Disable slow-peer detection Choices:
|
|
Enable slow-peer detection Choices:
|
|
Set the slow-peer detection threshold |
|
Configure slow-peer |
|
Configure slow-peer |
|
Configure slow-peer Choices:
|
|
Configure slow-peer Choices:
|
|
Configure slow-peer Choices:
|
|
Configure slow-peer Choices:
|
|
Per neighbor soft reconfiguration Allow inbound soft reconfiguration for this neighbor Choices:
|
|
Site-of-Origin extended community |
|
Neighbor tag |
|
BGP per neighbor timers |
|
Holdtime |
|
Keepalive interval |
|
Minimum hold time from neighbor |
|
Transport options |
|
Specify passive or active connection |
|
Actively establish the TCP session Choices:
|
|
Passively establish the TCP session Choices:
|
|
Use Multi-session for transport Choices:
|
|
Use transport path MTU discovery |
|
disable Choices:
|
|
Use path MTU discovery Choices:
|
|
BGP ttl security check maximum number of hops Please refer vendor documentation for valid values |
|
Route-map to selectively unsuppress suppressed routes |
|
Set the BGP version to match a neighbor Neighbor’s BGP version Please refer vendor documentation for valid values |
|
Set default weight for routes from this neighbor |
|
Specify a network to announce via BGP |
|
Network number (A.B.C.D) |
|
Specify a BGP backdoor route Choices:
|
|
Network mask (A.B.C.D) |
|
Route-map to modify the attributes |
|
Redistribute information from another routing protocol |
|
Application |
|
Metric for redistributed routes |
|
Application name |
|
Route map reference |
|
Border Gateway Protocol (BGP) |
|
Autonomous system number |
|
Metric for redistributed routes |
|
Route map reference |
|
Connected |
|
Metric for redistributed routes |
|
Route map reference |
|
Enhanced Interior Gateway Routing Protocol (EIGRP) |
|
Autonomous system number |
|
Metric for redistributed routes |
|
Route map reference |
|
ISO IS-IS |
|
ISO routing area tag |
|
Redistribution of OSI dynamic routes Choices:
|
|
Redistribution of IP dynamic routes Choices:
|
|
Metric for redistributed routes |
|
Route map reference |
|
IGRP for OSI networks |
|
ISO routing area tag |
|
Route map reference |
|
Locator ID Separation Protocol (LISP) |
|
Metric for redistributed routes |
|
Route map reference |
|
Mobile routes |
|
Metric for redistributed routes |
|
Route map reference |
|
On Demand stub Routes |
|
Metric for redistributed routes |
|
Route map reference |
|
Open Shortest Path First (OSPF) |
|
On Demand stub Routes |
|
Redistribute OSPF external routes Choices:
|
|
Redistribute OSPF internal routes Choices:
|
|
Redistribute OSPF NSSA external routes Choices:
|
|
Redistribute NSSA external type 1 routes Choices:
|
|
Redistribute NSSA external type 2 routes Choices:
|
|
Metric for redistributed routes |
|
Process ID |
|
Route map reference |
|
VPN Routing/Forwarding Instance |
|
OSPFv3 |
|
On Demand stub Routes |
|
Redistribute OSPF external routes Choices:
|
|
Redistribute OSPF internal routes Choices:
|
|
Redistribute OSPF NSSA external routes Choices:
|
|
Redistribute NSSA external type 1 routes Choices:
|
|
Redistribute NSSA external type 2 routes Choices:
|
|
Metric for redistributed routes |
|
Process ID |
|
Route map reference |
|
Routing Information Protocol (RIP) |
|
Metric for redistributed routes |
|
Route map reference |
|
Static routes |
|
Redistribution of OSI static routes Choices:
|
|
Redistribution of IP static routes Choices:
|
|
Metric for redistributed routes |
|
Route map reference |
|
Specify a source VRF |
|
global VRF Choices:
|
|
Source VRF name |
|
Address Family modifier Choices:
|
|
Modify snmp parameters |
|
Configure a SNMP context Context Name |
|
Configure a SNMP v2c Community string and access privs |
|
Standard IP accesslist allowing access with this community string Expanded IP accesslist allowing access with this community string Access-list name |
|
Specify IPv6 Named Access-List IPv6 Access-list name |
|
Read-only access with this community string Choices:
|
|
Read-write access with this community string Choices:
|
|
SNMP community string |
|
Context Name |
|
Configure a SNMP v3 user |
|
specify an access-list associated with this group |
|
SNMP community string |
|
Specify IPv6 Named Access-List IPv6 Access-list name |
|
authentication parameters for the user |
|
Use HMAC MD5 algorithm for authentication authentication password for user |
|
Use HMAC SHA algorithm for authentication authentication password for user |
|
If the user password is already configured and saved Choices:
|
|
specifying passwords as MD5 or SHA digests Choices:
|
|
SNMP community string |
|
encryption parameters for the user |
|
Use 56 bit DES algorithm for encryption |
|
Map external entry attributes into routing table |
|
Selective route download Choices:
|
|
route-map name |
|
Specify parameters for a VPN Routing/Forwarding instance |
|
Autonomous system number. |
|
This option is used only with state parsed. The value of this option should be the output received from the IOS device by executing the command sh running-config | section ^router bgp. The state parsed reads the configuration from |
|
The state the configuration should be left in The states rendered, gathered and parsed does not perform any change on the device. The state rendered will transform the configuration in The state gathered will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the gathered key within the result. The state parsed reads the configuration from Choices:
|
Notes
Note
Tested against Cisco IOSv Version 15.2 on VIRL
This module works with connection
network_cli
. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html
Examples
# Using merged
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
- name: Merge provided configuration with device configuration
cisco.ios.ios_bgp_address_family:
config:
as_number: 65000
address_family:
- afi: ipv4
safi: multicast
vrf: blue
aggregate_address:
- address: 192.0.2.1
netmask: 255.255.255.255
as_confed_set: true
bgp:
aggregate_timer: 10
dampening:
penalty_half_time: 1
reuse_route_val: 1
suppress_route_val: 1
max_suppress: 1
slow_peer:
- detection:
threshold: 150
neighbor:
- address: 198.51.100.1
aigp:
send:
cost_community:
id: 100
poi:
igp_cost: true
transitive: true
slow_peer:
- detection:
threshold: 150
remote_as: 10
route_map:
- name: test-route-out
out: true
- name: test-route-in
in: true
route_server_client: true
network:
- address: 198.51.110.10
mask: 255.255.255.255
backdoor: true
snmp:
context:
name: snmp_con
community:
snmp_community: community
ro: true
acl: 10
- afi: ipv4
safi: mdt
bgp:
dmzlink_bw: true
dampening:
penalty_half_time: 1
reuse_route_val: 10
suppress_route_val: 100
max_suppress: 5
soft_reconfig_backup: true
- afi: ipv4
safi: multicast
aggregate_address:
- address: 192.0.3.1
netmask: 255.255.255.255
as_confed_set: true
default_metric: 12
distance:
external: 10
internal: 10
local: 100
network:
- address: 198.51.111.11
mask: 255.255.255.255
route_map: test
table_map:
name: test_tableMap
filter: true
state: merged
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "address-family ipv4 multicast vrf blue",
# "bgp aggregate-timer 10",
# "bgp slow-peer detection threshold 150",
# "bgp dampening 1 1 1 1",
# "neighbor 198.51.100.1 remote-as 10",
# "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "neighbor 198.51.100.1 route-map test-route out",
# "neighbor 198.51.100.1 route-server-client",
# "neighbor 198.51.100.1 slow-peer detection threshold 150",
# "network 198.51.110.10 mask 255.255.255.255 backdoor",
# "snmp context snnmp_con_1 community community ro 10",
# "aggregate-address 192.0.2.1 255.255.255.255 as-confed-set",
# "exit-address-family",
# "address-family ipv4 mdt",
# "bgp dmzlink-bw",
# "bgp dampening 1 10 100 5",
# "bgp soft-reconfig-backup",
# "exit-address-family",
# "address-family ipv4 multicast",
# "network 1.1.1.1 mask 255.255.255.255 route-map test",
# "aggregate-address 192.0.3.1 255.255.255.255 as-confed-set",
# "default-metric 12",
# "distance bgp 10 10 100",
# "table-map test_tableMap filter"
# "exit-address-family",
# ]
# After state:
# ------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 1.1.1.1 mask 255.255.255.255 route-map test
# aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# default-metric 12
# distance bgp 10 10 100
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.100.1 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-server-client
# neighbor 198.51.100.1 slow-peer detection threshold 150
# neighbor 198.51.100.1 route-map test-route out
# exit-address-family
# Using replaced
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 1.1.1.1 mask 255.255.255.255 route-map test
# aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# default-metric 12
# distance bgp 10 10 100
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.100.1 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-server-client
# neighbor 198.51.100.1 slow-peer detection threshold 150
# neighbor 198.51.100.1 route-map test-route out
# exit-address-family
- name: Replaces device configuration of listed AF BGP with provided configuration
cisco.ios.ios_bgp_address_family:
config:
as_number: 65000
address_family:
- afi: ipv4
safi: multicast
vrf: blue
aggregate_address:
- address: 192.0.2.1
netmask: 255.255.255.255
as_confed_set: true
bgp:
aggregate_timer: 10
dampening:
penalty_half_time: 1
reuse_route_val: 1
suppress_route_val: 1
max_suppress: 1
slow_peer:
- detection:
threshold: 150
neighbor:
- address: 198.51.110.1
activate: true
aigp:
send:
cost_community:
id: 200
poi:
igp_cost: true
transitive: true
slow_peer:
- detection:
threshold: 150
remote_as: 10
route_maps:
- name: test-replaced-route
out: true
route_server_client: true
network:
- address: 198.51.110.10
mask: 255.255.255.255
backdoor: true
- afi: ipv4
safi: multicast
bgp:
aggregate_timer: 10
dampening:
penalty_half_time: 10
reuse_route_val: 10
suppress_route_val: 10
max_suppress: 10
slow_peer:
- detection:
threshold: 200
network:
- address: 192.0.2.1
mask: 255.255.255.255
route_map: test
state: replaced
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "address-family ipv4 multicast vrf blue",
# "neighbor 198.51.110.1 remote-as 10",
# "neighbor 198.51.110.1 activate",
# "neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive",
# "neighbor 198.51.110.1 route-map test-replaced-route out",
# "neighbor 198.51.110.1 route-server-client",
# "neighbor 198.51.110.1 slow-peer detection threshold 150",
# "no neighbor 198.51.100.1 remote-as 10",
# "no neighbor 198.51.100.1 activate",
# "no neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "no neighbor 198.51.100.1 route-map test-route out",
# "no neighbor 198.51.100.1 route-server-client",
# "no neighbor 198.51.100.1 slow-peer detection threshold 150",
# "exit-address-family",
# "address-family ipv4 multicast",
# "bgp aggregate-timer 10",
# "bgp slow-peer detection threshold 200",
# "bgp dampening 10 10 10 10",
# "network 192.0.2.1 mask 255.255.255.255 route-map test",
# "no network 1.1.1.1 mask 255.255.255.255 route-map test",
# "no aggregate-address 192.0.3.1 255.255.255.255 as-confed-set",
# "no default-metric 12",
# "no distance bgp 10 10 100",
# "no table-map test_tableMap filter"
# "exit-address-family",
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 200
# bgp dampening 10 10 10 10
# network 192.0.2.1 mask 255.255.255.255 route-map test
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.110.1 remote-as 10
# neighbor 198.51.110.1 activate
# neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive
# neighbor 198.51.110.1 route-server-client
# neighbor 198.51.110.1 slow-peer detection threshold 150
# neighbor 198.51.110.1 route-map test-replaced-route out
# exit-address-family
# Using overridden
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 1.1.1.1 mask 255.255.255.255 route-map test
# aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# default-metric 12
# distance bgp 10 10 100
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.100.1 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-server-client
# neighbor 198.51.100.1 slow-peer detection threshold 150
# neighbor 198.51.100.1 route-map test-route out
# exit-address-family
- name: Override device configuration of all AF BGP with provided configuration
cisco.ios.ios_bgp_address_family:
config:
as_number: 65000
address_family:
- afi: ipv4
safi: multicast
vrf: blue
aggregate_address:
- address: 192.0.2.1
netmask: 255.255.255.255
as_confed_set: true
bgp:
aggregate_timer: 10
dampening:
penalty_half_time: 10
reuse_route_val: 10
suppress_route_val: 100
max_suppress: 50
slow_peer:
- detection:
threshold: 150
neighbor:
- address: 198.51.110.1
activate: true
log_neighbor_changes:
disable: true
maximum_prefix:
number: 1
threshold_value: 10
restart: 100
slow_peer:
- detection:
threshold: 150
remote_as: 100
route_maps:
- name: test-override-route
out: true
route_server_client: true
version: 4
network:
- address: 198.51.110.10
mask: 255.255.255.255
backdoor: true
- afi: ipv6
safi: multicast
default_information: true
bgp:
aggregate_timer: 10
dampening:
penalty_half_time: 10
reuse_route_val: 10
suppress_route_val: 10
max_suppress: 10
slow_peer:
- detection:
threshold: 200
network:
- address: 2001:DB8:0:3::/64
route_map: test_ipv6
state: overridden
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "no address-family ipv4 multicast",
# "no address-family ipv4 mdt",
# "address-family ipv4 multicast vrf blue",
# "bgp aggregate-timer 10",
# "bgp slow-peer detection threshold 150",
# "bgp dampening 10 10 100 50",
# "neighbor 198.51.110.1 remote-as 100",
# "neighbor 198.51.110.1 activate",
# "neighbor 198.51.110.1 log-neighbor-changes disable",
# "neighbor 198.51.110.1 maximum-prefix 1 10 restart 100",
# "neighbor 198.51.110.1 route-map test-override-route out",
# "neighbor 198.51.110.1 route-server-client",
# "neighbor 198.51.110.1 version 4",
# "neighbor 198.51.110.1 slow-peer detection threshold 150",
# "network 198.51.110.10 mask 255.255.255.255 backdoor",
# "aggregate-address 192.0.2.1 255.255.255.255 as-confed-set",
# "exit-address-family",
# "address-family ipv6 multicast",
# "bgp aggregate-timer 10",
# "bgp slow-peer detection threshold 200",
# "bgp dampening 10 10 10 10",
# "network 2001:DB8:0:3::/64 route-map test_ipv6"
# "exit-address-family",
# ]
# 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
# snmp context snnmp_con_1 community community RO 10
# neighbor 192.0.2.1 remote-as 100
# neighbor 192.0.2.1 description replace neighbor
# neighbor 198.51.100.1 remote-as 10
# !
# address-family ipv6 multicast
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 200
# bgp dampening 10 10 10 10
# network 2001:DB8:0:3::/64 route-map test_ipv6
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 10 10 100 50
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.110.1 remote-as 100
# neighbor 198.51.110.1 log-neighbor-changes disable
# neighbor 198.51.110.1 version 4
# neighbor 198.51.110.1 activate
# neighbor 198.51.110.1 route-server-client
# neighbor 198.51.110.1 slow-peer detection threshold 150
# neighbor 198.51.110.1 route-map test-override-route out
# neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
# exit-address-family
# Using Deleted
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 1.1.1.1 mask 255.255.255.255 route-map test
# aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# default-metric 12
# distance bgp 10 10 100
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.100.1 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-server-client
# neighbor 198.51.100.1 slow-peer detection threshold 150
# neighbor 198.51.100.1 route-map test-route out
# exit-address-family
- name: "Delete AF BGP (Note: This won't delete the all configured AF BGP)"
cisco.ios.ios_bgp_address_family:
config:
as_number: 65000
address_family:
- afi: ipv4
safi: multicast
- afi: ipv4
safi: mdt
state: deleted
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "no address-family ipv4 multicast",
# "no address-family ipv4 mdt"
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bg
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.100.1 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-server-client
# neighbor 198.51.100.1 slow-peer detection threshold 150
# neighbor 198.51.100.1 route-map test-route out
# exit-address-family
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured AF BGP)"
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 1.1.1.1 mask 255.255.255.255 route-map test
# aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# default-metric 12
# distance bgp 10 10 100
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.100.1 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-server-client
# neighbor 198.51.100.1 slow-peer detection threshold 150
# neighbor 198.51.100.1 route-map test-route out
# exit-address-family
- name: 'Delete ALL of configured AF BGP (Note: This WILL delete the all configured
AF BGP)'
cisco.ios.ios_bgp_address_family:
state: deleted
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "no address-family ipv4 multicast vrf blue",
# "no address-family ipv4 multicast",
# "no address-family ipv4 mdt"
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# Using Gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
- name: Gather listed AF BGP with provided configurations
cisco.ios.ios_bgp_address_family:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": {
# "address_family": [
# {
# "afi": "ipv4",
# "aggregate_address": [{
# "address": "192.0.2.1",
# "as_confed_set": true,
# "netmask": "255.255.255.255"
# }],
# "bgp": {
# "aggregate_timer": 10,
# "dampening": {
# "max_suppress": 1,
# "penalty_half_time": 1,
# "reuse_route_val": 1,
# "suppress_route_val": 1
# },
# "slow_peer": [
# {
# "detection": {
# "threshold": 150
# }
# }
# ]
# },
# "neighbor": [
# {
# "activate": true,
# "address": "198.51.100.1",
# "aigp": {
# "send": {
# "cost_community": {
# "id": 100,
# "poi": {
# "igp_cost": true,
# "transitive": true
# }
# }
# }
# },
# "remote_as": 10,
# "route_maps": [{
# "name": "test-route",
# "out": true
# }],
# "route_server_client": true,
# "slow_peer": [
# {
# "detection": {
# "threshold": 150
# }
# }
# ]
# }
# ],
# "network": [
# {
# "address": "198.51.110.10",
# "backdoor": true,
# "mask": "255.255.255.255"
# }
# ],
# "safi": "multicast",
# "snmp": {
# "context": {
# "community": {
# "acl": "10",
# "ro": true,
# "snmp_community": "community"
# },
# "name": "snnmp_con_1"
# }
# },
# "vrf": "blue"
# },
# {
# "afi": "ipv4",
# "aggregate_address": [{
# "address": "192.0.3.1",
# "as_confed_set": true,
# "netmask": "255.255.255.255"
# }],
# "default_metric": 12,
# "distance": {
# "external": 10,
# "internal": 10,
# "local": 100
# },
# "network": [
# {
# "address": "1.1.1.1",
# "mask": "255.255.255.255",
# "route_map": "test"
# }
# ],
# "safi": "multicast",
# "table_map": {
# "filter": true,
# "name": "test_tableMap"
# }
# },
# {
# "afi": "ipv4",
# "bgp": {
# "dampening": {
# "max_suppress": 5,
# "penalty_half_time": 1,
# "reuse_route_val": 10,
# "suppress_route_val": 100
# },
# "dmzlink_bw": true,
# "soft_reconfig_backup": true
# },
# "safi": "mdt"
# }
# ],
# "as_number": "65000"
# }
# Using Rendered
- name: Rendered the provided configuration with the existing running configuration
cisco.ios.ios_bgp_address_family:
config:
as_number: 65000
address_family:
- afi: ipv4
safi: multicast
vrf: blue
aggregate_address:
- address: 192.0.2.1
netmask: 255.255.255.255
as_confed_set: true
bgp:
aggregate_timer: 10
dampening:
penalty_half_time: 1
reuse_route_val: 1
suppress_route_val: 1
max_suppress: 1
slow_peer:
- detection:
threshold: 150
neighbor:
- address: 198.51.100.1
aigp:
send:
cost_community:
id: 100
poi:
igp_cost: true
transitive: true
slow_peer:
- detection:
threshold: 150
remote_as: 10
route_maps:
- name: test-route
out: true
route_server_client: true
network:
- address: 198.51.110.10
mask: 255.255.255.255
backdoor: true
snmp:
context:
name: snmp_con
community:
snmp_community: community
ro: true
acl: 10
- afi: ipv4
safi: mdt
bgp:
dmzlink_bw: true
dampening:
penalty_half_time: 1
reuse_route_val: 10
suppress_route_val: 100
max_suppress: 5
soft_reconfig_backup: true
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "router bgp 65000",
# "address-family ipv4 multicast vrf blue",
# "bgp aggregate-timer 10",
# "bgp slow-peer detection threshold 150",
# "bgp dampening 1 1 1 1",
# "neighbor 198.51.100.1 remote-as 10",
# "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "neighbor 198.51.100.1 route-map test-route out",
# "neighbor 198.51.100.1 route-server-client",
# "neighbor 198.51.100.1 slow-peer detection threshold 150",
# "network 198.51.110.10 mask 255.255.255.255 backdoor",
# "snmp context snnmp_con_1 community community ro 10",
# "aggregate-address 192.0.2.1 255.255.255.255 as-confed-set",
# "exit-address-family",
# "address-family ipv4 mdt",
# "bgp dmzlink-bw",
# "bgp dampening 1 10 100 5",
# "bgp soft-reconfig-backup"
# "exit-address-family",
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 1.1.1.1 mask 255.255.255.255 route-map test
# aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# default-metric 12
# distance bgp 10 10 100
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
- name: Parse the commands for provided configuration
cisco.ios.ios_bgp_address_family:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": {
# "address_family": [
# {
# "afi": "ipv4",
# "aggregate_address": [{
# "address": "192.0.3.1",
# "as_confed_set": true,
# "netmask": "255.255.255.255"
# }],
# "default_metric": 12,
# "distance": {
# "external": 10,
# "internal": 10,
# "local": 100
# },
# "network": [
# {
# "address": "1.1.1.1",
# "mask": "255.255.255.255",
# "route_map": "test"
# }
# ],
# "safi": "multicast",
# "table_map": {
# "filter": true,
# "name": "test_tableMap"
# }
# },
# {
# "afi": "ipv4",
# "bgp": {
# "dampening": {
# "max_suppress": 5,
# "penalty_half_time": 1,
# "reuse_route_val": 10,
# "suppress_route_val": 100
# },
# "dmzlink_bw": true,
# "soft_reconfig_backup": true
# },
# "safi": "mdt"
# }
# ],
# "as_number": "65000"
# }
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: “This output will always be in the same format as the module argspec.\n” |
|
The configuration prior to the module execution. Returned: when state is Sample: “This output will always be in the same format as the module argspec.\n” |
|
The set of commands pushed to the remote device. Returned: when state is Sample: [“router bgp 65000”, “address-family ipv4 multicast”, “table-map test_tableMap filter”, “network 1.1.1.1 mask 255.255.255.255 route-map test”, “aggregate-address 192.0.3.1 255.255.255.255 as-confed-set”] |
|
Facts about the network resource gathered from the remote device as structured data. Returned: when state is Sample: “This output will always be in the same format as the module argspec.\n” |
|
The device native config provided in running_config option parsed into structured data as per module argspec. Returned: when state is Sample: “This output will always be in the same format as the module argspec.\n” |
|
The provided configuration in the task rendered in device-native format (offline). Returned: when state is Sample: [“router bgp 65000”, “address-family ipv4 multicast”, “table-map test_tableMap filter”, “network 1.1.1.1 mask 255.255.255.255 route-map test”, “aggregate-address 192.0.3.1 255.255.255.255 as-confed-set”] |
Authors
Sumit Jaiswal (@justjais)