cisco.ios.ios_bgp_global (8.0.0) — module

Resource module to configure BGP.

| "added in version" 1.3.0 of cisco.ios"

Authors: Sumit Jaiswal (@justjais), Sagar Paul (@KB-perByte)

Install collection

Install with ansible-galaxy collection install cisco.ios:==8.0.0


Add to requirements.yml

  collections:
    - name: cisco.ios
      version: 8.0.0

Description

This module configures and manages the attributes of global bgp on Cisco IOS.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
        dampening:
          penalty_half_time: 1
          reuse_route_val: 1
          suppress_route_val: 1
          max_suppress: 1
        default:
          ipv4_unicast: false
          route_target:
            filter: true
        graceful_shutdown:
          neighbors:
            time: 50
          community: 100
          local_preference: 100
        log_neighbor_changes: true
        nopeerup_delay:
          - post_boot: 10
      networks:
        - address: 192.0.2.3
        - address: 192.0.2.2
      neighbor:
        - address: 192.0.2.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
      redistribute:
        - connected:
            metric: 10
      timers:
        keepalive: 100
        holdtime: 200
        min_holdtime: 150
    state: merged
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task Output:
# ------------
#
# before: {}
# commands:
# - router bgp 65000
# - timers bgp 100 200 150
# - bgp advertise-best-external
# - bgp bestpath compare-routerid
# - no bgp default ipv4-unicast
# - bgp dampening 1 1 1 1
# - bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# - bgp log-neighbor-changes
# - bgp nopeerup-delay post-boot 10
# - network 192.0.2.3
# - network 192.0.2.2
# - neighbor 192.0.2.1 remote-as 100
# - neighbor 192.0.2.1 description merge neighbor
# - neighbor 192.0.2.1 aigp send cost-community 100 poi igp-cost transitive
# - neighbor 192.0.2.1 route-map test-route out
# - redistribute connected metric 10
# after:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       compare_routerid: true
#     dampening:
#       max_suppress: 1
#       penalty_half_time: 1
#       reuse_route_val: 1
#       suppress_route_val: 1
#     default:
#       ipv4_unicast: false
#       route_target:
#         filter: true
#     graceful_shutdown:
#       community: '100'
#       local_preference: 100
#       neighbors:
#         time: 50
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       post_boot: 10
#   neighbors:
#   - aigp:
#       send:
#         cost_community:
#           id: 100
#           poi:
#             igp_cost: true
#             transitive: true
#     description: merge neighbor
#     neighbor_address: 192.0.2.1
#     remote_as: '100'
#     route_maps:
#     - name: test-route
#       out: true
#   networks:
#   - address: 192.0.2.2
#   - address: 192.0.2.3
#   redistribute:
#   - connected:
#       metric: 10
#       set: true
#   timers:
#     holdtime: 200
#     keepalive: 100
#     min_holdtime: 150

# After state:
# ------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  no bgp default ipv4-unicast
#  bgp log-neighbor-changes
#  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
#  network 192.0.2.2
#  network 192.0.2.3
#  timers bgp 100 200 150
#  redistribute connected metric 10
#  neighbor 192.0.2.1 remote-as 100
#  neighbor 192.0.2.1 description merge neighbor
#  neighbor 192.0.2.1 aigp send cost-community 100 poi igp-cost transitive
#  neighbor 192.0.2.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
#  network 192.0.2.2
#  network 192.0.2.3
#  bgp advertise-best-external
#  neighbor 198.0.2.1 remote-as 100
#  neighbor 198.0.2.1 description merge neighbor
#  neighbor 198.0.2.1 aigp send cost-community 100 poi igp-cost transitive
#  neighbor 198.0.2.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
      networks:
        - address: 192.0.2.4
      neighbor:
        - address: 192.0.2.5
          description: replace neighbor
          remote_as: 100
          slow_peer:
            detection:
              disable: true
    state: replaced
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task Output:
# ------------
#
# before:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       compare_routerid: true
#     dampening:
#       max_suppress: 1
#       penalty_half_time: 1
#       reuse_route_val: 1
#       suppress_route_val: 1
#     default:
#       ipv4_unicast: true
#       route_target:
#         filter: true
#     graceful_shutdown:
#       community: '100'
#       local_preference: 100
#       neighbors:
#         time: 50
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       post_boot: 10
#   neighbors:
#   - aigp:
#       send:
#         cost_community:
#           id: 100
#           poi:
#             igp_cost: true
#             transitive: true
#     description: merge neighbor
#     neighbor_address: 198.0.2.1
#     remote_as: '100'
#     route_maps:
#     - name: test-route
#       out: true
#   networks:
#   - address: 192.0.2.2
#   - address: 192.0.2.3
#
# commands:
# - router bgp 65000
# - no bgp bestpath compare-routerid
# - bgp bestpath med confed
# - no bgp dampening 1 1 1 1
# - no bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# - bgp nopeerup-delay cold-boot 20
# - network 192.0.2.4
# - no network 192.0.2.2
# - no network 192.0.2.3
# - neighbor 192.0.2.5 remote-as 100
# - neighbor 192.0.2.5 description replace neighbor
# - neighbor 192.0.2.5 slow-peer detection disable
# - no neighbor 198.0.2.1
# after:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       med:
#         confed: true
#     default:
#       ipv4_unicast: true
#       route_target:
#         filter: true
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       cold_boot: 20
#       post_boot: 10
#   neighbors:
#   - description: replace neighbor
#     neighbor_address: 192.0.2.5
#     remote_as: '100'
#     slow_peer:
#       detection:
#         disable: true
#   networks:
#   - address: 192.0.2.4

# 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
#  network 192.0.2.4
#  neighbor 192.0.2.5 remote-as 100
#  neighbor 192.0.2.5 description replace neighbor
#  neighbor 192.0.2.5 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 192.0.2.1 remote-as 100
#  neighbor 192.0.2.1 description merge neighbor
#  neighbor 192.0.2.1 aigp send cost-community 100 poi igp-cost transitive
#  neighbor 192.0.2.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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task Output:
# ------------
#
# before:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       compare_routerid: true
#     dampening:
#       max_suppress: 1
#       penalty_half_time: 1
#       reuse_route_val: 1
#       suppress_route_val: 1
#     default:
#       ipv4_unicast: true
#       route_target:
#         filter: true
#     graceful_shutdown:
#       community: '100'
#       local_preference: 100
#       neighbors:
#         time: 50
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       post_boot: 10
#   neighbors:
#   - aigp:
#       send:
#         cost_community:
#           id: 100
#           poi:
#             igp_cost: true
#             transitive: true
#     description: merge neighbor
#     neighbor_address: 192.0.2.1
#     remote_as: '100'
#     route_maps:
#     - name: test-route
#       out: true
# commands:
# - router bgp 65000
# - no bgp advertise-best-external
# - no bgp bestpath compare-routerid
# - no bgp dampening 1 1 1 1
# - no bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# - no bgp log-neighbor-changes
# - no bgp nopeerup-delay post-boot 10
# - no neighbor 192.0.2.1
# after:
#   as_number: '65000'

# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000

# Using Deleted without any config passed

# 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 192.0.2.1 remote-as 100
#  neighbor 192.0.2.1 description merge neighbor
#  neighbor 192.0.2.1 aigp send cost-community 100 poi igp-cost transitive
#  neighbor 192.0.2.1 route-map test-route out

- name: Delete global BGP without config
  cisco.ios.ios_bgp_global:
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task Output:
# ------------
#
# before:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       compare_routerid: true
#     dampening:
#       max_suppress: 1
#       penalty_half_time: 1
#       reuse_route_val: 1
#       suppress_route_val: 1
#     default:
#       ipv4_unicast: true
#       route_target:
#         filter: true
#     graceful_shutdown:
#       community: '100'
#       local_preference: 100
#       neighbors:
#         time: 50
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       post_boot: 10
#   neighbors:
#   - aigp:
#       send:
#         cost_community:
#           id: 100
#           poi:
#             igp_cost: true
#             transitive: true
#     description: merge neighbor
#     neighbor_address: 192.0.2.1
#     remote_as: '100'
#     route_maps:
#     - name: test-route
#       out: true
# commands:
# - router bgp 65000
# - no bgp advertise-best-external
# - no bgp bestpath compare-routerid
# - no bgp dampening 1 1 1 1
# - no bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# - no bgp nopeerup-delay post-boot 10
# - no neighbor 198.51.100.1
# after:
#   as_number: '65000'

# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000

# Using purged - would delete all configuration

# 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 192.0.2.1 remote-as 100
#  neighbor 192.0.2.1 description merge neighbor
#  neighbor 192.0.2.1 aigp send cost-community 100 poi igp-cost transitive
#  neighbor 192.0.2.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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task Output:
# ------------
#
# before:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       compare_routerid: true
#     default:
#       ipv4_unicast: true
#       route_target:
#         filter: 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
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       post_boot: 10
#   neighbors:
#   - aigp:
#       send:
#         cost_community:
#           id: 100
#           poi:
#             igp_cost: true
#             transitive: true
#     description: merge neighbor
#     neighbor_address: 192.0.2.1
#     remote_as: '100'
#     route_maps:
#     - name: test-route
#       out: true
# commands:
#  - no router bgp 65000
# after: {}

# After state:
# -------------
#
# vios#sh running-config | section ^router bgp

# Using gathered

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  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
#  network 192.0.2.3
#  timers bgp 100 200 150
#  redistribute connected metric 10
#  neighbor 192.0.2.1 remote-as 100
#  neighbor 192.0.2.1 description merge neighbor
#  neighbor 192.0.2.1 aigp send cost-community 100 poi igp-cost transitive
#  neighbor 192.0.2.1 route-map test-route out

- name: Gather facts for bgp_global
  cisco.ios.ios_bgp_global:
    config:
    state: gathered
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task Output:
# ------------
#
# gathered:
#   as_number: '65000'
#   bgp:
#     advertise_best_external: true
#     bestpath_options:
#       compare_routerid: true
#     dampening:
#       max_suppress: 1
#       penalty_half_time: 1
#       reuse_route_val: 1
#       suppress_route_val: 1
#     default:
#       ipv4_unicast: true
#       route_target:
#         filter: true
#     graceful_shutdown:
#       community: '100'
#       local_preference: 100
#       neighbors:
#         time: 50
#     log_neighbor_changes: true
#     nopeerup_delay_options:
#       post_boot: 10
#   neighbors:
#   - aigp:
#       send:
#         cost_community:
#           id: 100
#           poi:
#             igp_cost: true
#             transitive: true
#     description: merge neighbor
#     neighbor_address: 192.0.2.1
#     remote_as: '100'
#     route_maps:
#     - name: test-route
#       out: true
#   networks:
#   - address: 192.0.2.3
#   redistribute:
#   - connected:
#       metric: 10
#       set: true
#   timers:
#     holdtime: 200
#     keepalive: 100
#     min_holdtime: 150

# Using Rendered

- name: Rendered the provided configuration with the existing running configuration
  cisco.ios.ios_bgp_global:
    config:
      aggregate_addresses:
        - address: 192.0.2.1
          attribute_map: testMap1
          netmask: 255.255.255.0
          summary_only: true
        - address: 192.0.2.2
          as_set: true
          netmask: 255.255.255.0
        - address: 192.0.2.3
          as_set: true
          netmask: 255.255.255.0
      as_number: "65000"
      auto_summary: true
      bgp:
        additional_paths:
          install: true
          receive: true
        aggregate_timer: 0
        always_compare_med: true
        asnotation: true
        bestpath_options:
          aigp: true
          compare_routerid: true
          med:
            confed: true
            missing_as_worst: true
        confederation:
          identifier: "22"
        consistency_checker:
          error_message:
            interval: 10
            set: true
        dampening:
          route_map: routeMap1Test
        deterministic_med: true
        graceful_restart:
          restart_time: 2
          stalepath_time: 22
        graceful_shutdown:
          community: "77"
          local_preference: 230
          vrfs:
            time: 31
        inject_maps:
          - copy_attributes: true
            exist_map_name: Testmap3
            name: map2
          - copy_attributes: true
            exist_map_name: Testmap2
            name: map1
        listen:
          limit: 200
          range:
            host_with_subnet: 192.0.2.1/24
            peer_group: PaulNetworkGroup
        log_neighbor_changes: true
        maxas_limit: 2
        maxcommunity_limit: 3
        maxextcommunity_limit: 3
        nexthop:
          route_map: RouteMap1
          trigger:
            delay: 2
        nopeerup_delay_options:
          cold_boot: 2
          nsf_switchover: 10
          post_boot: 22
          user_initiated: 22
        recursion: true
        redistribute_internal: true
        refresh:
          max_eor_time: 700
          stalepath_time: 800
        router_id:
          vrf: true
        scan_time: 22
        slow_peer:
          detection:
            threshold: 345
          split_update_group:
            dynamic: true
            permanent: true
        sso: true
        suppress_inactive: true
        update_delay: 2
        update_group: true
      bmp:
        buffer_size: 22
        server: 2
      distance:
        bgp:
          routes_external: 2
          routes_internal: 3
          routes_local: 4
        mbgp:
          routes_external: 2
          routes_internal: 3
          routes_local: 5
      distributes:
        - in: true
          prefix: prefixTest
        - gateway: gatewayTest
          out: true
        - acl: "300"
          interface: Loopback0
          out: true
      maximum_paths:
        ibgp: 2
        paths: 2
      maximum_secondary_paths:
        ibgp: 22
        paths: 22
      neighbors:
        - neighbor_address: 192.0.2.10
          remote_as: "64500"
          update_source: Loopback1
        - activate: true
          neighbor_address: 192.0.2.11
          remote_as: "45000"
          send_community:
            extended: true
        - activate: true
          neighbor_address: 192.0.2.12
          remote_as: "45000"
        - neighbor_address: 192.0.2.13
          remote_as: "6553601"
        - advertise:
            diverse_path:
              backup: true
          neighbor_address: 192.0.2.8
          route_reflector_client: true
        - neighbor_address: 192.0.2.9
          remote_as: "64500"
          route_maps:
            - in: true
              name: rmp1
            - in: true
              name: rmp2
          update_source: Loopback0
        - activate: true
          advertise:
            additional_paths:
              group_best: true
          neighbor_address: 2001:DB8::1037
        - neighbor_address: testNebTag
          peer_group: "5"
          soft_reconfiguration: true
          version: 4
      networks:
        - address: 192.0.2.15
          backdoor: true
          netmask: 55.255.255.0
          route_map: mp1
        - address: 192.0.2.16
          backdoor: true
          netmask: 255.255.255.0
          route_map: mp2
        - address: 192.0.2.17
          backdoor: true
          netmask: 255.255.255.0
          route_map: mp2
      redistribute:
        - static:
            metric: 33
            route_map: rmp1
            set: true
        - application:
            metric: 22
            name: app1
        - application:
            metric: 33
            name: app2
            route_map: mp1
        - connected:
            metric: 22
            set: true
        - mobile:
            metric: 211
            set: true
    state: rendered
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task Output:
# ------------
#
# rendered:
# - router bgp 65000
# - auto-summary
# - bmp buffer-size 22
# - bmp server 2
# - distance bgp 2 3 4
# - distance mbgp 2 3 5
# - maximum-paths 2
# - maximum-paths ibgp 2
# - maximum-secondary-paths 22
# - maximum-secondary-paths ibgp 22
# - bgp additional-paths install receive
# - bgp aggregate-timer 0
# - bgp always-compare-med
# - bgp asnotation dot
# - bgp bestpath aigp ignore
# - bgp bestpath compare-routerid
# - bgp bestpath med confed missing-as-worst
# - bgp confederation identifier 22
# - bgp consistency-checker error-message interval 10
# - bgp dampening route-map routeMap1Test
# - bgp deterministic-med
# - bgp graceful-restart restart-time 2
# - bgp graceful-restart stalepath-time 22
# - bgp graceful-shutdown all vrfs 31 local-preference 230 community 77
# - bgp listen limit 200
# - bgp listen range 192.0.2.1/24 peer-group PaulNetworkGroup
# - bgp log-neighbor-changes
# - bgp maxas-limit 2
# - bgp maxcommunity-limit 3
# - bgp maxextcommunity-limit 3
# - bgp nexthop route-map RouteMap1
# - bgp nexthop trigger delay 2
# - bgp nopeerup-delay cold-boot 2
# - bgp nopeerup-delay post-boot 22
# - bgp nopeerup-delay nsf-switchover 10
# - bgp nopeerup-delay user-initiated 22
# - bgp recursion host
# - bgp redistribute-internal
# - bgp refresh max-eor-time 700
# - bgp refresh stalepath-time 800
# - bgp router-id vrf auto-assign
# - bgp scan-time 22
# - bgp slow-peer detection threshold 345
# - bgp slow-peer split-update-group dynamic permanent
# - bgp sso route-refresh-enable
# - bgp suppress-inactive
# - bgp update-delay 2
# - bgp update-group split as-override
# - bgp inject-map map2 exist-map Testmap3 copy-attributes
# - bgp inject-map map1 exist-map Testmap2 copy-attributes
# - distribute-list prefix prefixTest in
# - distribute-list gateway gatewayTest out
# - distribute-list 300 out Loopback0
# - aggregate-address 192.0.2.1 255.255.255.0 summary-only attribute-map testMap1
# - aggregate-address 192.0.2.2 255.255.255.0 as-set
# - aggregate-address 192.0.2.3 255.255.255.0 as-set
# - network 192.0.2.15 mask 55.255.255.0 route-map mp1 backdoor
# - network 192.0.2.16 mask 255.255.255.0 route-map mp2 backdoor
# - network 192.0.2.17 mask 255.255.255.0 route-map mp2 backdoor
# - neighbor 192.0.2.10 remote-as 64500
# - neighbor 192.0.2.10 update-source Loopback1
# - neighbor 192.0.2.11 remote-as 45000
# - neighbor 192.0.2.11 activate
# - neighbor 192.0.2.11 send-community extended
# - neighbor 192.0.2.12 remote-as 45000
# - neighbor 192.0.2.12 activate
# - neighbor 192.0.2.13 remote-as 6553601
# - neighbor 192.0.2.8 advertise diverse-path backup
# - neighbor 192.0.2.8 route-reflector-client
# - neighbor 192.0.2.9 remote-as 64500
# - neighbor 192.0.2.9 update-source Loopback0
# - neighbor 192.0.2.9 route-map rmp1 in
# - neighbor 192.0.2.9 route-map rmp2 in
# - neighbor 2001:DB8::1037 activate
# - neighbor 2001:DB8::1037 advertise additional-paths group-best
# - neighbor testNebTag peer-group 5
# - neighbor testNebTag soft-reconfiguration inbound
# - neighbor testNebTag version 4
# - redistribute static metric 33 route-map rmp1
# - redistribute application app1 metric 22
# - redistribute application app2 metric 33 route-map mp1
# - redistribute connected metric 22
# - redistribute mobile metric 211

