.. _dellemc.enterprise_sonic.sonic_bgp_module: ********************************** dellemc.enterprise_sonic.sonic_bgp ********************************** **Manage global BGP and its parameters** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - This module provides configuration management of global BGP parameters on devices running Enterprise SONiC Distribution by Dell Technologies. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
list / elements=dictionary
Specifies the BGP-related configuration.
as_notation
string
    Choices:
  • asdot
  • asdot+
Specify the AS number notation format
Option supported on Enterprise-Sonic releases 4.4.0 and higher.
bestpath
dictionary
Configures the BGP best-path.
as_path
dictionary
Configures the as-path values.
confed
boolean
    Choices:
  • no
  • yes
Configures the confed values of as-path.
ignore
boolean
    Choices:
  • no
  • yes
Configures the ignore values of as-path.
multipath_relax
boolean
    Choices:
  • no
  • yes
Configures the multipath_relax values of as-path.
multipath_relax_as_set
boolean
    Choices:
  • no
  • yes
Configures the multipath_relax_as_set values of as-path.
bandwidth
string
added in 3.1.0
    Choices:
  • default_weight
  • ignore_weight
  • skip_missing
Link Bandwidth attribute for the bestpath selection process
Options are as follows
default_weight - Assign a low default weight (value 1) to paths not having link bandwidth
ignore_weight - Ignore link bandwidth (i.e., do regular ECMP, not weighted)
skip_missing - Ignore paths without link bandwidth for ECMP (if other paths have it)
compare_routerid
boolean
    Choices:
  • no
  • yes
Configures the compare_routerid.
med
dictionary
Configures the med values.
always_compare_med
boolean
    Choices:
  • no
  • yes
Allows comparing meds from different neighbors if set to true
confed
boolean
    Choices:
  • no
  • yes
Configures the confed values of med.
missing_as_worst
boolean
    Choices:
  • no
  • yes
Configures the missing_as_worst values of as-path.
bgp_as
string / required
Specifies the BGP autonomous system (AS) number to configure on the device.
graceful_restart
dictionary
added in 3.1.0
Configure graceful restart
enabled
boolean
    Choices:
  • no
  • yes
Enable graceful restart
preserve_fw_state
boolean
    Choices:
  • no
  • yes
Configures preserve-fw-state
restart_time
integer
Configures restart-time.
The range is from 1 to 3600.
stale_routes_time
integer
Configures stale-routes-time.
The range is from 1 to 3600.
log_neighbor_changes
boolean
    Choices:
  • no
  • yes
Enables/disables logging neighbor up/down and reset reason.
max_med
dictionary
Configure max med and its parameters
on_startup
dictionary
On startup time and max-med value
med_val
integer
on startup med value
timer
integer
Configures on startup time
router_id
string
Configures the BGP routing process router-id value.
rt_delay
integer
Time in seconds to wait before processing route-map changes.
Range is 0-600. 0 disables the timer and changes to route-map will not be updated.
timers
dictionary
Adjust routing timers
holdtime
integer
Configures hold-time
keepalive_interval
integer
Configures keepalive-interval
vrf_name
string
Default:
"default"
Specifies the VRF name.
state
string
    Choices:
  • merged ←
  • deleted
  • replaced
  • overridden
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.
In case of replaced, the existing configuration of the specified BGP AS will be replaced with provided configuration.
In case of overridden, the existing BGP configuration will be overridden with the provided configuration.

