cisco.ios.ios_bgp_global – Global BGP 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_global
.
New in version 1.3.0: of cisco.ios
Synopsis
This module configures and manages the attributes of global bgp on Cisco IOS.
Note
This module has a corresponding action plugin.
Parameters
Parameter |
Comments |
---|---|
A list of configurations for global bgp. |
|
Configure BGP aggregate entries |
|
Aggregate address |
|
Set condition to advertise attribute |
|
Generate AS confed set path information Choices:
|
|
Generate AS set path information Choices:
|
|
Set attributes of aggregate |
|
Aggregate mask |
|
Filter more specific routes from updates Choices:
|
|
Conditionally filter more specific routes from updates |
|
Autonomous system number. |
|
Enable automatic network number summarization Choices:
|
|
Enable address family and enter its config mode |
|
Additional paths in the BGP table |
|
Additional paths to install into RIB Choices:
|
|
Receive additional paths from neighbors Choices:
|
|
Selection criteria to pick the paths |
|
Select all available paths Choices:
|
|
Select best N paths (2-3). |
|
Select best-external path Choices:
|
|
Select group-best path Choices:
|
|
Send additional paths to neighbors Choices:
|
|
Advertise best external path to internal peers Choices:
|
|
Configure Aggregation Timer Please refer vendor documentation for valid values |
|
Allow comparing MED from different neighbors Choices:
|
|
Change the default asplain notation asdot notation Choices:
|
|
Change the default bestpath selection |
|
if both paths doesn’t have aigp ignore on bestpath comparision ignore Choices:
|
|
Compare router-id for identical EBGP paths Choices:
|
|
cost community Choices:
|
|
igp metric Ignore igp metric in bestpath selection Choices:
|
|
MED attribute |
|
Compare MED among confederation paths Choices:
|
|
Treat missing MED as the least preferred one Choices:
|
|
Configure client to client route reflection |
|
inter-cluster and intra-cluster (default) Choices:
|
|
intra cluster reflection intra-cluster reflection for cluster-id |
|
set reflection of routes allowed Choices:
|
|
Configure Route-Reflector Cluster-id (peers may reset) A.B.C.D/Please refer vendor documentation for valid Route-Reflector Cluster-id Choices:
|
|
AS confederation parameters |
|
Set routing domain confederation AS AS number |
|
Peer ASs in BGP confederation AS number |
|
Consistency-checker |
|
Auto-Repair |
|
Set the bgp consistency checker Please refer vendor documentation for valid values |
|
Enable Auto-Repair Choices:
|
|
Log Error-Msg |
|
Set the bgp consistency checker Please refer vendor documentation for valid values |
|
Enable Error-Msg Choices:
|
|
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 |
|
Pick the best-MED path among paths advertised from the neighboring AS Choices:
|
|
Use DMZ Link Bandwidth as weight for BGP multipaths Choices:
|
|
Enforce the first AS for EBGP routes(default) Choices:
|
|
Enabled BGP Enhanced error handling Choices:
|
|
Immediately reset session if a link to a directly connected external peer goes down Choices:
|
|
Graceful restart capability parameters |
|
Enable Graceful-Restart Extension Choices:
|
|
Set the max time needed to restart and come back up Please refer vendor documentation for valid values |
|
Set Graceful-Restart Choices:
|
|
Set the max time to hold onto restarting peer’s stale paths Please refer vendor documentation for valid values |
|
Graceful shutdown capability parameters |
|
Set Community for Gshut routes community number/community number in aa:nn format |
|
Set Local Preference for Gshut routes Please refer vendor documentation for valid values |
|
Gracefully shut down all neigbors |
|
Activate graceful shutdown of all neigbors Choices:
|
|
time in seconds Please refer vendor documentation for valid values |
|
Gracefully shut down all vrf neigbors |
|
Activate graceful shutdown of all neigbors Choices:
|
|
time in seconds Please refer vendor documentation for valid values |
|
Routemap which specifies prefixes to inject |
|
Copy attributes from aggregate Choices:
|
|
route-map name |
|
route-map name |
|
Neighbor subnet range listener |
|
Set the max limit for the dynamic subnet range neighbors Please refer vendor documentation for valid values |
|
Subnet network range |
|
IPv4 subnet range(A.B.C.D/nn) |
|
IPv6 subnet range(X:X:X:X::X/<0-128>) |
|
Member of the peer-group |
|
Log neighbor up/down and reset reason Choices:
|
|
Allow AS-PATH attribute from any neighbor imposing a limit on number of ASes Please refer vendor documentation for valid values |
|
Allow COMMUNITY attribute from any neighbor imposing a limit on number of communities Please refer vendor documentation for valid values |
|
Allow EXTENDED COMMUNITY attribute from any neighbor imposing a limit on number of extended communities Please refer vendor documentation for valid values |
|
Nexthop tracking commands |
|
Route map for valid nexthops |
|
nexthop trackings |
|
Set the delay to tigger nexthop tracking Please refer vendor documentation for valid values |
|
Enable nexthop tracking Choices:
|
|
Set how long BGP will wait for the first peer to come up before beginning the update delay or graceful restart timers (in seconds) |
|
How long to wait for the first peer to come up upon a cold boot Please refer vendor documentation for valid values |
|
How long to wait for the first peer, post NSF switchover Please refer vendor documentation for valid values |
|
How long to wait for the first peer to come up once the system is already booted and all peers go down Please refer vendor documentation for valid values |
|
How long to wait for the first peer, post a manual clear of BGP peers by the admin user Please refer vendor documentation for valid values |
|
recursion rule for the nexthops recursion via host for the nexthops Choices:
|
|
Allow redistribution of iBGP into IGPs (dangerous) Choices:
|
|
refresh |
|
Configure refresh max-eor time Please refer vendor documentation for valid values |
|
Configure refresh stale-path time Please refer vendor documentation for valid values |
|
Select regular expression engine Enable bounded-execution-time regular expression engine Choices:
|
|
route-map control commands Have route-map set commands take priority over BGP commands such as next-hop unchanged Choices:
|
|
Override configured router identifier (peers will reset) |
|
Manually configured router identifier(A.B.C.D) |
|
Use IPv4 address on interface |
|
vrf-specific router id configuration Automatically assign per-vrf bgp router id Choices:
|
|
Configure background scanner interval Please refer vendor documentation for valid values |
|
Configure slow-peer |
|
Slow-peer detection |
|
Slow-peer detection Choices:
|
|
Set the slow-peer detection threshold 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 |
|
BGP SNMP options BGP SNMP trap options Use cbgpPeer2Type as part of index for traps Choices:
|
|
Use soft-reconfiguration inbound only when route-refresh is not negotiated Choices:
|
|
Stateful Switchover Enable SSO only for Route-Refresh capable peers Choices:
|
|
Suppress routes that are not in the routing table Choices:
|
|
Global enable/disable transport session parameters Transport path MTU discovery Choices:
|
|
Set the max initial delay for sending update Please refer vendor documentation for valid values |
|
Manage peers in bgp update groups Split update groups based on Policy Keep peers with as-override in different update groups Choices:
|
|
Upgrade to hierarchical AFI mode |
|
Upgrade to AFI mode Choices:
|
|
enable upgrade to hierarchical AFI mode Choices:
|
|
BGP Monitoring Protocol) |
|
BMP Buffer Size Please refer vendor documentation for valid values |
|
Initial Refresh options |
|
Delay before Initial Refresh |
|
skip all refreshes Choices:
|
|
Server Information Please refer vendor documentation for valid values |
|
Control distribution of default information Distribute a default route Choices:
|
|
Set metric of redistributed routes Please refer vendor documentation for valid values |
|
Define an administrative distance |
|
Administrative distance |
|
IP Standard access list number IP Standard expanded access list number Standard access-list name |
|
IP Source address (A.B.C.D) |
|
Administrative distance Please refer vendor documentation for valid values |
|
Wildcard bits (A.B.C.D) |
|
BGP distance |
|
Distance for routes external to the AS Please refer vendor documentation for valid values |
|
Distance for routes internal to the AS Please refer vendor documentation for valid values |
|
Distance for local routes Please refer vendor documentation for valid values |
|
MBGP distance |
|
Distance for routes external to the AS Please refer vendor documentation for valid values |
|
Distance for routes internal to the AS Please refer vendor documentation for valid values |
|
Distance for local routes Please refer vendor documentation for valid values |
|
Filter networks in routing updates |
|
IP access list number/name |
|
Filter incoming routing updates Choices:
|
|
interface details |
|
Filter outgoing routing updates Choices:
|
|
Forward packets over multiple paths |
|
Both eBGP and iBGP paths as multipath |
|
iBGP-multipath |
|
Number of paths |
|
Maximum secondary paths |
|
Both eBGP and iBGP paths as secondary multipath |
|
iBGP-secondary-multipath |
|
Number of secondary paths |
|
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 neighbors 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:
|
|
Advertise best-external (at RRs best-internal) path Choices:
|
|
Advertise additional paths |
|
Diverse path can be backup path Choices:
|
|
Diverse path can be multipath 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 |
|
AIGP on neighbor |
|
Enable AIGP Choices:
|
|
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 |
|
Override matching AS-number while sending update 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 |
|
Originate default route to this neighbor Choices:
|
|
Neighbor specific description |
|
one-hop away EBGP peer using loopback address Choices:
|
|
Filter updates to/from this neighbor |
|
IP access list number/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 |
|
Filter incoming updates Choices:
|
|
Filter outgoing updates Choices:
|
|
AS path access list |
|
high availability mode |
|
disable graceful-restart Choices:
|
|
set ha-mode and graceful-restart for this peer Choices:
|
|
Inherit a template Inherit a peer-session template and Template name |
|
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:
|
|
Maximum number of prefixes accepted from this peer |
|
maximum no. of prefix limit |
|
Restart bgp connection after limit is exceeded |
|
Threshold value (%) at which to generate a warning msg |
|
Only give warning message when limit is exceeded Choices:
|
|
Disable the next hop calculation for this neighbor |
|
Enable next-hop-self for both eBGP and iBGP received paths Choices:
|
|
Enable next-hop-self Choices:
|
|
Propagate next hop unchanged for iBGP paths to this neighbor Propagate next hop unchanged for all paths (iBGP and eBGP) to this neighbor |
|
Propagate next hop unchanged for all paths (iBGP and eBGP) to this neighbor Choices:
|
|
Enable next-hop-unchanged 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 |
|
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 Choices:
|
|
Apply route map to neighbor |
|
Apply map to incoming routes Choices:
|
|
Replace all private AS numbers with local AS |
|
Apply map to outbound routes Choices:
|
|
Configure a neighbor as Route Reflector client Choices:
|
|
Configure a neighbor as Route Server client |
|
Specify Route Server context for neighbor Route Server context name |
|
Set Route Server client Choices:
|
|
Send Community attribute to this neighbor |
|
Send Standard and Extended Community attributes Choices:
|
|
Send Extended Community attribute Choices:
|
|
Set send Community attribute to this neighbor Choices:
|
|
Send Standard Community attribute Choices:
|
|
Send NLRI + MPLS Label to this peer |
|
Advertise Explicit Null label in place of Implicit Null Choices:
|
|
Set send NLRI + MPLS Label to this peer 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 split-update-group |
|
Dynamically split the slow peer to slow-update group |
|
Disable slow-peer detection Choices:
|
|
Enable slow-peer detection Choices:
|
|
Keep the slow-peer permanently in slow-update group Choices:
|
|
Static slow-peer Choices:
|
|
Per neighbor soft reconfiguration Allow inbound soft reconfiguration for this neighbor Choices:
|
|
Neighbor tag |
|
BGP per neighbor timers |
|
Holdtime |
|
Keepalive interval |
|
Minimum hold time from neighbor |
|
Translate Update to MBGP format |
|
Specify type of nlri to translate to |
|
Translate Update to multicast nlri Choices:
|
|
Process Update as unicast nlri Choices:
|
|
Set Translate Update Choices:
|
|
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 Name of route map |
|
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 |
|
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 |
|
Enter route server context command mode |
|
Enter address family command mode |
|
Address family Choices:
|
|
Import matching routes using a route map Name of route map |
|
Address Family modifier Choices:
|
|
Textual description of the router server context |
|
Name of route server context |
|
Enter scope command mode |
|
Global scope Choices:
|
|
VRF scope VPN Routing/Forwarding instance name |
|
Perform IGP synchronization Choices:
|
|
Map external entry attributes into routing table |
|
Selective route download Choices:
|
|
route-map name |
|
Enter template command mode |
|
Template configuration for policy parameters |
|
Template configuration for session parameters |
|
Adjust routing timers BGP timers |
|
Holdtime |
|
Keepalive interval |
|
Minimum hold time from neighbor |
|
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
- name: Merge provided configuration with device configuration
cisco.ios.ios_bgp_global:
config:
as_number: 65000
bgp:
advertise_best_external: true
bestpath:
- compare_routerid: true
nopeerup_delay:
- post_boot: 10
dampening:
penalty_half_time: 1
reuse_route_val: 1
suppress_route_val: 1
max_suppress: 1
graceful_shutdown:
neighbors:
time: 50
community: 100
local_preference: 100
neighbor:
- address: 198.51.100.1
description: merge neighbor
remote_as: 100
aigp:
send:
cost_community:
id: 100
poi:
igp_cost: true
transitive: true
route_map:
name: test-route
out: true
state: merged
# Commands fired:
# ---------------
#
# "commands": [
# "router bgp 65000",
# "bgp dampening 1 1 1 1",
# "bgp graceful-shutdown all neighbors 50 community 100 local-preference 100",
# "bgp advertise-best-external",
# "bgp nopeerup-delay post-boot 10",
# "bgp bestpath compare-routerid",
# "neighbor 198.51.100.1 remote-as 100",
# "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "neighbor 198.51.100.1 description merge neighbor",
# "neighbor 198.51.100.1 route-map test-route out"
# ]
# After state:
# ------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
# Using replaced
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: Replaces device configuration of listed global BGP with provided configuration
cisco.ios.ios_bgp_global:
config:
as_number: 65000
bgp:
advertise_best_external: true
bestpath:
- med:
confed: true
log_neighbor_changes: true
nopeerup_delay:
- post_boot: 10
cold_boot: 20
neighbor:
- address: 192.0.2.1
description: replace neighbor
remote_as: 100
slow_peer:
detection:
disable: true
state: replaced
# Commands fired:
# ---------------
#
# "commands": [
# "router bgp 65000"
# "no bgp dampening 1 1 1 1"
# "no timers bgp 100 200 150"
# "no bgp bestpath compare-routerid"
# "bgp bestpath med confed"
# "bgp nopeerup-delay cold-boot 20"
# "no neighbor 198.51.100.1 remote-as 100"
# "neighbor 192.0.2.1 remote-as 100"
# "no bgp graceful-shutdown all neighbors 50 local-preference 100 community 100"
# "no neighbor 198.51.100.1 route-map test-route out"
# "no neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive"
# "no neighbor 198.51.100.1 description merge neighbor"
# "neighbor 192.0.2.1 slow-peer detection disable"
# "neighbor 192.0.2.1 description replace neighbor"
# ]
# 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
# bgp advertise-best-external
# redistribute connected metric 10
# neighbor 192.0.2.1 remote-as 100
# neighbor 192.0.2.1 description replace neighbor
# neighbor 192.0.2.1 slow-peer detection disable
# Using Deleted
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: "Delete global BGP (Note: This won't delete the configured global BGP)"
cisco.ios.ios_bgp_global:
config:
as_number: 65000
state: deleted
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "no bgp dampening 1 1 1 1",
# "no bgp graceful-shutdown all neighbors 50 community 100 local-preference 100",
# "no bgp advertise-best-external",
# "no bgp bestpath compare-routerid",
# "no bgp nopeerup-delay post-boot 10",
# "no neighbor 198.51.100.1 remote-as 100",
# "no neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "no neighbor 198.51.100.1 description merge neighbor",
# "no neighbor 198.51.100.1 route-map test-route out"
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured global BGP)"
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: "Delete global BGP without config"
cisco.ios.ios_bgp_global:
state: deleted
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "no bgp dampening 1 1 1 1",
# "no bgp graceful-shutdown all neighbors 50 community 100 local-preference 100",
# "no bgp advertise-best-external",
# "no bgp bestpath compare-routerid",
# "no bgp nopeerup-delay post-boot 10",
# "no neighbor 198.51.100.1 remote-as 100",
# "no neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "no neighbor 198.51.100.1 description merge neighbor",
# "no neighbor 198.51.100.1 route-map test-route out"
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# Using Purged
#"(NOTE: This WILL delete the configured global BGP)"
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: 'Delete the configured global BGP (Note: This WILL delete the the configured
global BGP)'
cisco.ios.ios_bgp_global:
state: purged
# Commands fired:
# ---------------
# "commands": [
# "no router bgp 65000",
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# Using Gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: Gather listed global BGP with provided configurations
cisco.ios.ios_bgp_global:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": {
# "as_number": "65000",
# "bgp": {
# "advertise_best_external": true,
# "bestpath": [
# {
# "compare_routerid": true
# }
# ],
# "dampening": {
# "max_suppress": 1,
# "penalty_half_time": 1,
# "reuse_route_val": 1,
# "suppress_route_val": 1
# },
# "graceful_shutdown": {
# "community": "100",
# "local_preference": 100,
# "neighbors": {
# "time": 50
# }
# },
# "nopeerup_delay": [
# {
# "post_boot": 10
# }
# ]
# },
# "neighbor": [
# {
# "address": "198.51.100.1",
# "aigp": {
# "send": {
# "cost_community": {
# "id": 100,
# "poi": {
# "igp_cost": true,
# "transitive": true
# }
# }
# }
# },
# "description": "merge neighbor",
# "remote_as": 100,
# "route_map": {
# "name": "test-route",
# "out": true
# }
# }
# ]
# }
# Using Rendered
- name: Rendered the provided configuration with the existing running configuration
cisco.ios.ios_bgp_global:
config:
as_number: 65000
bgp:
advertise_best_external: true
bestpath:
- compare_routerid: true
nopeerup_delay:
- post_boot: 10
dampening:
penalty_half_time: 1
reuse_route_val: 1
suppress_route_val: 1
max_suppress: 1
graceful_shutdown:
neighbors:
time: 50
community: 100
local_preference: 100
neighbor:
- address: 198.51.100.1
description: merge neighbor
remote_as: 100
aigp:
send:
cost_community:
id: 100
poi:
igp_cost: true
transitive: true
route_map:
name: test-route
out: true
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "router bgp 65000",
# "bgp dampening 1 1 1 1",
# "bgp graceful-shutdown all neighbors 50 community 100 local-preference 100",
# "bgp advertise-best-external",
# "bgp nopeerup-delay post-boot 10",
# "bgp bestpath compare-routerid",
# "neighbor 198.51.100.1 remote-as 100",
# "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "neighbor 198.51.100.1 description merge neighbor",
# "neighbor 198.51.100.1 route-map test-route out"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: Parse the commands for provided configuration
cisco.ios.ios_bgp_global:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": {
# "as_number": "65000",
# "bgp": {
# "advertise_best_external": true,
# "bestpath": [
# {
# "compare_routerid": true
# }
# ],
# "dampening": {
# "max_suppress": 1,
# "penalty_half_time": 1,
# "reuse_route_val": 1,
# "suppress_route_val": 1
# },
# "graceful_shutdown": {
# "community": "100",
# "local_preference": 100,
# "neighbors": {
# "time": 50
# }
# },
# "nopeerup_delay": [
# {
# "post_boot": 10
# }
# ]
# },
# "neighbor": [
# {
# "address": "198.51.100.1",
# "aigp": {
# "send": {
# "cost_community": {
# "id": 100,
# "poi": {
# "igp_cost": true,
# "transitive": true
# }
# }
# }
# },
# "description": "merge neighbor",
# "remote_as": 100,
# "route_map": {
# "name": "test-route",
# "out": true
# }
# }
# ]
# }
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The configuration as structured data after module completion. Returned: when changed Sample: “The configuration returned will always be in the same format of the parameters above.” |
|
The configuration as structured data prior to module invocation. Returned: always Sample: “The configuration returned will always be in the same format of the parameters above.” |
|
The set of commands pushed to the remote device Returned: always Sample: [“router bgp 65000”, “bgp nopeerup-delay post-boot 10”, “bgp advertise-best-external”] |
Authors
Sumit Jaiswal (@justjais)