# Using parsed

# File: parsed.cfg
# ----------------
#
# router bgp 65000
#  auto-summary
#  bmp buffer-size 22
#  bmp server 2
#  distance bgp 2 3 4
#  distance mbgp 2 3 5
#  maximum-paths 2
#  maximum-paths ibgp 2
#  maximum-secondary-paths 22
#  maximum-secondary-paths ibgp 22
#  description checking description as line
#  bgp additional-paths install receive
#  bgp aggregate-timer 0
#  bgp always-compare-med
#  bgp asnotation dot
#  bgp bestpath aigp ignore
#  bgp bestpath compare-routerid
#  bgp bestpath med confed missing-as-worst
#  bgp confederation identifier 22
#  bgp consistency-checker error-message interval 10
#  bgp dampening route-map routeMap1Test
#  bgp deterministic-med
#  bgp graceful-restart restart-time 2
#  bgp graceful-restart stalepath-time 22
#  bgp graceful-shutdown all vrfs 31 local-preference 230 community 77
#  bgp listen limit 200
#  bgp listen range 192.0.2.1/24 peer-group PaulNetworkGroup
#  bgp log-neighbor-changes
#  bgp maxas-limit 2
#  bgp maxcommunity-limit 3
#  bgp maxextcommunity-limit 3
#  bgp nexthop route-map RouteMap1
#  bgp nexthop trigger delay 2
#  bgp nopeerup-delay cold-boot 2
#  bgp nopeerup-delay post-boot 22
#  bgp nopeerup-delay nsf-switchover 10
#  bgp nopeerup-delay user-initiated 22
#  bgp recursion host
#  bgp redistribute-internal
#  bgp refresh max-eor-time 700
#  bgp refresh stalepath-time 800
#  bgp router-id vrf auto-assign
#  bgp scan-time 22
#  bgp slow-peer detection threshold 345
#  bgp slow-peer split-update-group dynamic permanent
#  bgp sso route-refresh-enable
#  bgp suppress-inactive
#  bgp update-delay 2
#  bgp update-group split as-override
#  bgp inject-map map2 exist-map Testmap3 copy-attributes
#  bgp inject-map map1 exist-map Testmap2 copy-attributes
#  distribute-list prefix prefixTest in
#  distribute-list gateway gatewayTest out
#  distribute-list 300 out Loopback0
#  aggregate-address 192.0.2.1 255.255.255.0 summary-only attribute-map testMap1
#  aggregate-address 192.0.2.2 255.255.255.0 as-set
#  aggregate-address 192.0.2.3 255.255.255.0 as-set
#  network 192.0.2.15 mask 55.255.255.0 route-map mp1 backdoor
#  network 192.0.2.16 mask 255.255.255.0 route-map mp2 backdoor
#  network 192.0.2.17 mask 255.255.255.0 route-map mp2 backdoor
#  neighbor 192.0.2.8 advertise diverse-path backup
#  neighbor 192.0.2.8 route-reflector-client
#  neighbor 192.0.2.9 remote-as 64500
#  neighbor 192.0.2.9 update-source Loopback0
#  neighbor 192.0.2.9 route-map rmp1 in
#  neighbor 192.0.2.9 route-map rmp2 in
#  neighbor 192.0.2.10 remote-as 64500
#  neighbor 192.0.2.10 update-source Loopback1
#  neighbor 192.0.2.11 remote-as 45000
#  neighbor 192.0.2.11 activate
#  neighbor 192.0.2.11 send-community extended
#  neighbor 192.0.2.12 remote-as 45000
#  neighbor 192.0.2.12 activate
#  neighbor 192.0.2.13 remote-as 6553601
#  neighbor 192.0.2.13 shutdown graceful 10 community 20
#  neighbor 2001:DB8::1037 activate
#  neighbor 2001:DB8::1037 advertise additional-paths group-best
#  neighbor testNebTag peer-group 5
#  neighbor testNebTag soft-reconfiguration inbound
#  neighbor testNebTag version 4
#  redistribute static metric 33 route-map rmp1
#  redistribute application app1 metric 22
#  redistribute application app2 metric 33 route-map mp1
#  redistribute connected metric 22
#  redistribute mobile metric 21

- name: Parse the commands for provided configuration
  cisco.ios.ios_bgp_global:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

