dellemc.enterprise_sonic.sonic_bgp_neighbors_af module – Manage the BGP neighbor address-family and its parameters
Note
This module is part of the dellemc.enterprise_sonic collection (version 3.0.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install dellemc.enterprise_sonic
.
To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_bgp_neighbors_af
.
New in dellemc.enterprise_sonic 1.0.0
Synopsis
This module provides configuration management of BGP neighbors address-family parameters on devices running Enterprise SONiC.
bgp_as, vrf_name and neighbors need be created in advance on the device.
Note
This module has a corresponding action plugin.
Parameters
Parameter |
Comments |
---|---|
Specifies the BGP neighbors address-family related configuration. |
|
Specifies the BGP autonomous system (AS) number which is already configured on the device. |
|
Specifies BGP neighbor related configurations in address-family configuration mode. |
|
Specifies BGP address-family related configurations. afi and safi are required together. |
|
Enables the address-family for this neighbor. Choices:
|
|
Type of address-family to configure. Choices:
|
|
Specifies the allowas in values. |
|
Specifies the origin value. Choices:
|
|
Specifies the value of the allowas in. |
|
Configure a neighbor as fabric-external. Fabric external is supported only for l2vpn address family. Choices:
|
|
Common configuration attributes for IPv4 and IPv6 unicast address families. |
|
Specifies routing policy definition. |
|
Enable or disable sending of default-route to the neighbor. Choices:
|
|
Specifies prefix limit attributes for ipv4-unicast and ipv6-unicast. |
|
Maximum number of prefixes that will be accepted from the neighbor. |
|
Enable or disable teardown of BGP session when maximum prefix limit is exceeded. Choices:
|
|
Time interval in seconds after which the BGP session is re-established after being torn down. |
|
Threshold on number of prefixes that can be received from a neighbor before generation of warning messages. Expressed as a percentage of max-prefixes. |
|
Inbound route filtering policy for a neighbor. |
|
Outbound route filtering policy for a neighbor. |
|
Specifies the route-map. |
|
Specifies the direction of the route-map. |
|
Specifies the name of the route-map. |
|
Specifies a neighbor as a route-reflector client. Choices:
|
|
Specifies a neighbor as a route-server client. Choices:
|
|
Specifies the type of cast for the address-family. Choices:
|
|
Neighbor router address which is already configured on the device. |
|
Specifies the VRF name which is already configured on the device. Default: |
|
Specifies the operation to be performed on the BGP process that is configured on the device. In case of merged, the input configuration is merged with the existing BGP configuration on the device. In case of deleted, the existing BGP configuration is removed from the device. Choices:
|
Notes
Note
Tested against Enterprise SONiC Distribution by Dell Technologies.
Supports
check_mode
.
Examples
# Using deleted
#
# Before state:
# -------------
#
#!
#router bgp 4
# !
# neighbor interface Eth1/3
# !
# address-family ipv4 unicast
# activate
# allowas-in 4
# route-map aa in
# route-map aa out
# route-reflector-client
# route-server-client
# send-community both
#!
#
- name: Deletes neighbors address-family with specific values
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
- bgp_as: 4
neighbors:
- neighbor: Eth1/3
address_family:
- afi: ipv4
safi: unicast
allowas_in:
value: 4
route_map:
- name: aa
direction: in
- name: aa
direction: out
route_reflector_client: true
route_server_client: true
state: deleted
# After state:
# ------------
#!
#router bgp 4
# !
# neighbor interface Eth1/3
# !
# address-family ipv4 unicast
# send-community both
#!
# Using deleted
#
# Before state:
# -------------
#
#!
#router bgp 4
# !
# neighbor interface Eth1/3
# !
# address-family ipv4 unicast
# activate
# allowas-in 4
# route-map aa in
# route-map aa out
# route-reflector-client
# route-server-client
# send-community both
#!
# neighbor interface Eth1/5
# !
# address-family ipv4 unicast
# activate
# allowas-in origin
# send-community both
#!
#
- name: Deletes neighbors address-family with specific values
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
state: deleted
# After state:
# ------------
#!
#router bgp 4
#!
# Using deleted
#
# Before state:
# -------------
#
#!
#router bgp 4
# !
# neighbor interface Eth1/3
#!
#
- name: Merges neighbors address-family with specific values
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
- bgp_as: 4
neighbors:
- neighbor: Eth1/3
address_family:
- afi: ipv4
safi: unicast
allowas_in:
value: 4
route_map:
- name: aa
direction: in
- name: aa
direction: out
route_reflector_client: true
route_server_client: true
state: merged
# After state:
# ------------
#!
#router bgp 4
# !
# neighbor interface Eth1/3
# !
# address-family ipv4 unicast
# activate
# allowas-in 4
# route-map aa in
# route-map aa out
# route-reflector-client
# route-server-client
# send-community both
#!
# Using merged
#
# Before state:
# -------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# (No bgp neighbor configuration present)
- name: "Configure BGP neighbor prefix-list attributes"
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
- bgp_as: 51
neighbors:
- neighbor: 1.1.1.1
address_family:
- afi: ipv4
safi: unicast
ip_afi:
default_policy_name: rmap_reg1
send_default_route: true
prefix_limit:
max_prefixes: 1
prevent_teardown: true
warning_threshold: 80
prefix_list_in: p1
prefix_list_out: p2
state: merged
# After state:
# ------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# !
# neighbor 1.1.1.1
# !
# address-family ipv4 unicast
# default-originate route-map rmap_reg1
# prefix-list p1 in
# prefix-list p2 out
# send-community both
# maximum-prefix 1 80 warning-only
# Using deleted
#
# Before state:
# -------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# !
# neighbor 1.1.1.1
# !
# address-family ipv6 unicast
# default-originate route-map rmap_reg2
# prefix-list p1 in
# prefix-list p2 out
# send-community both
# maximum-prefix 5 90 restart 2
- name: "Delete BGP neighbor prefix-list attributes"
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
- bgp_as: 51
neighbors:
- neighbor: 1.1.1.1
address_family:
- afi: ipv6
safi: unicast
ip_afi:
default_policy_name: rmap_reg2
send_default_route: true
prefix_limit:
max_prefixes: 5
warning_threshold: 90
restart-timer: 2
prefix_list_in: p1
prefix_list_out: p2
state: deleted
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# (No bgp neighbor configuration present)
# Using replaced
#
# Before state:
# -------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# !
# neighbor 1.1.1.1
# !
# address-family ipv6 unicast
# default-originate route-map rmap_reg2
# prefix-list p1 in
# prefix-list p2 out
# send-community both
# maximum-prefix 5 90 restart 2
- name: "Replace BGP neighbor address-family attributes"
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
- bgp_as: 51
neighbors:
- neighbor: 1.1.1.1
address_family:
- afi: ipv4
safi: unicast
ip_afi:
default_policy_name: rmap_reg1
send_default_route: true
prefix_limit:
max_prefixes: 1
prevent_teardown: true
warning_threshold: 80
prefix_list_in: p1
prefix_list_out: p2
state: replaced
# After state:
# ------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# !
# neighbor 1.1.1.1
# !
# address-family ipv4 unicast
# default-originate route-map rmap_reg1
# prefix-list p1 in
# prefix-list p2 out
# send-community both
# maximum-prefix 1 80 warning-only
#
#
# Using overridden
#
# Before state:
# -------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# !
# neighbor 1.1.1.1
# !
# address-family ipv6 unicast
# default-originate route-map rmap_reg2
# prefix-list p1 in
# prefix-list p2 out
# send-community both
# maximum-prefix 5 90 restart 2
- name: "Override BGP neighbors"
dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
config:
- bgp_as: 51
neighbors:
- neighbor: 2.2.2.2
address_family:
- afi: ipv4
safi: unicast
ip_afi:
default_policy_name: rmap_reg1
send_default_route: true
prefix_limit:
max_prefixes: 1
prevent_teardown: true
warning_threshold: 80
prefix_list_in: p1
prefix_list_out: p2
state: replaced
# After state:
# ------------
#
# sonic# show running-configuration bgp neighbor vrf default 1.1.1.1
# !
# neighbor 1.1.1.1
# !
# address-family ipv4 unicast
# default-originate route-map rmap_reg1
# prefix-list p1 in
# prefix-list p2 out
# send-community both
# maximum-prefix 1 80 warning-only
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The resulting configuration module invocation. Returned: when changed Sample: |
|
The generated configuration module invocation. Returned: when Sample: |
|
The configuration prior to the module invocation. Returned: always Sample: |
|
The set of commands pushed to the remote device. Returned: always Sample: |