arista.eos.eos_bgp – Configure global BGP protocol settings on Arista EOS.

From Get docs
Ansible/docs/2.10/collections/arista/eos/eos bgp module


arista.eos.eos_bgp – Configure global BGP protocol settings on Arista EOS.

Note

This plugin is part of the arista.eos collection (version 1.2.0).

To install it use: ansible-galaxy collection install arista.eos.

To use it in a playbook, specify: arista.eos.eos_bgp.


New in version 1.0.0: of arista.eos


Synopsis

  • This module provides configuration management of global BGP parameters on Arista EOS devices.

Note

This module has a corresponding action plugin.


Parameters

Parameter Choices/Defaults Comments

config

dictionary

Specifies the BGP related configuration.

address_family

list / elements=dictionary

Specifies BGP address family related configurations.

afi

string / required

  • ipv4
  • ipv6

Type of address family to configure.

neighbors

list / elements=dictionary

Specifies BGP neighbor related configurations in Address Family configuration mode.

activate

boolean

  • no
  • yes

Enable the Address Family for this Neighbor.

default_originate

boolean

  • no
  • yes

Originate default route to this neighbor.

graceful_restart

boolean

  • no
  • yes

Enable/disable graceful restart mode for this neighbor.

neighbor

string / required

Neighbor router address.

weight

integer

Assign weight for routes learnt from this neighbor.

The range is from 0 to 65535

networks

list / elements=dictionary

Specify Networks to announce via BGP.

For operation replace, this option is mutually exclusive with root level networks option.

masklen

integer

Subnet mask length for the Network to announce(e.g, 8, 16, 24, etc.).

prefix

string / required

Network ID to announce via BGP.

route_map

string

Route map to modify the attributes.

redistribute

list / elements=dictionary

Specifies the redistribute information from another routing protocol.

protocol

string / required

  • ospf3
  • ospf
  • isis
  • static
  • connected
  • rip

Specifies the protocol for configuring redistribute information.

route_map

string

Specifies the route map reference.

bgp_as

integer / required

Specifies the BGP Autonomous System (AS) number to configure on the device.

log_neighbor_changes

boolean

  • no
  • yes

Enable/disable logging neighbor up/down and reset reason.

neighbors

list / elements=dictionary

Specifies BGP neighbor related configurations.

description

string

Neighbor specific description.

ebgp_multihop

integer

Specifies the maximum hop count for EBGP neighbors not on directly connected networks.

The range is from 1 to 255.

enabled

boolean

  • no
  • yes

Administratively shutdown or enable a neighbor.

maximum_prefix

integer

Maximum number of prefixes to accept from this peer.

The range is from 0 to 4294967294.

neighbor

string / required

Neighbor router address.

password

string

Password to authenticate the BGP peer connection.

peer_group

string

Name of the peer group that the neighbor is a member of.

remote_as

integer / required

Remote AS of the BGP neighbor to configure.

remove_private_as

boolean

  • no
  • yes

Remove the private AS number from outbound updates.

route_reflector_client

integer

Specify a neighbor as a route reflector client.

timers

dictionary

Specifies BGP neighbor timer related configurations.

holdtime

integer / required

Interval (in seconds) after not receiving a keepalive message that device declares a peer dead.

The range is from 3 to 7200.

Setting this value to 0 will not send keep-alives (hold forever).

keepalive

integer / required

Frequency (in seconds) with which the device sends keepalive messages to its peer.

The range is from 0 to 3600.

update_source

string

Source of the routing updates.

networks

list / elements=dictionary

Specify Networks to announce via BGP.

For operation replace, this option is mutually exclusive with networks option under address_family.

For operation replace, if the device already has an address family activated, this option is not allowed.

masklen

integer

Subnet mask length for the Network to announce(e.g, 8, 16, 24, etc.).

prefix

string / required

Network ID to announce via BGP.

route_map

string

Route map to modify the attributes.

redistribute

list / elements=dictionary

Specifies the redistribute information from another routing protocol.

protocol

string / required

  • ospf
  • ospf3
  • static
  • connected
  • rip
  • isis

Specifies the protocol for configuring redistribute information.

route_map

string

Specifies the route map reference.

router_id

string

Configures the BGP routing process router-id value.

operation

string

  • merge

  • replace
  • override
  • delete

Specifies the operation to be performed on the BGP process configured on the device.

In case of merge, the input configuration will be merged with the existing BGP configuration on the device.

In case of replace, if there is a diff between the existing configuration and the input configuration, the existing configuration will be replaced by the input configuration for every option that has the diff.

In case of override, all the existing BGP configuration will be removed from the device and replaced with the input configuration.

In case of delete the existing BGP configuration will be removed from the device.



Notes

Note

  • Tested against Arista vEOS Version 4.15.9M.


Examples

- name: configure global bgp as 64496
  arista.eos.eos_bgp:
    config:
      bgp_as: 64496
      router_id: 192.0.2.1
      log_neighbor_changes: true
      neighbors:
      - neighbor: 203.0.113.5
        remote_as: 64511
        timers:
          keepalive: 300
          holdtime: 360
      - neighbor: 198.51.100.2
        remote_as: 64498
      networks:
      - prefix: 198.51.100.0
        route_map: RMAP_1
      - prefix: 192.0.2.0
        masklen: 23
      address_family:
      - afi: ipv4
        safi: unicast
        redistribute:
        - protocol: isis
          route_map: RMAP_1
    operation: merge

- name: Configure BGP neighbors
  arista.eos.eos_bgp:
    config:
      bgp_as: 64496
      neighbors:
      - neighbor: 192.0.2.10
        remote_as: 64496
        description: IBGP_NBR_1
        ebgp_multihop: 100
        timers:
          keepalive: 300
          holdtime: 360

      - neighbor: 192.0.2.15
        remote_as: 64496
        description: IBGP_NBR_2
        ebgp_multihop: 150
    operation: merge

- name: Configure root-level networks for BGP
  arista.eos.eos_bgp:
    config:
      bgp_as: 64496
      networks:
      - prefix: 203.0.113.0
        masklen: 27
        route_map: RMAP_1

      - prefix: 203.0.113.32
        masklen: 27
        route_map: RMAP_2
    operation: merge

- name: Configure BGP neighbors under address family mode
  arista.eos.eos_bgp:
    config:
      bgp_as: 64496
      address_family:
      - afi: ipv4
        neighbors:
        - neighbor: 203.0.113.10
          activate: yes
          default_originate: true

        - neighbor: 192.0.2.15
          activate: yes
          graceful_restart: true
    operation: merge

- name: remove bgp as 64496 from config
  arista.eos.eos_bgp:
    config:
      bgp_as: 64496
    operation: delete

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description

commands

list / elements=string

always

The list of configuration mode commands to send to the device


Sample:

['router bgp 64496', 'bgp router-id 192.0.2.1', 'bgp log-neighbor-changes', 'neighbor 203.0.113.5 remote-as 64511', 'neighbor 203.0.113.5 timers 300 360', 'neighbor 198.51.100.2 remote-as 64498', 'network 198.51.100.0 route-map RMAP_1', 'network 192.0.2.0 mask 255.255.254.0', 'address-family ipv4', 'redistribute isis route-map RMAP_1', 'exit-address-family']




Authors

  • Nilashish Chakraborty (@NilashishC)

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/arista/eos/eos_bgp_module.html