BGP
Border Gateway Protocol (BGP) is the de facto standard exterior gateway protocol used to exchange routing information between autonomous systems (AS) on the Internet and in large enterprise networks. It’s a path-vector protocol that makes routing decisions based on network policies, rules, and path attributes rather than just metrics, enabling fine-grained control over traffic flows and routing policies. BGP supports multiple address families including IPv4 unicast, IPv6 unicast, and L2VPN EVPN, making it essential for modern multi-service networks and MPLS VPN deployments.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”routing (iosxe.devices.configuration)
Section titled “routing (iosxe.devices.configuration)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
bgp | Class | [bgp] | No |
bgp (iosxe.devices.configuration.routing)
Section titled “bgp (iosxe.devices.configuration.routing)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
as_number | Integer | Yes | ||
default_ipv4_unicast | Boolean | true , false | No | |
log_neighbor_changes | Boolean | true , false | No | |
router_id_loopback | Integer | No | ||
address_family | Class | [address_family] | No | |
neighbors | List | [neighbors] | No |
address_family (iosxe.devices.configuration.routing.bgp)
Section titled “address_family (iosxe.devices.configuration.routing.bgp)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
ipv4_unicast | Class | [ipv4_unicast] | No | |
ipv6_unicast | Class | [ipv6_unicast] | No | |
l2vpn_evpn | Class | [l2vpn_evpn] | No |
neighbors (iosxe.devices.configuration.routing.bgp)
Section titled “neighbors (iosxe.devices.configuration.routing.bgp)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
ip | IP | Yes | ||
remote_as | Integer | Yes | ||
description | String | No | ||
shutdown | Boolean | true , false | No | |
cluster_id | IP | No | ||
disable_connected_check | Boolean | true , false | No | |
fall_over_default_enable | Boolean | true , false | No | |
fall_over_default_route_map | String | No | ||
fall_over_bfd | Boolean | true , false | No | |
fall_over_bfd_multi_hop | Boolean | true , false | No | |
fall_over_bfd_single_hop | Boolean | true , false | No | |
fall_over_bfd_check_control_plane_failure | Boolean | true , false | No | |
fall_over_bfd_strict_mode | Boolean | true , false | No | |
fall_over_maximum_metric_route_map | String | No | ||
local_as | Integer | No | ||
local_as_no_prepend | Boolean | true , false | No | |
local_as_replace_as | Boolean | true , false | No | |
local_as_dual_as | Boolean | true , false | No | |
log_neighbor_changes | Boolean | true , false | No | |
password_type | Integer | min: 0 , max: 7 | No | |
password | String | No | ||
peer_group | String | No | ||
timers_keepalive | Integer | min: 0 , max: 3600 | No | |
timers_holdtime | Integer | min: 0 , max: 3600 | No | |
timers_minimum_neighbor_holdtime | Integer | min: 0 , max: 3600 | No | |
ttl_security_hops | Integer | min: 0 , max: 254 | No | |
update_source_loopback | Integer | No | ||
ebgp_multihop | Boolean | true , false | No | |
ebgp_multihop_max_hop | Integer | min: 1 , max: 255 | No |
ipv4_unicast (iosxe.devices.configuration.routing.bgp.address_family)
Section titled “ipv4_unicast (iosxe.devices.configuration.routing.bgp.address_family)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
aggregate_addresses | List | [aggregate_addresses] | No | |
networks | List | [networks] | No | |
neighbors | List | [neighbors] | No | |
vrfs | List | [vrfs] | No | |
redistribute | Class | [redistribute] | No | |
admin_distances | List | [admin_distances] | No | |
distance_bgp_external | Integer | min: 1 , max: 255 | No | |
distance_bgp_internal | Integer | min: 1 , max: 255 | No | |
distance_bgp_local | Integer | min: 1 , max: 255 | No |
ipv6_unicast (iosxe.devices.configuration.routing.bgp.address_family)
Section titled “ipv6_unicast (iosxe.devices.configuration.routing.bgp.address_family)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
networks | List | [networks] | No | |
vrfs | List | [vrfs] | No | |
neighbors | List | [neighbors] | No | |
redistribute | Class | [redistribute] | No |
l2vpn_evpn (iosxe.devices.configuration.routing.bgp.address_family)
Section titled “l2vpn_evpn (iosxe.devices.configuration.routing.bgp.address_family)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
neighbors | List | [neighbors] | No |
aggregate_addresses (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast)
Section titled “aggregate_addresses (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
address | IP | Yes | ||
mask | IP | Yes |
networks (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast)
Section titled “networks (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
network | IP | Yes | ||
mask | IP | No | ||
route_map | String | No | ||
backdoor | Boolean | true , false | No |
neighbors (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast)
Section titled “neighbors (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
ip | IP | Yes | ||
activate | Boolean | true , false | No | |
send_community | Choice | both , extended , standard | No | |
route_reflector_client | Boolean | true , false | No | |
soft_reconfiguration | Choice | inbound | No | |
default_originate | Boolean | true , false | No | |
default_originate_route_map | String | No | ||
route_maps | List | [route_maps] | No |
vrfs (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast)
Section titled “vrfs (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
vrf | String | Yes | ||
advertise_l2vpn_evpn | Boolean | true , false | No | |
router_id_loopback | Integer | No | ||
aggregate_addresses | List | [aggregate_addresses] | No | |
networks | List | [networks] | No | |
neighbors | List | [neighbors] | No | |
redistribute | Class | [redistribute] | No | |
admin_distances | List | [admin_distances] | No | |
distance_bgp_external | Integer | min: 1 , max: 255 | No | |
distance_bgp_internal | Integer | min: 1 , max: 255 | No | |
distance_bgp_local | Integer | min: 1 , max: 255 | No |
redistribute (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast)
Section titled “redistribute (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
connected | Boolean | true , false | No | |
static | Boolean | true , false | No |
admin_distances (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast)
Section titled “admin_distances (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
distance | Integer | min: 1 , max: 255 | Yes | |
source_ip | IP | Yes | ||
wildcard | IP | Yes | ||
acl | String | No |
networks (iosxe.devices.configuration.routing.bgp.address_family.ipv6_unicast)
Section titled “networks (iosxe.devices.configuration.routing.bgp.address_family.ipv6_unicast)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
prefix | IP | Yes | ||
route_map | String | No | ||
backdoor | Boolean | true , false | No |
vrfs (iosxe.devices.configuration.routing.bgp.address_family.ipv6_unicast)
Section titled “vrfs (iosxe.devices.configuration.routing.bgp.address_family.ipv6_unicast)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
vrf | String | Yes | ||
advertise_l2vpn_evpn | Boolean | true , false | No | |
networks | List | [networks] | No | |
redistribute | Class | [redistribute] | No |
neighbors (iosxe.devices.configuration.routing.bgp.address_family.ipv6_unicast)
Section titled “neighbors (iosxe.devices.configuration.routing.bgp.address_family.ipv6_unicast)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
ip | IP | Yes | ||
activate | Boolean | true , false | No | |
send_community | Choice | both , extended , standard | No | |
route_reflector_client | Boolean | true , false | No | |
soft_reconfiguration | Choice | inbound | No | |
default_originate | Boolean | true , false | No | |
default_originate_route_map | String | No |
redistribute (iosxe.devices.configuration.routing.bgp.address_family.ipv6_unicast)
Section titled “redistribute (iosxe.devices.configuration.routing.bgp.address_family.ipv6_unicast)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
connected | Boolean | true , false | No | |
static | Boolean | true , false | No |
neighbors (iosxe.devices.configuration.routing.bgp.address_family.l2vpn_evpn)
Section titled “neighbors (iosxe.devices.configuration.routing.bgp.address_family.l2vpn_evpn)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
ip | IP | Yes | ||
activate | Boolean | true , false | No | |
send_community | Choice | both , extended , standard | No | |
route_reflector_client | Boolean | true , false | No | |
soft_reconfiguration | Choice | inbound | No |
route_maps (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.neighbors)
Section titled “route_maps (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.neighbors)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
direction | Choice | in , out | Yes | |
name | String | Yes |
aggregate_addresses (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.vrfs)
Section titled “aggregate_addresses (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.vrfs)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
address | IP | Yes | ||
mask | IP | Yes |
networks (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.vrfs)
Section titled “networks (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.vrfs)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
network | IP | Yes | ||
mask | IP | No | ||
route_map | String | No | ||
backdoor | Boolean | true , false | No |
neighbors (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.vrfs)
Section titled “neighbors (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.vrfs)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
ip | IP | Yes | ||
remote_as | Integer | Yes | ||
description | String | No | ||
shutdown | Boolean | true , false | No | |
cluster_id | IP | No | ||
log_neighbor_changes | Boolean | true , false | No | |
password_type | Integer | min: 0 , max: 7 | No | |
password | String | No | ||
timers_keepalive | Integer | min: 0 , max: 3600 | No | |
timers_holdtime | Integer | min: 0 , max: 3600 | No | |
timers_minimum_holdtime | Integer | min: 0 , max: 3600 | No | |
fall_over_default_route_map | String | No | ||
fall_over_bfd | Boolean | true , false | No | |
fall_over_bfd_multi_hop | Boolean | true , false | No | |
fall_over_bfd_single_hop | Boolean | true , false | No | |
fall_over_bfd_check_control_plane_failure | Boolean | true , false | No | |
fall_over_bfd_strict_mode | Boolean | true , false | No | |
fall_over_maximum_metric_route_map | String | No | ||
disable_connected_check | Boolean | true , false | No | |
ttl_security_hops | Integer | min: 0 , max: 254 | No | |
local_as | Integer | No | ||
local_as_no_prepend | Boolean | true , false | No | |
local_as_replace_as | Boolean | true , false | No | |
local_as_dual_as | Boolean | true , false | No | |
update_source_loopback | Integer | No | ||
activate | Boolean | true , false | No | |
send_community | Choice | both , extended , standard | No | |
route_reflector_client | Boolean | true , false | No | |
soft_reconfiguration | Choice | inbound | No | |
default_originate | Boolean | true , false | No | |
default_originate_route_map | String | No | ||
route_maps | List | [route_maps] | No | |
ebgp_multihop | Boolean | true , false | No | |
ebgp_multihop_max_hop | Integer | min: 1 , max: 255 | No | |
ha_mode_graceful_restart | Boolean | true , false | No | |
next_hop_self | Boolean | true , false | No | |
next_hop_self_all | Boolean | true , false | No | |
advertisement_interval | Integer | min: 0 , max: 600 | No |
redistribute (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.vrfs)
Section titled “redistribute (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.vrfs)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
connected | Boolean | true , false | No | |
static | Boolean | true , false | No |
admin_distances (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.vrfs)
Section titled “admin_distances (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.vrfs)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
distance | Integer | min: 1 , max: 255 | Yes | |
source_ip | IP | Yes | ||
wildcard | IP | Yes | ||
acl | String | No |
networks (iosxe.devices.configuration.routing.bgp.address_family.ipv6_unicast.vrfs)
Section titled “networks (iosxe.devices.configuration.routing.bgp.address_family.ipv6_unicast.vrfs)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
prefix | IP | Yes | ||
route_map | String | No | ||
backdoor | Boolean | true , false | No | |
evpn | Boolean | true , false | No |
redistribute (iosxe.devices.configuration.routing.bgp.address_family.ipv6_unicast.vrfs)
Section titled “redistribute (iosxe.devices.configuration.routing.bgp.address_family.ipv6_unicast.vrfs)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
connected | Boolean | true , false | No | |
static | Boolean | true , false | No |
route_maps (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.vrfs.neighbors)
Section titled “route_maps (iosxe.devices.configuration.routing.bgp.address_family.ipv4_unicast.vrfs.neighbors)”Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
direction | Choice | in , out | Yes | |
name | String | Yes |
Examples
Section titled “Examples”Example 1: The example below shows basic BGP configuration to bring up an IPv4 Unicast Neighbor and includes basic attributes such as Password protected session, aggregate adderesses, redistribution, network advertisement and applying a route-map to the neighbor.
iosxe: devices: - name: device1 configuration: routing: bgp: as_number: 65000 default_ipv4_unicast: true log_neighbor_changes: true router_id_loopback: 0 neighbors: - ip: 192.168.1.1 remote_as: 65001 password: 045802150C2E1D1C5A password_type: 7 address_family: ipv4_unicast: redistribute_connected: true redistribute_static: true aggregate_addresses: - address: 192.168.0.0 mask: 255.255.0.0 - address: 10.0.0.0 mask: 255.255.255.0 networks: - network: 10.0.0.0 mask: 255.255.255.0 route_map: RM1 backdoor: false - network: 172.16.12.0 mask: 255.255.255.0 - network: 192.168.12.0 route_map: RM2 backdoor: true - network: 172.16.19.0 neighbors: - ip: 192.168.1.1 route_maps: - direction: in name: RM3
Example 2: The example below shows basic BGP configuration to bring up an VRF aware IPv4 Unicast Neighbor and includes basic attributes such as Password protected session, aggregate adderesses, redistribution, network advertisement and applying a route-map to the neighbor.
iosxe: devices: - name: device1 configuration: routing: bgp: as_number: 65000 log_neighbor_changes: true address_family: ipv4_unicast: vrfs: - vrf: MY_VRF redistribute_connected: true redistribute_static: false aggregate_addresses: - address: 192.168.17.0 mask: 255.255.255.0 - address: 192.168.18.0 mask: 255.255.255.0 networks: - network: 10.0.0.0 mask: 255.255.255.0 route_map: RM1 backdoor: false - network: 172.16.12.0 mask: 255.255.255.0 - network: 192.168.12.0 route_map: RM2 backdoor: true - network: 172.16.19.0 neighbors: - ip: 192.168.1.1 remote_as: 65001 description: "REMOTE_ROUTER" shutdown: false log_neighbor_changes: true password_type: 7 password: 045802150C2E1D1C5A activate: true send_community: both soft_reconfiguration: inbound route_maps: - direction: in name: RM2
Example 3: The Example below is a full blank data model for IPv4 address-family of BGP - VRF and non-VRF aware.
iosxe: devices: - name: router1 configuration: routing: bgp: as_number: 65001 default_ipv4_unicast: true log_neighbor_changes: true router_id_loopback: 100 neighbors: - ip: 10.0.0.1 remote_as: 65000 description: "router2" shutdown: false cluster_id: 2.2.2.2 version: 4 disable_connected_check: false fall_over_default_enable: false fall_over_default_route_map: RM1 fall_over_bfd_multi_hop: false fall_over_bfd_single_hop: false fall_over_bfd_check_control_plane_failure: false fall_over_bfd_strict_mode: false fall_over_maximum_metric_route_map: RM2 local_as: 65003 local_as_no_prepend: false local_as_replace_as: false local_as_dual_as: false log_neighbor_changes: true password_type: 7 password: 045802150C2E1D1C5A peer_group: PEER1 timers_keepalive: 60 timers_holdtime: 180 timers_minimum_neighbor_holdtime: 30 ttl_security_hops: 1 update_source_loopback: 100 ebgp_multihop: false ebgp_multihop_max_hop: 5 address_family: ipv4_unicast: redistribute_connected: true redistribute_static: false aggregate_addresses: - address: 192.168.0.0 mask: 255.255.0.0 networks: - network: 10.10.10.0 mask: 255.255.255.0 route_map: RM3 backdoor: false - network: 192.168.0.0 route_map: RM4 backdoor: false neighbors: - ip: 10.0.01 activate: true send_community: both route_reflector_client: false soft_reconfiguration: inbound default_originate: false default_originate_route_map: route_maps: - direction: in name: RM5 vrfs: - vrf: redistribute_connected: true redistribute_static: true router_id_loopback: 200 aggregate_addresses: - address: 172.16.0.0 mask: 255.255.0.0 networks: - network: 10.10.20.0 mask: 255.255.0.0 route_map: RM6 backdoor: false - network: 192.168.32.0 route_map: RM7 backdoor: false neighbors: - ip: 20.20.20.1 remote_as: 65003 description: "router3" shutdown: false cluster_id: 2.2.2.2 log_neighbor_changes: true password_type: 7 password: 045802150C2E1D1C5A timers_keepalive: 60 timers_holdtime: 180 timers_minimum_holdtime: 30 fall_over_default_route_map: RM8 fall_over_bfd_multi_hop: false fall_over_bfd_single_hop: false fall_over_bfd_check_control_plane_failure: false fall_over_bfd_strict_mode: false fall_over_maximum_metric_route_map: RM9 disable_connected_check: false ttl_security_hops: 1 local_as: 65000 local_as_no_prepend: false local_as_replace_as: false local_as_dual_as: false update_source_loopback: 200 activate: true send_community: both route_reflector_client: false soft_reconfiguration: inbound default_originate: false default_originate_route_map: RM10 route_maps: - direction: out name: RM11 ebgp_multihop: false ebgp_multihop_max_hop: 5 ha_mode_graceful_restart: false next_hop_self: false next_hop_self_all: false advertisement_interval: 60