Inputs

    
state:
    choices:
    - merged
    - replaced
    - overridden
    - deleted
    - purged
    - gathered
    - rendered
    - parsed
    default: merged
    description:
    - The state the configuration should be left in
    - The module have declaratively similar behavior for replaced and overridden state.
    - The states I(rendered), I(gathered) and I(parsed) does not perform any change on
      the device.
    - The state I(rendered) will transform the configuration in C(config) option to platform
      specific CLI commands which will be returned in the I(rendered) key within the result.
      For state I(rendered) active connection to remote host is not required.
    - The state I(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 I(gathered) key within the result.
    - The state I(parsed) reads the configuration from C(running_config) option and transforms
      it into JSON format as per the resource module parameters and the value is returned
      in the I(parsed) key within the result. The value of C(running_config) option should
      be the same format as the output of command I(show running-config | section ^router
      bgp) executed on device. For state I(parsed) active connection to remote host is
      not required.
    type: str

config:
    description: A dictionary of options for bgp configurations.
    suboptions:
      aggregate_address:
        description:
        - Configure BGP aggregate entry
        - This option is DEPRECATED and is replaced with aggregate_addresses which accepts
          list of dict as input, this attribute will be removed after 2024-06-01.
        suboptions:
          address:
            description: Specify aggregate address
            type: str
          advertise_map:
            description: Set condition to advertise attribute
            type: str
          as_confed_set:
            description: Generate AS confed set path information
            type: bool
          as_set:
            description: Generate AS set path information
            type: bool
          attribute_map:
            description: Set attributes of aggregate
            type: str
          netmask:
            description: Specify aggregate mask
            type: str
          summary_only:
            description: Filter more specific routes from updates
            type: bool
          suppress_map:
            description: Conditionally filter more specific routes from updates
            type: str
        type: dict
      aggregate_addresses:
        description: Configure BGP aggregate entries
        elements: dict
        suboptions:
          address:
            description: Specify aggregate address
            type: str
          advertise_map:
            description: Set condition to advertise attribute
            type: str
          as_confed_set:
            description: Generate AS confed set path information
            type: bool
          as_set:
            description: Generate AS set path information
            type: bool
          attribute_map:
            description: Set attributes of aggregate
            type: str
          netmask:
            description: Specify aggregate mask
            type: str
          summary_only:
            description: Filter more specific routes from updates
            type: bool
          suppress_map:
            description: Conditionally filter more specific routes from updates
            type: str
        type: list
      as_number:
        description: Autonomous system number
        type: str
      auto_summary:
        description: Enable automatic network number summarization
        type: bool
      bgp:
        description: Enable address family and enter its config mode
        suboptions:
          additional_paths:
            description: Additional paths in the BGP table
            suboptions:
              install:
                description: Additional paths to install into RIB
                type: bool
              receive:
                description: Receive additional paths from neighbors
                type: bool
              select:
                description: Selection criteria to pick the paths
                suboptions:
                  all:
                    description: Select all available paths
                    type: bool
                  best:
                    description: Select best N paths (2-3).
                    type: int
                  best_external:
                    description: Select best-external path
                    type: bool
                  group_best:
                    description: Select group-best path
                    type: bool
                type: dict
              send:
                description: Send additional paths to neighbors
                type: bool
            type: dict
          advertise_best_external:
            description: Advertise best external path to internal peers
            type: bool
          aggregate_timer:
            description:
            - Configure Aggregation Timer
            - Please refer vendor documentation for valid values
            type: int
          always_compare_med:
            description: Allow comparing MED from different neighbors
            type: bool
          asnotation:
            description:
            - Change the default as plain notation
            - asdot notation
            type: bool
          bestpath:
            description:
            - Change the default bestpath selection
            - This option is DEPRECATED and replaced with bestpath_options of type dict,
              this attribute will be removed after 2024-06-01.
            elements: dict
            suboptions:
              aigp:
                description:
                - if both paths doesn't have aigp ignore on bestpath comparison
                - ignore
                type: bool
              compare_routerid:
                description: Compare router-id for identical EBGP paths
                type: bool
              cost_community:
                description: cost community
                type: bool
              igp_metric:
                description:
                - igp metric
                - Ignore igp metric in bestpath selection
                type: bool
              med:
                description: MED attribute
                suboptions:
                  confed:
                    description: Compare MED among confederation paths
                    type: bool
                  missing_as_worst:
                    description: Treat missing MED as the least preferred one
                    type: bool
                type: dict
            type: list
          bestpath_options:
            description:
            - Change the default bestpath selection
            suboptions:
              aigp:
                description:
                - if both paths doesn't have aigp ignore on bestpath comparison
                - ignore
                type: bool
              compare_routerid:
                description: Compare router-id for identical EBGP paths
                type: bool
              cost_community:
                description: cost community
                type: bool
              igp_metric:
                description:
                - igp metric
                - Ignore igp metric in bestpath selection
                type: bool
              med:
                description: MED attribute
                suboptions:
                  confed:
                    description: Compare MED among confederation paths
                    type: bool
                  missing_as_worst:
                    description: Treat missing MED as the least preferred one
                    type: bool
                type: dict
            type: dict
          client_to_client:
            description: Configure client to client route reflection
            suboptions:
              all:
                description: inter-cluster and intra-cluster (default)
                type: bool
              intra_cluster:
                description:
                - intra cluster reflection
                - intra-cluster reflection for cluster-id
                type: str
              set:
                description: set reflection of routes allowed
                type: bool
            type: dict
          cluster_id:
            description:
            - Configure Route-Reflector Cluster-id (peers may reset)
            - A.B.C.D/Please refer vendor documentation for valid Route-Reflector Cluster-id
            type: str
          confederation:
            description: AS confederation parameters
            suboptions:
              identifier:
                description:
                - Set routing domain confederation AS
                - AS number
                type: str
              peers:
                description:
                - Peer ASs in BGP confederation
                - AS number
                type: str
            type: dict
          consistency_checker:
            description: Consistency-checker
            suboptions:
              auto_repair:
                description: Auto-Repair
                suboptions:
                  interval:
                    description:
                    - Set the bgp consistency checker
                    - Please refer vendor documentation for valid values
                    type: int
                  set:
                    description: Enable Auto-Repair
                    type: bool
                type: dict
              error_message:
                description: Log Error-Msg
                suboptions:
                  interval:
                    description:
                    - Set the bgp consistency checker
                    - Please refer vendor documentation for valid values
                    type: int
                  set:
                    description: Enable Error-Msg
                    type: bool
                type: dict
            type: dict
          dampening:
            description: Enable route-flap dampening
            suboptions:
              max_suppress:
                description:
                - Maximum duration to suppress a stable route
                - Please refer vendor documentation for valid values
                type: int
              penalty_half_time:
                description:
                - Half-life time for the penalty
                - Please refer vendor documentation for valid values
                type: int
              reuse_route_val:
                description:
                - Value to start reusing a route
                - Please refer vendor documentation for valid values
                type: int
              route_map:
                description: Route-map to specify criteria for dampening
                type: str
              suppress_route_val:
                description:
                - Value to start suppressing a route
                - Please refer vendor documentation for valid values
                type: int
            type: dict
          default:
            description: Configure BGP defaults
            suboptions:
              ipv4_unicast:
                default: true
                description: Activate ipv4-unicast for a peer by default
                type: bool
              route_target:
                description: Control behavior based on Route-Target attributes
                suboptions:
                  filter:
                    default: true
                    description: Control automatic VPN Route-Target filtering
                    type: bool
                type: dict
            type: dict
          deterministic_med:
            description: Pick the best-MED path among paths advertised from the neighboring
              AS
            type: bool
          dmzlink_bw:
            description: Use DMZ Link Bandwidth as weight for BGP multipaths
            type: bool
          enforce_first_as:
            description: Enforce the first AS for EBGP routes(default)
            type: bool
          enhanced_error:
            description: Enabled BGP Enhanced error handling
            type: bool
          fast_external_fallover:
            description: Immediately reset session if a link to a directly connected external
              peer goes down
            type: bool
          graceful_restart:
            description: Graceful restart capability parameters
            suboptions:
              extended:
                description: Enable Graceful-Restart Extension
                type: bool
              restart_time:
                description:
                - Set the max time needed to restart and come back up
                - Please refer vendor documentation for valid values
                type: int
              set:
                description: Set Graceful-Restart
                type: bool
              stalepath_time:
                description:
                - Set the max time to hold onto restarting peer's stale paths
                - Please refer vendor documentation for valid values
                type: int
            type: dict
          graceful_shutdown:
            description: Graceful shutdown capability parameters
            suboptions:
              community:
                description:
                - Set Community for Gshut routes
                - community number/community number in aa:nn format
                type: str
              local_preference:
                description:
                - Set Local Preference for Gshut routes
                - Please refer vendor documentation for valid values
                type: int
              neighbors:
                description: Gracefully shut down all neighbors
                suboptions:
                  activate:
                    description: Activate graceful shutdown of all neighbors
                    type: bool
                  time:
                    description:
                    - time in seconds
                    - Please refer vendor documentation for valid values
                    type: int
                type: dict
              vrfs:
                description: Gracefully shut down all vrf neighbors
                suboptions:
                  activate:
                    description: Activate graceful shutdown of all neighbors
                    type: bool
                  time:
                    description:
                    - time in seconds
                    - Please refer vendor documentation for valid values
                    type: int
                type: dict
            type: dict
          inject_map:
            description:
            - Routemap which specifies prefixes to inject
            - This option is DEPRECATED and is updated with inject_maps which is a list
              of dict, this attribute will be removed after 2024-06-01.
            suboptions:
              copy_attributes:
                description: Copy attributes from aggregate
                type: bool
              exist_map_name:
                description: route-map name
                type: str
              name:
                description: route-map name
                type: str
            type: dict
          inject_maps:
            description: Routemap which specifies prefixes to inject
            elements: dict
            suboptions:
              copy_attributes:
                description: Copy attributes from aggregate
                type: bool
              exist_map_name:
                description: route-map name
                type: str
              name:
                description: route-map name
                type: str
            type: list
          listen:
            description: Neighbor subnet range listener
            suboptions:
              limit:
                description:
                - Set the max limit for the dynamic subnet range neighbors
                - Please refer vendor documentation for valid values
                type: int
              range:
                description: Subnet network range
                suboptions:
                  host_with_subnet:
                    description:
                    - IPv4 subnet range(A.B.C.D/nn)
                    - IPv6 subnet range(X:X:X:X::X/<0-128>)
                    type: str
                  ipv4_with_subnet:
                    description:
                    - IPv4 subnet range(A.B.C.D/nn)
                    - This option is DEPRECATED and is updated with host_with_subnet which
                      is a common attribute for address, this attribute will be removed
                      after 2024-06-01.
                    type: str
                  ipv6_with_subnet:
                    description:
                    - IPv6 subnet range(X:X:X:X::X/<0-128>)
                    - This option is DEPRECATED and is updated with host_with_subnet which
                      is a common attribute for address attribute will be removed after
                      2024-06-01.
                    type: str
                  peer_group:
                    description: Member of the peer-group
                    type: str
                type: dict
            type: dict
          log_neighbor_changes:
            description: Log neighbor up/down and reset reason
            type: bool
          maxas_limit:
            description:
            - Allow AS-PATH attribute from any neighbor imposing a limit on number of
              ASes
            - Please refer vendor documentation for valid values
            type: int
          maxcommunity_limit:
            description:
            - Allow COMMUNITY attribute from any neighbor imposing a limit on number of
              communities
            - Please refer vendor documentation for valid values
            type: int
          maxextcommunity_limit:
            description:
            - Allow EXTENDED COMMUNITY attribute from any neighbor imposing a limit on
              number of extended communities
            - Please refer vendor documentation for valid values
            type: int
          nexthop:
            description: Nexthop tracking commands
            suboptions:
              route_map:
                description: Route map for valid nexthops
                type: str
              trigger:
                description: nexthop trackings
                suboptions:
                  delay:
                    description:
                    - Set the delay to trigger nexthop tracking
                    - Please refer vendor documentation for valid values
                    type: int
                  enable:
                    description: Enable nexthop tracking
                    type: bool
                type: dict
            type: dict
          nopeerup_delay:
            description:
            - Set how long BGP will wait for the first peer to come up before beginning
              the update delay or graceful restart timers (in seconds)
            - This option is DEPRECATED and is replaced with nopeerup_delay_options which
              is of type dict, this attribute will be removed after 2024-06-01.
            elements: dict
            suboptions:
              cold_boot:
                description:
                - How long to wait for the first peer to come up upon a cold boot
                - Please refer vendor documentation for valid values
                type: int
              nsf_switchover:
                description:
                - How long to wait for the first peer, post NSF switchover
                - Please refer vendor documentation for valid values
                type: int
              post_boot:
                description:
                - 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
                type: int
              user_initiated:
                description:
                - 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
                type: int
            type: list
          nopeerup_delay_options:
            description: Set how long BGP will wait for the first peer to come up before
              beginning the update delay or graceful restart timers (in seconds)
            suboptions:
              cold_boot:
                description:
                - How long to wait for the first peer to come up upon a cold boot
                - Please refer vendor documentation for valid values
                type: int
              nsf_switchover:
                description:
                - How long to wait for the first peer, post NSF switchover
                - Please refer vendor documentation for valid values
                type: int
              post_boot:
                description:
                - 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
                type: int
              user_initiated:
                description:
                - 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
                type: int
            type: dict
          recursion:
            description:
            - recursion rule for the nexthops
            - recursion via host for the nexthops
            type: bool
          redistribute_internal:
            description: Allow redistribution of iBGP into IGPs (dangerous)
            type: bool
          refresh:
            description: refresh
            suboptions:
              max_eor_time:
                description:
                - Configure refresh max-eor time
                - Please refer vendor documentation for valid values
                type: int
              stalepath_time:
                description:
                - Configure refresh stale-path time
                - Please refer vendor documentation for valid values
                type: int
            type: dict
          regexp:
            description:
            - Select regular expression engine
            - Enable bounded-execution-time regular expression engine
            type: bool
          route_map:
            description:
            - route-map control commands
            - Have route-map set commands take priority over BGP commands such as next-hop
              unchanged
            type: bool
          router_id:
            description: Override configured router identifier (peers will reset)
            suboptions:
              address:
                description: Manually configured router identifier(A.B.C.D)
                type: str
              interface:
                description: Use IPv4 address on interface
                type: str
              vrf:
                description:
                - vrf-specific router id configuration
                - Automatically assign per-vrf bgp router id
                type: bool
            type: dict
          scan_time:
            description:
            - Configure background scanner interval
            - Please refer vendor documentation for valid values
            type: int
          slow_peer:
            description: Configure slow-peer
            suboptions:
              detection:
                description: Slow-peer detection
                suboptions:
                  set:
                    description: Slow-peer detection
                    type: bool
                  threshold:
                    description:
                    - Set the slow-peer detection threshold
                    - Please refer vendor documentation for valid values
                    type: int
                type: dict
              split_update_group:
                description: Configure slow-peer split-update-group
                suboptions:
                  dynamic:
                    description: Dynamically split the slow peer to slow-update group
                    type: bool
                  permanent:
                    description: Keep the slow-peer permanently in slow-update group
                    type: bool
                type: dict
            type: dict
          snmp:
            description:
            - BGP SNMP options
            - BGP SNMP trap options
            - Use cbgp Peer2Type as part of index for traps
            type: bool
          soft_reconfig_backup:
            description: Use soft-reconfiguration inbound only when route-refresh is not
              negotiated
            type: bool
          sso:
            description:
            - Stateful Switchover
            - Enable SSO only for Route-Refresh capable peers
            type: bool
          suppress_inactive:
            description: Suppress routes that are not in the routing table
            type: bool
          transport:
            description:
            - Global enable/disable transport session parameters
            - Transport path MTU discovery
            type: bool
          update_delay:
            description:
            - Set the max initial delay for sending update
            - Please refer vendor documentation for valid values
            type: int
          update_group:
            description:
            - Manage peers in bgp update groups
            - Split update groups based on Policy
            - Keep peers with as-override in different update groups
            type: bool
          upgrade_cli:
            description: Upgrade to hierarchical AFI mode
            suboptions:
              af_mode:
                description: Upgrade to AFI mode
                type: bool
              set:
                description: enable upgrade to hierarchical AFI mode
                type: bool
            type: dict
        type: dict
      bmp:
        description: BGP Monitoring Protocol
        suboptions:
          buffer_size:
            description:
            - BMP Buffer Size
            - Please refer vendor documentation for valid values
            type: int
          initial_refresh:
            description: Initial Refresh options
            suboptions:
              delay:
                description: Delay before Initial Refresh
                type: int
              skip:
                description: skip all refreshes
                type: bool
            type: dict
          server:
            description:
            - Server Information
            - Please refer vendor documentation for valid values
            type: int
          server_options:
            description: bmp server options
            suboptions:
              activate:
                description: activate server
                type: bool
              address:
                description: skip all refreshes
                suboptions:
                  host:
                    description: host address
                    type: str
                  port:
                    description: port number BMP server
                    type: int
                type: dict
            type: dict
        type: dict
      default_information:
        description:
        - Control distribution of default information
        - Distribute a default route
        type: bool
      default_metric:
        description:
        - Set metric of redistributed routes
        - Please refer vendor documentation for valid values
        type: int
      distance:
        description: Define an administrative distance
        suboptions:
          admin:
            description: Administrative distance
            suboptions:
              acl:
                description:
                - IP Standard access list number
                - IP Standard expanded access list number
                - Standard access-list name
                type: str
              address:
                description: IP Source address (A.B.C.D)
                type: str
              distance:
                description:
                - Administrative distance
                - Please refer vendor documentation for valid values
                type: int
              wildcard_bit:
                description: Wildcard bits (A.B.C.D)
                type: str
            type: dict
          bgp:
            description: BGP distance
            suboptions:
              routes_external:
                description:
                - Distance for routes external to the AS
                - Please refer vendor documentation for valid values
                type: int
              routes_internal:
                description:
                - Distance for routes internal to the AS
                - Please refer vendor documentation for valid values
                type: int
              routes_local:
                description:
                - Distance for local routes
                - Please refer vendor documentation for valid values
                type: int
            type: dict
          mbgp:
            description: MBGP distance
            suboptions:
              routes_external:
                description:
                - Distance for routes external to the AS
                - Please refer vendor documentation for valid values
                type: int
              routes_internal:
                description:
                - Distance for routes internal to the AS
                - Please refer vendor documentation for valid values
                type: int
              routes_local:
                description:
                - Distance for local routes
                - Please refer vendor documentation for valid values
                type: int
            type: dict
        type: dict
      distribute_list:
        description:
        - Filter networks in routing updates
        - This option is DEPRECATED and is replaced with distributes which is of type
          list of dict, this attribute will be removed after 2024-06-01.
        suboptions:
          acl:
            description: IP access list number/name
            type: str
          in:
            description: Filter incoming routing updates
            type: bool
          interface:
            description: interface details
            type: str
          out:
            description: Filter outgoing routing updates
            type: bool
        type: dict
      distributes:
        description: Filter networks in routing updates
        elements: dict
        suboptions:
          acl:
            description: IP access list number/name
            type: str
          gateway:
            description: Filter prefixes in routing updates
            type: str
          in:
            description: Filter incoming routing updates
            type: bool
          interface:
            description: interface details
            type: str
          out:
            description: Filter outgoing routing updates
            type: bool
          prefix:
            description: Filtering incoming updates based on gateway
            type: str
        type: list
      maximum_paths:
        description: Forward packets over multiple paths
        suboptions:
          eibgp:
            description: Both eBGP and iBGP paths as multipath
            type: int
          ibgp:
            description: iBGP-multipath
            type: int
          paths:
            description: Number of paths
            type: int
        type: dict
      maximum_secondary_paths:
        description: Maximum secondary paths
        suboptions:
          eibgp:
            description: Both eBGP and iBGP paths as secondary multipath
            type: int
          ibgp:
            description: iBGP-secondary-multipath
            type: int
          paths:
            description: Number of secondary paths
            type: int
        type: dict
      neighbors:
        aliases:
        - neighbor
        description: Specify a neighbor router
        elements: dict
        suboptions:
          activate:
            description: Enable the Address Family for this Neighbor
            type: bool
          additional_paths:
            description: Negotiate additional paths capabilities with this neighbor
            suboptions:
              disable:
                description: Disable additional paths for this neighbor
                type: bool
              receive:
                description: Receive additional paths from neighbors
                type: bool
              send:
                description: Send additional paths to neighbors
                type: bool
            type: dict
          address:
            description:
            - Neighbor address (A.B.C.D)
            - This option is DEPRECATED and replaced with neighbor_address, this attribute
              will be removed after 2024-06-01.
            type: str
          advertise:
            description: Advertise to this neighbor
            suboptions:
              additional_paths:
                description: Advertise additional paths
                suboptions:
                  all:
                    description: Select all available paths
                    type: bool
                  best:
                    description: Select best N paths (2-3).
                    type: int
                  group_best:
                    description: Select group-best path
                    type: bool
                type: dict
              best_external:
                description: Advertise best-external (at RRs best-internal) path
                type: bool
              diverse_path:
                description: Advertise additional paths
                suboptions:
                  backup:
                    description: Diverse path can be backup path
                    type: bool
                  mpath:
                    description: Diverse path can be multipath
                    type: bool
                type: dict
            type: dict
          advertise_map:
            description: specify route-map for conditional advertisement
            suboptions:
              exist_map:
                description:
                - advertise prefix only if prefix is in the condition exists
                - condition route-map name
                type: str
              name:
                description: advertise route-map name
                type: str
              non_exist_map:
                description:
                - advertise prefix only if prefix in the condition does not exist
                - condition route-map name
                type: str
            type: dict
          advertisement_interval:
            description: Minimum interval between sending BGP routing updates
            type: int
          aigp:
            description: AIGP on neighbor
            suboptions:
              enable:
                description: Enable AIGP
                type: bool
              send:
                description: Cost community or MED carrying AIGP VALUE
                suboptions:
                  cost_community:
                    description: Cost extended community carrying AIGP Value
                    suboptions:
                      id:
                        description:
                        - Community ID
                        - Please refer vendor documentation for valid values
                        type: int
                      poi:
                        description: Point of Insertion
                        suboptions:
                          igp_cost:
                            description: Point of Insertion After IGP
                            type: bool
                          pre_bestpath:
                            description: Point of Insertion At Beginning
                            type: bool
                          transitive:
                            description: Cost community is Transitive
                            type: bool
                        type: dict
                    type: dict
                  med:
                    description: Med carrying AIGP Value
                    type: bool
                type: dict
            type: dict
          allow_policy:
            description: Enable the policy support for this IBGP Neighbor
            type: bool
          allowas_in:
            description: Accept as-path with my AS present in it
            type: int
          as_override:
            description:
            - Override matching AS-number while sending update
            - Maintain Split Horizon while sending update
            type: bool
          bmp_activate:
            description: Activate the BMP monitoring for a BGP peer
            suboptions:
              all:
                description: Activate BMP monitoring for all servers
                type: bool
              server:
                description:
                - Activate BMP for server
                - BMP Server Number
                - Please refer vendor documentation for valid values
                type: int
            type: dict
          capability:
            description:
            - Advertise capability to the peer
            - Advertise ORF capability to the peer
            - Advertise prefix-list ORF capability to this neighbor
            suboptions:
              both:
                description: Capability to SEND and RECEIVE the ORF to/from this neighbor
                type: bool
              receive:
                description: Capability to RECEIVE the ORF from this neighbor
                type: bool
              send:
                description: Capability to SEND the ORF to this neighbor
                type: bool
            type: dict
          cluster_id:
            description:
            - 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)
            type: str
          default_originate:
            description: Originate default route to this neighbor
            suboptions:
              route_map:
                description: Route-map to specify criteria to originate default
                type: str
              set:
                description: Originate default route to this neighbor
                type: bool
            type: dict
          description:
            description: Neighbor specific description
            type: str
          disable_connected_check:
            description: one-hop away EBGP peer using loopback address
            type: bool
          distribute_list:
            description: Filter updates to/from this neighbor
            suboptions:
              acl:
                description: IP access list number/name
                type: str
              in:
                description: Filter incoming updates
                type: bool
              out:
                description: Filter outgoing updates
                type: bool
            type: dict
          dmzlink_bw:
            description: Propagate the DMZ link bandwidth
            type: bool
          ebgp_multihop:
            description: Allow EBGP neighbors not on directly connected networks
            suboptions:
              enable:
                description: Allow EBGP neighbors not on directly connected networks
                type: bool
              hop_count:
                description:
                - Maximum hop count
                - Please refer vendor documentation for valid values
                type: int
            type: dict
          fall_over:
            description: Session fall on peer route lost
            suboptions:
              bfd:
                description: Use BFD to detect failure
                suboptions:
                  multi_hop:
                    description: Force BFD multi-hop to detect failure
                    type: bool
                  set:
                    description: set bfd
                    type: bool
                  single_hop:
                    description: Force BFD single-hop to detect failure
                    type: bool
                type: dict
              route_map:
                description: Route map for peer route
                type: str
            type: dict
          filter_list:
            description: Establish BGP filters
            suboptions:
              in:
                description: Filter incoming updates
                type: bool
              out:
                description: Filter outgoing updates
                type: bool
              path_acl:
                description: AS path access list
                type: str
            type: dict
          ha_mode:
            description: high availability mode
            suboptions:
              disable:
                description: disable graceful-restart
                type: bool
              set:
                description: set ha-mode and graceful-restart for this peer
                type: bool
            type: dict
          inherit:
            description:
            - Inherit a template
            - Inherit a peer-session template and Template name
            type: str
          ipv6_adddress:
            description:
            - Neighbor ipv6 address (X:X:X:X::X)
            - This option is DEPRECATED and replaced with neighbor_address, this attribute
              will be removed after 2024-06-01.
            type: str
          local_as:
            description: Specify a local-as number
            suboptions:
              dual_as:
                description: Accept either real AS or local AS from the ebgp peer
                type: bool
              no_prepend:
                description: Do not prepend local-as to updates from ebgp peers
                suboptions:
                  replace_as:
                    description: Replace real AS with local AS in the EBGP updates
                    type: bool
                  set:
                    description: Set prepend
                    type: bool
                type: dict
              number:
                description:
                - AS number used as local AS
                - Please refer vendor documentation for valid values
                type: int
              set:
                description: set local-as number
                type: bool
            type: dict
          log_neighbor_changes:
            description: Log neighbor up/down and reset reason
            suboptions:
              disable:
                description: disable Log neighbor up/down and reset
                type: bool
              set:
                description: set Log neighbor up/down and reset
                type: bool
            type: dict
          maximum_prefix:
            description: Maximum number of prefixes accepted from this peer
            suboptions:
              max_no:
                description: maximum no. of prefix limit
                type: int
              restart:
                description: Restart bgp connection after limit is exceeded
                type: int
              threshold_val:
                description: Threshold value (%) at which to generate a warning msg
                type: int
              warning_only:
                description: Only give warning message when limit is exceeded
                type: bool
            type: dict
          neighbor_address:
            description:
            - Neighbor address (A.B.C.D)
            - Neighbor tag
            - Neighbor ipv6 address (X:X:X:X::X)
            type: str
          next_hop_self:
            description: Disable the next hop calculation for this neighbor
            suboptions:
              all:
                description: Enable next-hop-self for both eBGP and iBGP received paths
                type: bool
              set:
                description: Enable next-hop-self
                type: bool
            type: dict
          next_hop_unchanged:
            description:
            - Propagate next hop unchanged for iBGP paths to this neighbor
            - Propagate next hop unchanged for all paths (iBGP and eBGP) to this neighbor
            suboptions:
              allpaths:
                description: Propagate next hop unchanged for all paths (iBGP and eBGP)
                  to this neighbor
                type: bool
              set:
                description: Enable next-hop-unchanged
                type: bool
            type: dict
          password:
            description:
            - Set a password
            - This option is DEPRECATED and is replaced with password_options which accepts
              dict as input, this attribute will be removed after 2024-06-01.
            type: str
          password_options:
            description: Set a password with encryption type
            suboptions:
              encryption:
                description: Encryption type (0 to disable encryption, 7 for proprietary)
                type: int
              pass_key:
                description: The password
                type: str
            type: dict
          path_attribute:
            description: BGP optional attribute filtering
            suboptions:
              discard:
                description: Discard matching path-attribute for this neighbor
                suboptions:
                  in:
                    description: Perform inbound path-attribute filtering
                    type: bool
                  range:
                    description: path attribute range
                    suboptions:
                      end:
                        description:
                        - path attribute range end value
                        - Please refer vendor documentation for valid values
                        type: int
                      start:
                        description:
                        - path attribute range start value
                        - Please refer vendor documentation for valid values
                        type: int
                    type: dict
                  type:
                    description:
                    - path attribute type
                    - Please refer vendor documentation for valid values
                    type: int
                type: dict
              treat_as_withdraw:
                description: Treat-as-withdraw matching path-attribute for this neighbor
                suboptions:
                  in:
                    description: Perform inbound path-attribute filtering
                    type: bool
                  range:
                    description: path attribute range
                    suboptions:
                      end:
                        description:
                        - path attribute range end value
                        - Please refer vendor documentation for valid values
                        type: int
                      start:
                        description:
                        - path attribute range start value
                        - Please refer vendor documentation for valid values
                        type: int
                    type: dict
                  type:
                    description:
                    - path attribute type
                    - Please refer vendor documentation for valid values
                    type: int
                type: dict
            type: dict
          peer_group:
            description: Member of the peer-group
            type: str
          remote_as:
            description:
            - Specify a BGP neighbor
            - AS of remote neighbor
            type: str
          remove_private_as:
            description: Remove private AS number from outbound updates
            suboptions:
              all:
                description: Remove all private AS numbers
                type: bool
              replace_as:
                description: Replace all private AS numbers with local AS
                type: bool
              set:
                description: Remove private AS number
                type: bool
            type: dict
          route_map:
            description:
            - Apply route map to neighbor
            - This option is DEPRECATED and is replaced with route_maps which accepts
              list of dict as input, this attribute will be removed after 2024-06-01.
            suboptions:
              in:
                description: Apply map to incoming routes
                type: bool
              name:
                description: Replace all private AS numbers with local AS
                type: str
              out:
                description: Apply map to outbound routes
                type: bool
            type: dict
          route_maps:
            description: Apply a list of route maps to neighbor
            elements: dict
            suboptions:
              in:
                description: Apply map to incoming routes
                type: bool
              name:
                description: Replace all private AS numbers with local AS
                type: str
              out:
                description: Apply map to outbound routes
                type: bool
            type: list
          route_reflector_client:
            description: Configure a neighbor as Route Reflector client
            type: bool
          route_server_client:
            description: Configure a neighbor as Route Server client
            suboptions:
              context:
                description:
                - Specify Route Server context for neighbor
                - Route Server context name
                type: str
              set:
                description: Set Route Server client
                type: bool
            type: dict
          send_community:
            description: Send Community attribute to this neighbor
            suboptions:
              both:
                description: Send Standard and Extended Community attributes
                type: bool
              extended:
                description: Send Extended Community attribute
                type: bool
              set:
                description: Set send Community attribute to this neighbor
                type: bool
              standard:
                description: Send Standard Community attribute
                type: bool
            type: dict
          send_label:
            description: Send NLRI + MPLS Label to this peer
            suboptions:
              explicit_null:
                description: Advertise Explicit Null label in place of Implicit Null
                type: bool
              set:
                description: Set send NLRI + MPLS Label to this peer
                type: bool
            type: dict
          shutdown:
            description: Administratively shut down this neighbor
            suboptions:
              community:
                description: Set Community for Gshut routes
                type: int
              graceful:
                description:
                - Gracefully shut down this neighbor
                - time in seconds
                - Please refer vendor documentation for valid values
                type: int
              local_preference:
                description: Set Local Preference for Gshut routes
                type: bool
              set:
                description: shut down
                type: bool
            type: dict
          slow_peer:
            description: Configure slow-peer
            suboptions:
              detection:
                description: Configure slow-peer
                suboptions:
                  disable:
                    description: Disable slow-peer detection
                    type: bool
                  enable:
                    description: Enable slow-peer detection
                    type: bool
                  threshold:
                    description: Set the slow-peer detection threshold
                    type: int
                type: dict
              split_update_group:
                description: Configure slow-peer split-update-group
                suboptions:
                  dynamic:
                    description: Dynamically split the slow peer to slow-update group
                    suboptions:
                      disable:
                        description: Disable slow-peer detection
                        type: bool
                      enable:
                        description: Enable slow-peer detection
                        type: bool
                      permanent:
                        description: Keep the slow-peer permanently in slow-update group
                        type: bool
                    type: dict
                  static:
                    description: Static slow-peer
                    type: bool
                type: dict
            type: dict
          soft_reconfiguration:
            description:
            - Per neighbor soft reconfiguration
            - Allow inbound soft reconfiguration for this neighbor
            type: bool
          tag:
            description:
            - Neighbor tag
            - This option is DEPRECATED and replaced with neighbor_address, this attribute
              will be removed after 2024-06-01.
            type: str
          timers:
            description: BGP per neighbor timers
            suboptions:
              holdtime:
                description: Holdtime
                type: int
              interval:
                description: Keepalive interval
                type: int
              min_holdtime:
                description: Minimum hold time from neighbor
                type: int
            type: dict
          translate_update:
            description: Translate Update to MBGP format
            suboptions:
              nlri:
                description: Specify type of nlri to translate to
                suboptions:
                  multicast:
                    description: Translate Update to multicast nlri
                    type: bool
                  unicast:
                    description: Process Update as unicast nlri
                    type: bool
                type: dict
              set:
                description: Set Translate Update
                type: bool
            type: dict
          transport:
            description: Transport options
            suboptions:
              connection_mode:
                description: Specify passive or active connection
                suboptions:
                  active:
                    description: Actively establish the TCP session
                    type: bool
                  passive:
                    description: Passively establish the TCP session
                    type: bool
                type: dict
              multi_session:
                description: Use Multi-session for transport
                type: bool
              path_mtu_discovery:
                description: Use transport path MTU discovery
                suboptions:
                  disable:
                    description: disable
                    type: bool
                  set:
                    description: Use path MTU discovery
                    type: bool
                type: dict
            type: dict
          ttl_security:
            description:
            - BGP ttl security check
            - maximum number of hops
            - Please refer vendor documentation for valid values
            type: int
          unsuppress_map:
            description:
            - Route-map to selectively un-suppress suppressed routes
            - Name of route map
            type: str
          update_source:
            description: Source of routing updates
            type: str
          version:
            description:
            - Set the BGP version to match a neighbor
            - Neighbor's BGP version
            - Please refer vendor documentation for valid values
            type: int
          weight:
            description: Set default weight for routes from this neighbor
            type: int
        type: list
      networks:
        description: Specify a network to announce via BGP
        elements: dict
        suboptions:
          address:
            description: Specify network address
            type: str
          backdoor:
            description: Specify a BGP backdoor route
            type: bool
          netmask:
            description: Specify network mask
            type: str
          route_map:
            description: Route-map to modify the attributes
            type: str
        type: list
      redistribute:
        description: Redistribute information from another routing protocol
        elements: dict
        suboptions:
          application:
            description: Application
            suboptions:
              metric:
                description: Metric for redistributed routes
                type: int
              name:
                description: Application name
                type: str
              route_map:
                description: Route map reference
                type: str
            type: dict
          bgp:
            description: Border Gateway Protocol (BGP)
            suboptions:
              as_number:
                description: Autonomous system number
                type: str
              metric:
                description: Metric for redistributed routes
                type: int
              route_map:
                description: Route map reference
                type: str
            type: dict
          connected:
            description: Connected
            suboptions:
              metric:
                description: Metric for redistributed routes
                type: int
              route_map:
                description: Route map reference
                type: str
              set:
                description: Set the top level attribute
                type: bool
            type: dict
          eigrp:
            description: Enhanced Interior Gateway Routing Protocol (EIGRP)
            suboptions:
              as_number:
                description: Autonomous system number
                type: str
              metric:
                description: Metric for redistributed routes
                type: int
              route_map:
                description: Route map reference
                type: str
            type: dict
          isis:
            description: ISO IS-IS
            suboptions:
              area_tag:
                description: ISO routing area tag
                type: str
              clns:
                description: Redistribution of OSI dynamic routes
                type: bool
              ip:
                description: Redistribution of IP dynamic routes
                type: bool
              metric:
                description: Metric for redistributed routes
                type: int
              route_map:
                description: Route map reference
                type: str
            type: dict
          iso_igrp:
            description: IGRP for OSI networks
            suboptions:
              area_tag:
                description: ISO routing area tag
                type: str
              route_map:
                description: Route map reference
                type: str
            type: dict
          lisp:
            description: Locator ID Separation Protocol (LISP)
            suboptions:
              metric:
                description: Metric for redistributed routes
                type: int
              route_map:
                description: Route map reference
                type: str
              set:
                description: Set the top level attribute
                type: bool
            type: dict
          mobile:
            description: Mobile routes
            suboptions:
              metric:
                description: Metric for redistributed routes
                type: int
              route_map:
                description: Route map reference
                type: str
              set:
                description: Set the top level attribute
                type: bool
            type: dict
          odr:
            description: On Demand stub Routes
            suboptions:
              metric:
                description: Metric for redistributed routes
                type: int
              route_map:
                description: Route map reference
                type: str
              set:
                description: Set the top level attribute
                type: bool
            type: dict
          ospf:
            description: Open Shortest Path First (OSPF)
            suboptions:
              match:
                description: On Demand stub Routes
                suboptions:
                  external:
                    description: Redistribute OSPF external routes
                    type: bool
                  internal:
                    description: Redistribute OSPF internal routes
                    type: bool
                  nssa_external:
                    description: Redistribute OSPF NSSA external routes
                    type: bool
                  type_1:
                    description: Redistribute NSSA external type 1 routes
                    type: bool
                  type_2:
                    description: Redistribute NSSA external type 2 routes
                    type: bool
                type: dict
              metric:
                description: Metric for redistributed routes
                type: int
              process_id:
                description: Process ID
                type: int
              route_map:
                description: Route map reference
                type: str
              vrf:
                description: VPN Routing/Forwarding Instance
                type: str
            type: dict
          ospfv3:
            description: OSPFv3
            suboptions:
              match:
                description: On Demand stub Routes
                suboptions:
                  external:
                    description: Redistribute OSPF external routes
                    type: bool
                  internal:
                    description: Redistribute OSPF internal routes
                    type: bool
                  nssa_external:
                    description: Redistribute OSPF NSSA external routes
                    type: bool
                  type_1:
                    description: Redistribute NSSA external type 1 routes
                    type: bool
                  type_2:
                    description: Redistribute NSSA external type 2 routes
                    type: bool
                type: dict
              metric:
                description: Metric for redistributed routes
                type: int
              process_id:
                description: Process ID
                type: int
              route_map:
                description: Route map reference
                type: str
            type: dict
          rip:
            description: Routing Information Protocol (RIP)
            suboptions:
              metric:
                description: Metric for redistributed routes
                type: int
              route_map:
                description: Route map reference
                type: str
              set:
                description: Set the top level attribute
                type: bool
            type: dict
          static:
            description: Static routes
            suboptions:
              clns:
                description: Redistribution of OSI static routes
                type: bool
              ip:
                description: Redistribution of IP static routes
                type: bool
              metric:
                description: Metric for redistributed routes
                type: int
              route_map:
                description: Route map reference
                type: str
              set:
                description: Set the top level attribute
                type: bool
            type: dict
          vrf:
            description: Specify a source VRF
            suboptions:
              global:
                description: global VRF
                type: bool
              name:
                description: Source VRF name
                type: str
            type: dict
        type: list
      route_server_context:
        description:
        - Enter route server context command mode
        - This option is DEPRECATED as it is out of scope of the module, this attribute
          will be removed after 2024-06-01.
        suboptions:
          address_family:
            description: Enter address family command mode
            suboptions:
              afi:
                choices:
                - ipv4
                - ipv6
                description: Address family
                type: str
              import_map:
                description:
                - Import matching routes using a route map
                - Name of route map
                type: str
              modifier:
                choices:
                - multicast
                - unicast
                description: Address Family modifier
                type: str
            type: dict
          description:
            description: Textual description of the router server context
            type: str
          name:
            description: Name of route server context
            type: str
        type: dict
      scope:
        description:
        - Enter scope command mode
        - This option is DEPRECATED as is not valid within the scope of module, this attribute
          will be removed after 2024-06-01.
        suboptions:
          global:
            description: Global scope
            type: bool
          vrf:
            description:
            - VRF scope
            - VPN Routing/Forwarding instance name
            type: str
        type: dict
      synchronization:
        description: Perform IGP synchronization
        type: bool
      table_map:
        description: Map external entry attributes into routing table
        suboptions:
          filter:
            description: Selective route download
            type: bool
          name:
            description: route-map name
            type: str
        type: dict
      template:
        description:
        - Enter template command mode
        suboptions:
          peer_policy:
            description: Template configuration for policy parameters
            type: str
          peer_session:
            description: Template configuration for session parameters
            type: str
        type: dict
      timers:
        description:
        - Adjust routing timers
        - BGP timers
        suboptions:
          holdtime:
            description: Holdtime
            type: int
          keepalive:
            description: Keepalive interval
            type: int
          min_holdtime:
            description: Minimum hold time from neighbor
            type: int
        type: dict
    type: dict

