Manages BGP configuration on network devices and provides statistics.
codeauthor: | Mircea Ulinic <mircea@cloudflare.com> & Jerome Fleury <jf@cloudflare.com> |
---|---|
maturity: | new |
depends: | napalm |
platform: | unix |
New in version 2016.11.0.
salt.modules.napalm_bgp.
config
(*args, **kwargs)¶Provides the BGP configuration on the device.
Parameters: |
|
---|---|
Returns: | A dictionary containing the BGP configuration from the network device. The keys of the main dictionary are the group names. |
Each group has the following properties:
- type (string)
- description (string)
- apply_groups (string list)
- multihop_ttl (int)
- multipath (True/False)
- local_address (string)
- local_as (int)
- remote_as (int)
- import_policy (string)
- export_policy (string)
- remove_private_as (True/False)
- prefix_limit (dictionary)
- neighbors (dictionary)
Each neighbor in the dictionary of neighbors provides:
- description (string)
- import_policy (string)
- export_policy (string)
- local_address (string)
- local_as (int)
- remote_as (int)
- authentication_key (string)
- prefix_limit (dictionary)
- route_reflector_client (True/False)
- nhs (True/False)
CLI Example:
salt '*' bgp.config # entire BGP config
salt '*' bgp.config PEERS-GROUP-NAME # provides detail only about BGP group PEERS-GROUP-NAME
salt '*' bgp.config PEERS-GROUP-NAME 172.17.17.1 # provides details only about BGP neighbor 172.17.17.1,
# configured in the group PEERS-GROUP-NAME
Output Example:
{
'PEERS-GROUP-NAME':{
'type' : u'external',
'description' : u'Here we should have a nice description',
'apply_groups' : [u'BGP-PREFIX-LIMIT'],
'import_policy' : u'PUBLIC-PEER-IN',
'export_policy' : u'PUBLIC-PEER-OUT',
'remove_private': True,
'multipath' : True,
'multihop_ttl' : 30,
'neighbors' : {
'192.168.0.1': {
'description' : 'Facebook [CDN]',
'prefix_limit' : {
'inet': {
'unicast': {
'limit': 100,
'teardown': {
'threshold' : 95,
'timeout' : 5
}
}
}
}
'peer-as' : 32934,
'route_reflector': False,
'nhs' : True
},
'172.17.17.1': {
'description' : 'Twitter [CDN]',
'prefix_limit' : {
'inet': {
'unicast': {
'limit': 500,
'no-validate': 'IMPORT-FLOW-ROUTES'
}
}
}
'peer_as' : 13414
'route_reflector': False,
'nhs' : False
}
}
}
}
salt.modules.napalm_bgp.
neighbors
(*args, **kwargs)¶Provides details regarding the BGP sessions configured on the network device.
Parameters: | neighbor -- IP Address of a specific neighbor. |
---|---|
Returns: | A dictionary with the statistics of the all/selected BGP
neighbors. Outer dictionary keys represent the VRF name. Keys of inner
dictionary represent the AS numbers, while the values are lists of
dictionaries, having the following keys:
|
CLI Example:
salt '*' bgp.neighbors # all neighbors
salt '*' bgp.neighbors 172.17.17.1 # only session with BGP neighbor(s) 172.17.17.1
Output Example:
{
'default': {
8121: [
{
'up' : True,
'local_as' : 13335,
'remote_as' : 8121,
'local_address' : u'172.101.76.1',
'local_address_configured' : True,
'local_port' : 179,
'remote_address' : u'192.247.78.0',
'router_id': : u'192.168.0.1',
'remote_port' : 58380,
'multihop' : False,
'import_policy' : u'4-NTT-TRANSIT-IN',
'export_policy' : u'4-NTT-TRANSIT-OUT',
'input_messages' : 123,
'output_messages' : 13,
'input_updates' : 123,
'output_updates' : 5,
'messages_queued_out' : 23,
'connection_state' : u'Established',
'previous_connection_state' : u'EstabSync',
'last_event' : u'RecvKeepAlive',
'suppress_4byte_as' : False,
'local_as_prepend' : False,
'holdtime' : 90,
'configured_holdtime' : 90,
'keepalive' : 30,
'configured_keepalive' : 30,
'active_prefix_count' : 132808,
'received_prefix_count' : 566739,
'accepted_prefix_count' : 566479,
'suppressed_prefix_count' : 0,
'advertise_prefix_count' : 0,
'flap_count' : 27
}
]
}
}