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.
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.