running_config:
    description:
    - This option is used only with state I(parsed).
    - The value of this option should be the output received from the IOS device by executing
      the command B(sh running-config | section ^router bgp).
    - The state I(parsed) reads the configuration from C(running_config) option and transforms
      it into Ansible structured data as per the resource module's argspec and the value
      is then returned in the I(parsed) key within the result.
    type: str

Outputs

after:
  description: The resulting configuration after module execution.
  returned: when changed
  sample: 'This output will always be in the same format as the module argspec.

    '
  type: dict
before:
  description: The configuration prior to the module execution.
  returned: when I(state) is C(merged), C(replaced), C(overridden), C(deleted) or
    C(purged)
  sample: 'This output will always be in the same format as the module argspec.

    '
  type: dict
commands:
  description: The set of commands pushed to the remote device.
  returned: when I(state) is C(merged), C(replaced), C(overridden), C(deleted) or
    C(purged)
  sample:
  - router bgp 65000
  - neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
  - bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
  type: list
gathered:
  description: Facts about the network resource gathered from the remote device as
    structured data.
  returned: when I(state) is C(gathered)
  sample: 'This output will always be in the same format as the module argspec.

    '
  type: list
parsed:
  description: The device native config provided in I(running_config) option parsed
    into structured data as per module argspec.
  returned: when I(state) is C(parsed)
  sample: 'This output will always be in the same format as the module argspec.

    '
  type: list
rendered:
  description: The provided configuration in the task rendered in device-native format
    (offline).
  returned: when I(state) is C(rendered)
  sample:
  - router bgp 65000
  - neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
  - bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
  type: list