Notes ----- .. note:: - Tested against Enterprise SONiC Distribution by Dell Technologies. - Supports ``check_mode``. Examples -------- .. code-block:: yaml # Using "deleted" state # # Before state: # ------------- # # ! # router bgp 10 vrf VrfCheck1 # router-id 10.2.2.32 # route-map delay-timer 20 # log-neighbor-changes # ! # router bgp 11 vrf VrfCheck2 # log-neighbor-changes # bestpath as-path ignore # bestpath med missing-as-worst confed # bestpath compare-routerid # ! # router bgp 4 # router-id 10.2.2.4 # graceful-restart enable # graceful-restart restart-time 1 # graceful-restart stalepath-time 500 # route-map delay-timer 10 # bestpath as-path ignore # bestpath as-path confed # bestpath med missing-as-worst confed # bestpath compare-routerid # bestpath bandwidth default-weight # ! # - name: Delete BGP Global attributes dellemc.enterprise_sonic.sonic_bgp: config: - bgp_as: 4 router_id: 10.2.2.4 rt_delay: 10 log_neighbor_changes: false graceful_restart: stale_routes_time: 500 restart_time: 1 bestpath: as_path: confed: true ignore: true multipath_relax: false multipath_relax_as_set: true bandwidth: default_weight compare_routerid: true med: confed: true missing_as_worst: true - bgp_as: 10 router_id: 10.2.2.32 rt_delay: 20 log_neighbor_changes: true vrf_name: 'VrfCheck1' - bgp_as: 11 log_neighbor_changes: true vrf_name: 'VrfCheck2' bestpath: as_path: confed: false ignore: true multipath_relax_as_set: true compare_routerid: true med: confed: true missing_as_worst: true state: deleted # After state: # ------------ # # ! # router bgp 10 vrf VrfCheck1 # log-neighbor-changes # ! # router bgp 11 vrf VrfCheck2 # log-neighbor-changes # bestpath compare-routerid # ! # router bgp 4 # graceful-restart enable # log-neighbor-changes # bestpath compare-routerid # ! # Using "deleted" state # # Before state: # ------------- # # ! # router bgp 10 vrf VrfCheck1 # router-id 10.2.2.32 # route-map delay-timer 20 # log-neighbor-changes # ! # router bgp 11 vrf VrfCheck2 # graceful-restart enable # log-neighbor-changes # bestpath as-path ignore # bestpath med missing-as-worst confed # bestpath compare-routerid # bestpath bandwidth ignore-weight # ! # router bgp 4 # router-id 10.2.2.4 # route-map delay-timer 10 # bestpath as-path ignore # bestpath as-path confed # bestpath med missing-as-worst confed # bestpath compare-routerid # ! - name: Deletes all the bgp global configurations dellemc.enterprise_sonic.sonic_bgp: config: state: deleted # After state: # ------------ # # ! # ! # Using "merged" state # # Before state: # ------------- # # ! # router bgp 4 # router-id 10.1.1.4 # ! # - name: Merges provided configuration with device configuration dellemc.enterprise_sonic.sonic_bgp: config: - bgp_as: 4 router_id: 10.2.2.4 rt_delay: 10 log_neighbor_changes: false graceful_restart: enabled: true preserve_fw_state: true timers: holdtime: 20 keepalive_interval: 30 bestpath: as_path: confed: true ignore: true multipath_relax: false multipath_relax_as_set: true bandwidth: ignore-weight compare_routerid: true med: confed: true missing_as_worst: true always_compare_med: true max_med: on_startup: timer: 667 med_val: 7878 - bgp_as: 10 router_id: 10.2.2.32 rt_delay: 20 log_neighbor_changes: true vrf_name: 'VrfCheck1' - bgp_as: 11 log_neighbor_changes: true vrf_name: 'VrfCheck2' bestpath: as_path: confed: false ignore: true multipath_relax_as_set: true compare_routerid: true med: confed: true missing_as_worst: true state: merged # # After state: # ------------ # # ! # router bgp 10 vrf VrfCheck1 # router-id 10.2.2.32 # route-map delay-timer 20 # log-neighbor-changes # ! # router bgp 11 vrf VrfCheck2 # log-neighbor-changes # bestpath as-path ignore # bestpath med missing-as-worst confed # bestpath compare-routerid # ! # router bgp 4 # router-id 10.2.2.4 # graceful-restart enable # graceful-restart preserve-fw-state # route-map delay-timer 10 # bestpath as-path ignore # bestpath as-path confed # bestpath med missing-as-worst confed # bestpath compare-routerid # bestpath bandwidth ignore-weight # always-compare-med # max-med on-startup 667 7878 # timers 20 30 # # ! # Using "replaced" state # # Before state: # ------------- # # ! # router bgp 10 vrf VrfCheck1 # router-id 10.2.2.32 # log-neighbor-changes # timers 60 180 # ! # router bgp 4 # router-id 10.2.2.4 # max-med on-startup 667 7878 # bestpath as-path ignore # bestpath as-path confed # bestpath med missing-as-worst confed # bestpath compare-routerid # bestpath bandwidth default-weight # timers 20 30 # ! # - name: Replace device configuration of specified BGP AS with provided dellemc.enterprise_sonic.sonic_bgp: config: - bgp_as: 4 router_id: 10.2.2.44 log_neighbor_changes: true bestpath: as_path: confed: true bandwidth: skip_missing compare_routerid: true - bgp_as: 11 vrf_name: 'VrfCheck2' router_id: 10.2.2.33 log_neighbor_changes: true bestpath: as_path: confed: true ignore: true compare_routerid: true med: confed: true missing_as_worst: true state: replaced # # After state: # ------------ # # ! # router bgp 10 vrf VrfCheck1 # router-id 10.2.2.32 # log-neighbor-changes # timers 60 180 # ! # router bgp 11 vrf VrfCheck2 # router-id 10.2.2.33 # log-neighbor-changes # bestpath as-path ignore # bestpath as-path confed # bestpath med missing-as-worst confed # bestpath compare-routerid # timers 60 180 # ! # router bgp 4 # router-id 10.2.2.44 # log-neighbor-changes # bestpath as-path confed # bestpath compare-routerid # bestpath bandwidth skip_missing # timers 60 180 # ! # Using "overridden" state # # Before state: # ------------- # # ! # router bgp 10 vrf VrfCheck1 # router-id 10.2.2.32 # log-neighbor-changes # timers 60 180 # ! # router bgp 4 # router-id 10.2.2.4 # max-med on-startup 667 7878 # bestpath as-path ignore # bestpath as-path confed # bestpath med missing-as-worst confed # bestpath compare-routerid # bestpath bandwidth default-weight # timers 20 30 # ! # - name: Override device configuration of global BGP with provided configuration dellemc.enterprise_sonic.sonic_bgp: config: - bgp_as: 4 router_id: 10.2.2.44 log_neighbor_changes: true bestpath: as_path: confed: true compare_routerid: true - bgp_as: 11 vrf_name: 'VrfCheck2' router_id: 10.2.2.33 log_neighbor_changes: true bestpath: as_path: confed: true ignore: true compare_routerid: true timers: holdtime: 90 keepalive_interval: 30 state: overridden # # After state: # ------------ # # ! # router bgp 11 vrf VrfCheck2 # router-id 10.2.2.33 # log-neighbor-changes # bestpath as-path ignore # bestpath as-path confed # bestpath compare-routerid # timers 30 90 # ! # router bgp 4 # router-id 10.2.2.44 # log-neighbor-changes # bestpath as-path confed # bestpath compare-routerid # timers 60 180 # ! Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
list
when changed
The resulting configuration module invocation.

Sample:
The configuration returned is always in the same format as the parameters above.
before
list
always
The configuration prior to the module invocation.

Sample:
The configuration returned is always in the same format as the parameters above.
commands
list
always
The set of commands pushed to the remote device.

Sample:
['command 1', 'command 2', 'command 3']


Status ------ Authors ~~~~~~~ - Dhivya P (@dhivayp)