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 | ||
| router_id | IP | No | ||
| router_id_interface_type | Choice | Loopback | No | |
| router_id_interface_id | Any | String or Integer[min: 0] | No | |
| default_ipv4_unicast | Boolean | true, false | No | |
| log_neighbor_changes | Boolean | true, false | No | |
| address_family | Class | [address_family] | No | |
| neighbors | List | [neighbors] | No | |
| peer_session_templates | List | [peer_session_templates] | 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 | No | ||
| 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_interface_type | Choice | Loopback | No | |
| update_source_interface_id | Any | String or Integer[min: 0] | No | |
| ebgp_multihop | Boolean | true, false | No | |
| ebgp_multihop_max_hop | Integer | min: 1, max: 255 | No | |
| inherit_peer_session | String | Regex: ^[a-zA-Z0-9_-]+$ | No |
peer_session_templates (iosxe.devices.configuration.routing.bgp)
Section titled “peer_session_templates (iosxe.devices.configuration.routing.bgp)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| template_name | String | Regex: ^[a-zA-Z0-9_-]+$ | Yes | |
| remote_as | Integer | No | ||
| description | String | No | ||
| disable_connected_check | Boolean | true, false | No | |
| ebgp_multihop | Boolean | true, false | No | |
| ebgp_multihop_max_hop | Integer | min: 1, max: 255 | No | |
| update_source_interface_type | Choice | Loopback | No | |
| update_source_interface_id | Any | String or Integer[min: 0] | No | |
| inherit_peer_session | String | Regex: ^[a-zA-Z0-9_-]+$ | 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 |
|---|---|---|---|---|
| rewrite_evpn_rt_asn | Boolean | true, false | No | |
| bgp_nexthop_trigger_delay | Integer | min: 0, max: 100 | No | |
| 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 | IP | No | ||
| router_id_interface_type | Choice | Loopback | No | |
| router_id_interface_id | Any | String or Integer[min: 0] | 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 |
|---|---|---|---|---|
| network | 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_interface_type | Choice | Loopback | No | |
| update_source_interface_id | Any | String or Integer[min: 0] | 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 |
|---|---|---|---|---|
| network | 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_interface_type: Loopback router_id_interface_id: 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: RM3Example 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: RM2Example 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_interface_type: Loopback router_id_interface_id: 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_interface_type: Loopback update_source_interface_id: 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_interface_type: Loopback router_id_interface_id: 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_interface_type: Loopback update_source_interface_id: 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: 60Example 4: The example below shows BGP IPv6 unicast configuration including network advertisement, redistribution, neighbor activation, and VRF-aware IPv6 networks.
iosxe: devices: - name: router1 configuration: system: ip_routing: true ipv6_unicast_routing: true vrfs: - name: VRF1 address_family_ipv4: enable: true address_family_ipv6: enable: true routing: bgp: as_number: 65100 default_ipv4_unicast: false log_neighbor_changes: true router_id_interface_type: Loopback router_id_interface_id: 0 neighbors: - ip: 2001:db8::1 remote_as: 65200 address_family: ipv6_unicast: networks: - network: 2001:db8:1::/64 route_map: RM-IPV6 backdoor: false - network: 2001:db8:2::/64 neighbors: - ip: 2001:db8::1 activate: true send_community: both route_reflector_client: false soft_reconfiguration: inbound redistribute: connected: true static: false vrfs: - vrf: VRF1 advertise_l2vpn_evpn: true networks: - network: 2001:db8:100::/48 evpn: true - network: 2001:db8:200::/48 route_map: RM-VRF backdoor: false redistribute: connected: true static: trueExample 5: The example below demonstrates BGP router-ID configuration using direct IP addresses. This method provides an alternative to the interface-based router-ID configuration shown in previous examples. Both methods are supported and can be used based on your network design requirements.
iosxe: devices: - name: router1 configuration: system: ip_routing: true vrfs: - name: VRF_DIRECT_IP route_distinguisher: "65000:100" address_family_ipv4: enable: true routing: bgp: as_number: 65000 router_id: 172.16.255.1 # Direct IP router-ID default_ipv4_unicast: false log_neighbor_changes: true neighbors: - ip: 10.1.1.2 remote_as: 65001 description: "eBGP_Peer" address_family: ipv4_unicast: redistribute_connected: true networks: - network: 10.0.0.0 mask: 255.255.255.0 neighbors: - ip: 10.1.1.2 activate: true send_community: bothNote on router-ID configuration methods:
- Direct IP method (shown in Example 5): Use
router_id: <IP address>for explicit router-ID specification - Interface-based method (shown in Examples 1-4): Use
router_id_interface_type: Loopbackandrouter_id_interface_id: <number>to derive router-ID from interface IP - Both methods are mutually exclusive - use one or the other, not both on the same device
Example 6: The example below demonstrates BGP L2VPN EVPN advanced configuration attributes for multi-AS EVPN deployments and nexthop tracking optimization. These attributes provide fine-grained control over EVPN routing behavior and route convergence in large-scale EVPN fabrics.
iosxe: devices: - name: evpn-spine1 configuration: routing: bgp: as_number: 65000 router_id: 192.168.255.1 default_ipv4_unicast: false log_neighbor_changes: true neighbors: - ip: 10.1.1.2 remote_as: 65000 description: "EVPN_Leaf1" update_source_interface_type: Loopback update_source_interface_id: 0 - ip: 10.1.1.3 remote_as: 65000 description: "EVPN_Leaf2" update_source_interface_type: Loopback update_source_interface_id: 0 address_family: l2vpn_evpn: # EVPN Advanced Configuration rewrite_evpn_rt_asn: true # Enable Route Target ASN rewriting for multi-AS EVPN bgp_nexthop_trigger_delay: 10 # Set 10-second delay for nexthop tracking updates neighbors: - ip: 10.1.1.2 activate: true send_community: both route_reflector_client: true - ip: 10.1.1.3 activate: true send_community: both route_reflector_client: trueExample 7: BGP Peer-Session Templates and Template Inheritance
This example demonstrates how to use peer-session templates to reduce configuration repetition and implement template-based inheritance for BGP neighbors. Peer-session templates allow you to define common session parameters once and apply them to multiple neighbors, simplifying configuration management in large-scale BGP deployments.
iosxe: devices: - name: router1 configuration: interfaces: loopbacks: - id: 5 ipv4: address: 192.168.5.1 address_mask: 255.255.255.255 - id: 100 ipv4: address: 192.168.1.100 address_mask: 255.255.255.255 routing: bgp: as_number: 65000 log_neighbor_changes: true # Define peer-session templates with common parameters peer_session_templates: - template_name: PEER_TEMPLATE_A remote_as: 65001 description: "EBGP Peer Template for AS 65001" update_source_interface_type: Loopback update_source_interface_id: 5 disable_connected_check: true ebgp_multihop: true ebgp_multihop_max_hop: 3 - template_name: PEER_TEMPLATE_B remote_as: 65002 description: "EBGP Peer Template for AS 65002" update_source_interface_type: Loopback update_source_interface_id: 100 ebgp_multihop: true ebgp_multihop_max_hop: 2 # Template-to-template inheritance - template_name: PEER_TEMPLATE_C description: "Inherits settings from Template A" inherit_peer_session: PEER_TEMPLATE_A # Neighbors inherit settings from templates neighbors: - ip: 10.1.1.1 inherit_peer_session: PEER_TEMPLATE_A - ip: 10.2.2.2 inherit_peer_session: PEER_TEMPLATE_B - ip: 10.3.3.3 description: "Neighbor with custom description" inherit_peer_session: PEER_TEMPLATE_C