Resource module to configure BGP Address family.
Version added: 1.2.0
- This module configures and manages the attributes of bgp address family on Cisco IOS.
Note
- Tested against Cisco IOS-XE Version 17.3 on CML.
- This module works with connection
network_cli
. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html - The module examples uses callback plugin (stdout_callback = yaml) to generate task output in yaml format.
# 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
# Task Output:
# ------------
#
# before: {}
# commands:
# - router bgp 65000
# - address-family ipv4 multicast vrf blue
# - bgp aggregate-timer 10
# - bgp dampening 1 1 1 1
# - bgp slow-peer detection threshold 150
# - snmp context snmp_con community community ro 10
# - 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 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
# - address-family ipv4 multicast
# - default-metric 12
# - distance bgp 10 10 100
# - table-map test_tableMap filter
# - network 198.51.111.11 mask 255.255.255.255 route-map test
# - aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# - address-family ipv4 mdt
# - bgp dmzlink-bw
# - bgp soft-reconfig-backup
# - bgp dampening 1 10 100 5
# after:
# address_family:
# - afi: ipv4
# aggregate_addresses:
# - 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_options:
# detection:
# threshold: 150
# neighbors:
# - activate: true
# aigp:
# send:
# cost_community:
# id: 100
# poi:
# igp_cost: true
# transitive: true
# neighbor_address: 198.51.100.1
# slow_peer_options:
# detection:
# threshold: 150
# networks:
# - address: 198.51.110.10
# backdoor: true
# mask: 255.255.255.255
# snmp:
# context:
# community:
# acl: '10'
# ro: true
# snmp_community: community
# name: snmp_con
# - afi: ipv4
# aggregate_addresses:
# - address: 192.0.3.1
# as_confed_set: true
# netmask: 255.255.255.255
# default_metric: 12
# distance:
# external: 10
# internal: 10
# local: 100
# networks:
# - address: 198.51.111.11
# 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'
# After state:
# ------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# snmp context snmp_con community community RO 10
# neighbor 198.51.100.1 remote-as 10
# !
# address-family ipv4
# snmp context snmp_con community community RO 10
# 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 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 slow-peer detection threshold 150
# exit-address-family
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 198.51.111.11 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
# Using replaced
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# snmp context snmp_con community community RO 10
# neighbor 198.51.100.1 remote-as 10
# !
# address-family ipv4
# snmp context snmp_con community community RO 10
# 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 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 slow-peer detection threshold 150
# exit-address-family
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 198.51.111.11 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: 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
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
# Task Output:
# ------------
# before:
# address_family:
# - afi: ipv4
# aggregate_addresses:
# - 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_options:
# detection:
# threshold: 150
# neighbors:
# - activate: true
# aigp:
# send:
# cost_community:
# id: 100
# poi:
# igp_cost: true
# transitive: true
# neighbor_address: 198.51.100.1
# slow_peer_options:
# detection:
# threshold: 150
# networks:
# - address: 198.51.110.10
# backdoor: true
# mask: 255.255.255.255
# snmp:
# context:
# community:
# acl: '10'
# ro: true
# snmp_community: community
# name: snmp_con
# - afi: ipv4
# aggregate_addresses:
# - address: 192.0.3.1
# as_confed_set: true
# netmask: 255.255.255.255
# default_metric: 12
# distance:
# external: 10
# internal: 10
# local: 100
# networks:
# - address: 198.51.111.11
# 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'
# commands:
# - router bgp 65000
# - address-family ipv4 multicast vrf blue
# - bgp aggregate-timer 10
# - bgp dampening 1 1 1 1
# - bgp slow-peer detection threshold 150
# - 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 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
# - address-family ipv4 multicast
# - no default-metric 12
# - no distance bgp 10 10 100
# - no table-map test_tableMap filter
# - bgp aggregate-timer 10
# - bgp dampening 10 10 10 10
# - bgp slow-peer detection threshold 200
# - network 192.0.2.1 mask 255.255.255.255 route-map test
# - no network 198.51.111.11 mask 255.255.255.255 route-map test
# - no aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# after:
# address_family:
# - afi: ipv4
# aggregate_addresses:
# - 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_options:
# detection:
# threshold: 150
# neighbors:
# - activate: true
# aigp:
# send:
# cost_community:
# id: 100
# poi:
# igp_cost: true
# transitive: true
# neighbor_address: 198.51.100.1
# slow_peer_options:
# detection:
# threshold: 150
# - activate: true
# aigp:
# send:
# cost_community:
# id: 200
# poi:
# igp_cost: true
# transitive: true
# neighbor_address: 198.51.110.1
# slow_peer_options:
# detection:
# threshold: 150
# networks:
# - address: 198.51.110.10
# backdoor: true
# mask: 255.255.255.255
# snmp:
# context:
# community:
# acl: '10'
# ro: true
# snmp_community: community
# name: snmp_con
# - afi: ipv4
# bgp:
# aggregate_timer: 10
# dampening:
# max_suppress: 10
# penalty_half_time: 10
# reuse_route_val: 10
# suppress_route_val: 10
# slow_peer_options:
# detection:
# threshold: 200
# networks:
# - address: 192.0.2.1
# mask: 255.255.255.255
# route_map: test
# safi: multicast
# - 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'
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# snmp context snmp_con community community RO 10
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.110.1 remote-as 10
# !
# address-family ipv4
# snmp context snmp_con community community RO 10
# 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 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 slow-peer detection threshold 150
# 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 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
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# Using overridden
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# snmp context snmp_con community community RO 10
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.110.1 remote-as 10
# !
# address-family ipv4
# snmp context snmp_con community community RO 10
# 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 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 slow-peer detection threshold 150
# 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 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
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# 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
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
# Task Output:
# ------------
#
# before:
# address_family:
# - afi: ipv4
# aggregate_addresses:
# - address: 192.0.2.1
# as_confed_set: true
# netmask: 255.255.255.255
# bgp:
# aggregate_timer: 10
# dampening:
# max_suppress: 10
# penalty_half_time: 10
# reuse_route_val: 10
# suppress_route_val: 10
# slow_peer_options:
# detection:
# threshold: 200
# default_information: true
# neighbors:
# - activate: true
# aigp:
# send:
# cost_community:
# id: 100
# poi:
# igp_cost: true
# transitive: true
# neighbor_address: 198.51.100.1
# slow_peer_options:
# detection:
# threshold: 150
# - activate: true
# aigp:
# send:
# cost_community:
# id: 200
# poi:
# igp_cost: true
# transitive: true
# maximum_prefix:
# number: 1
# restart: 100
# threshold_value: 10
# neighbor_address: 198.51.110.1
# slow_peer_options:
# detection:
# threshold: 150
# networks:
# - address: 198.51.110.10
# backdoor: true
# mask: 255.255.255.255
# - afi: ipv4
# safi: multicast
# - afi: ipv4
# safi: mdt
# - afi: ipv6
# safi: multicast
# as_number: '65000'
# commands:
# - router bgp 65000
# - address-family ipv4
# - no default-information originate
# - no bgp aggregate-timer 10
# - no bgp dampening 10 10 10 10
# - no bgp slow-peer detection threshold 200
# - no neighbor 198.51.100.1
# - no neighbor 198.51.110.1
# - no network 198.51.110.10 mask 255.255.255.255 backdoor
# - no aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# - address-family ipv4 multicast vrf blue
# - bgp aggregate-timer 10
# - bgp dampening 10 10 100 50
# - bgp slow-peer detection threshold 150
# - neighbor 198.51.110.1 remote-as 100
# - neighbor 198.51.110.1 activate
# - neighbor 198.51.110.1 disable
# - neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
# - neighbor 198.51.110.1 slow-peer detection threshold 150
# - neighbor 198.51.110.1 version 4
# - network 198.51.110.10 mask 255.255.255.255 backdoor
# - aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# - address-family ipv6 multicast
# - default-information originate
# - bgp aggregate-timer 10
# - bgp dampening 10 10 10 10
# - bgp slow-peer detection threshold 200
# after:
# address_family:
# - afi: ipv4
# aggregate_addresses:
# - address: 192.0.2.1
# as_confed_set: true
# netmask: 255.255.255.255
# bgp:
# aggregate_timer: 10
# dampening:
# max_suppress: 10
# penalty_half_time: 10
# reuse_route_val: 10
# suppress_route_val: 10
# slow_peer_options:
# detection:
# threshold: 200
# default_information: true
# neighbors:
# - activate: true
# aigp:
# send:
# cost_community:
# id: 100
# poi:
# igp_cost: true
# transitive: true
# neighbor_address: 198.51.100.1
# slow_peer_options:
# detection:
# threshold: 150
# - activate: true
# aigp:
# send:
# cost_community:
# id: 200
# poi:
# igp_cost: true
# transitive: true
# maximum_prefix:
# number: 1
# restart: 100
# threshold_value: 10
# neighbor_address: 198.51.110.1
# slow_peer_options:
# detection:
# threshold: 150
# networks:
# - address: 198.51.110.10
# backdoor: true
# mask: 255.255.255.255
# - afi: ipv4
# safi: multicast
# - afi: ipv4
# safi: mdt
# - afi: ipv6
# safi: multicast
# as_number: '65000'
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.110.1 remote-as 100
# neighbor 198.51.110.1 disable-connected-check
# neighbor 198.51.110.1 version 4
# !
# address-family ipv4
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 200
# bgp dampening 10 10 10 10
# 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 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 slow-peer detection threshold 150
# 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 slow-peer detection threshold 150
# neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
# default-information originate
# exit-address-family
# !
# address-family ipv4 multicast
# exit-address-family
# !
# address-family ipv4 mdt
# exit-address-family
# !
# address-family ipv6 multicast
# exit-address-family
# Using deleted
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.110.1 remote-as 100
# neighbor 198.51.110.1 disable-connected-check
# neighbor 198.51.110.1 version 4
# !
# address-family ipv4
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 200
# bgp dampening 10 10 10 10
# 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 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 slow-peer detection threshold 150
# 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 slow-peer detection threshold 150
# neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
# default-information originate
# exit-address-family
# !
# address-family ipv4 multicast
# exit-address-family
# !
# address-family ipv4 mdt
# exit-address-family
# !
# address-family ipv6 multicast
# 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
# Task Output:
# ------------
#
# before:
# address_family:
# - afi: ipv4
# aggregate_addresses:
# - address: 192.0.2.1
# as_confed_set: true
# netmask: 255.255.255.255
# bgp:
# aggregate_timer: 10
# dampening:
# max_suppress: 10
# penalty_half_time: 10
# reuse_route_val: 10
# suppress_route_val: 10
# slow_peer_options:
# detection:
# threshold: 200
# default_information: true
# neighbors:
# - activate: true
# aigp:
# send:
# cost_community:
# id: 100
# poi:
# igp_cost: true
# transitive: true
# neighbor_address: 198.51.100.1
# slow_peer_options:
# detection:
# threshold: 150
# - activate: true
# aigp:
# send:
# cost_community:
# id: 200
# poi:
# igp_cost: true
# transitive: true
# maximum_prefix:
# number: 1
# restart: 100
# threshold_value: 10
# neighbor_address: 198.51.110.1
# slow_peer_options:
# detection:
# threshold: 150
# networks:
# - address: 198.51.110.10
# backdoor: true
# mask: 255.255.255.255
# - afi: ipv4
# safi: multicast
# - afi: ipv4
# safi: mdt
# - afi: ipv6
# safi: multicast
# as_number: '65000'
# commands:
# - router bgp 65000
# - no address-family ipv4 multicast
# - no address-family ipv4 mdt
# after:
# address_family:
# - afi: ipv4
# aggregate_addresses:
# - address: 192.0.2.1
# as_confed_set: true
# netmask: 255.255.255.255
# bgp:
# aggregate_timer: 10
# dampening:
# max_suppress: 10
# penalty_half_time: 10
# reuse_route_val: 10
# suppress_route_val: 10
# slow_peer_options:
# detection:
# threshold: 200
# default_information: true
# neighbors:
# - activate: true
# aigp:
# send:
# cost_community:
# id: 100
# poi:
# igp_cost: true
# transitive: true
# neighbor_address: 198.51.100.1
# slow_peer_options:
# detection:
# threshold: 150
# - activate: true
# aigp:
# send:
# cost_community:
# id: 200
# poi:
# igp_cost: true
# transitive: true
# maximum_prefix:
# number: 1
# restart: 100
# threshold_value: 10
# neighbor_address: 198.51.110.1
# slow_peer_options:
# detection:
# threshold: 150
# networks:
# - address: 198.51.110.10
# backdoor: true
# mask: 255.255.255.255
# - afi: ipv6
# safi: multicast
# as_number: '65000'
# After state:
# -------------
#
# vios#sh running-config | section ^router bg
# hostname#show running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.110.1 remote-as 100
# neighbor 198.51.110.1 disable-connected-check
# neighbor 198.51.110.1 version 4
# !
# address-family ipv4
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 200
# bgp dampening 10 10 10 10
# 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 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 slow-peer detection threshold 150
# 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 slow-peer detection threshold 150
# neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
# default-information originate
# exit-address-family
# !
# address-family ipv6 multicast
# exit-address-family
# Using Deleted without any config passed (delete all)
# Before state:
# -------------
#
# vios#sh running-config | section ^router bg
# hostname#show running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.110.1 remote-as 100
# neighbor 198.51.110.1 disable-connected-check
# neighbor 198.51.110.1 version 4
# !
# address-family ipv4
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 200
# bgp dampening 10 10 10 10
# 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 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 slow-peer detection threshold 150
# 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 slow-peer detection threshold 150
# neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
# default-information originate
# exit-address-family
# !
# address-family ipv6 multicast
# exit-address-family
- name: "Delete ALL of configured AF BGP"
cisco.ios.ios_bgp_address_family:
state: deleted
# Task Output:
# ------------
#
# before:
# address_family:
# - afi: ipv4
# aggregate_addresses:
# - address: 192.0.2.1
# as_confed_set: true
# netmask: 255.255.255.255
# bgp:
# aggregate_timer: 10
# dampening:
# max_suppress: 10
# penalty_half_time: 10
# reuse_route_val: 10
# suppress_route_val: 10
# slow_peer_options:
# detection:
# threshold: 200
# default_information: true
# neighbors:
# - activate: true
# aigp:
# send:
# cost_community:
# id: 100
# poi:
# igp_cost: true
# transitive: true
# neighbor_address: 198.51.100.1
# slow_peer_options:
# detection:
# threshold: 150
# - activate: true
# aigp:
# send:
# cost_community:
# id: 200
# poi:
# igp_cost: true
# transitive: true
# maximum_prefix:
# number: 1
# restart: 100
# threshold_value: 10
# neighbor_address: 198.51.110.1
# slow_peer_options:
# detection:
# threshold: 150
# networks:
# - address: 198.51.110.10
# backdoor: true
# mask: 255.255.255.255
# - afi: ipv6
# safi: multicast
# as_number: '65000'
# commands:
# - router bgp 65000
# - no address-family ipv4
# - no address-family ipv6 multicast
# after:
# address_family:
# - afi: ipv4
# bgp:
# aggregate_timer: 10
# as_number: '65000'
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.110.1 remote-as 100
# neighbor 198.51.110.1 disable-connected-check
# neighbor 198.51.110.1 version 4
# !
# address-family ipv4
# bgp aggregate-timer 10
# no neighbor 198.51.100.1 activate
# no neighbor 198.51.110.1 activate
# exit-address-family
# Using gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# snmp context snmp_con community community RO 10
# neighbor 198.51.100.1 remote-as 10
# !
# address-family ipv4
# snmp context snmp_con community community RO 10
# 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 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 slow-peer detection threshold 150
# exit-address-family
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 198.51.111.11 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: Gather listed AF BGP with provided configurations
cisco.ios.ios_bgp_address_family:
config:
state: gathered
# Task Output:
# ------------
#
# gathered:
# address_family:
# - afi: ipv4
# aggregate_addresses:
# - 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_options:
# detection:
# threshold: 150
# neighbors:
# - activate: true
# aigp:
# send:
# cost_community:
# id: 100
# poi:
# igp_cost: true
# transitive: true
# neighbor_address: 198.51.100.1
# slow_peer_options:
# detection:
# threshold: 150
# networks:
# - address: 198.51.110.10
# backdoor: true
# mask: 255.255.255.255
# snmp:
# context:
# community:
# acl: '10'
# ro: true
# snmp_community: community
# name: snmp_con
# - afi: ipv4
# aggregate_addresses:
# - address: 192.0.3.1
# as_confed_set: true
# netmask: 255.255.255.255
# default_metric: 12
# distance:
# external: 10
# internal: 10
# local: 100
# networks:
# - address: 198.51.111.11
# 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
# Task Output:
# ------------
#
# rendered:
# - router bgp 65000
# - address-family ipv4 multicast vrf blue
# - bgp aggregate-timer 10
# - bgp dampening 1 1 1 1
# - bgp slow-peer detection threshold 150
# - snmp context snmp_con community community ro 10
# - 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 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
# - address-family ipv4 mdt
# - bgp dmzlink-bw
# - bgp soft-reconfig-backup
# - bgp dampening 1 10 100 5
# 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
# Task Output:
# ------------
#
# parsed:
# address_family:
# - afi: ipv4
# aggregate_addresses:
# - 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_options:
# detection:
# threshold: 150
# neighbors:
# - activate: true
# aigp:
# send:
# cost_community:
# id: 100
# poi:
# igp_cost: true
# transitive: true
# neighbor_address: 198.51.100.1
# slow_peer_options:
# detection:
# threshold: 150
# networks:
# - address: 198.51.110.10
# backdoor: true
# mask: 255.255.255.255
# snmp:
# context:
# community:
# acl: '10'
# ro: true
# snmp_community: community
# name: snmp_con
# - afi: ipv4
# aggregate_addresses:
# - address: 192.0.3.1
# as_confed_set: true
# netmask: 255.255.255.255
# default_metric: 12
# distance:
# external: 10
# internal: 10
# local: 100
# networks:
# - address: 198.51.111.11
# 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'
Common return values are documented here, the following are the fields unique to this module:
- Sagar Paul (@KB-perByte)
- Sumit Jaiswal (@justjais)