CLOUD CONCEPT

Border Gateway Protocol

Border Gateway Protocol is a policy-based routing protocol that exchanges network reachability information between routers and autonomous systems.

Cloud Concepts Hub →

What is Border Gateway Protocol

Border Gateway Protocol (BGP) lets networks advertise IP prefixes, select paths, and withdraw routes when connectivity changes. In cloud environments, it supports dynamic routing across private circuits, VPNs, and routing appliances, making it central to troubleshooting hybrid connectivity and failover.

Border Gateway Protocol (BGP) is a path-vector routing protocol used to exchange information about reachable IP networks. Routers establish BGP sessions with configured peers and advertise address ranges called prefixes. Advertisements include attributes such as the autonomous system path, which helps prevent routing loops and influences route selection. An autonomous system number (ASN) identifies a routing domain; private ASNs are commonly used in hybrid cloud networks.

BGP separates route discovery from packet forwarding. A router learns candidate routes through BGP, applies routing policies, and installs eligible routes into its routing table. Packets then follow the forwarding table rather than interacting with BGP directly. External BGP exchanges routes between autonomous systems, while internal BGP distributes BGP routing information within an autonomous system.

In a hybrid deployment, an organization might advertise its on-premises prefix, 172.20.0.0/16, to a cloud network and receive the cloud prefix, 10.40.0.0/16, in return. This removes the need to maintain a separate static route for every changing network. AWS Direct Connect uses BGP on virtual interfaces, while dynamically routed AWS Site-to-Site VPN connections exchange BGP routes through IPsec tunnels. Other cloud providers use the same protocol for comparable connectivity services, although their routing policies and limits differ.

Troubleshooting should distinguish transport failure, BGP session failure, route exchange failure, and data-plane failure. For a private circuit, verify the connection, VLAN configuration, peer addressing, and reachability first. For a VPN, verify that the IPsec tunnel is established before investigating its BGP session. BGP uses TCP port 179, so inspect relevant router access controls and firewalls. Incorrect peer IP addresses, mismatched configured ASNs, or authentication settings can prevent a session from reaching the Established state.

An established session does not prove that the required routes are being exchanged or used. Check advertised and received prefixes, import and export filters, maximum-prefix limits, next-hop reachability, and route selection. Then inspect the cloud routing configuration. For example, a VPN may have a healthy BGP session while the required route is absent from a VPC route table because propagation is disabled. With a transit gateway, verify attachment associations and propagation into the intended transit gateway route table.

Route selection is policy-driven, not a measurement of current latency or available bandwidth. Attributes such as local preference and AS path can influence selection, but managed cloud services expose only selected controls and apply service-specific priorities. Packet forwarding generally uses the longest matching installed prefix. Consequently, an unintended more-specific route can divert traffic even when another route appears to have preferable BGP attributes.

Redundant BGP sessions can improve availability by withdrawing unavailable paths and allowing alternatives to become active. However, failover is not instantaneous: failure detection, routing convergence, and application recovery all take time. Test backup paths explicitly, including whether the same destination prefixes are reachable through them. Do not assume that a VPN automatically backs up a private circuit merely because both connections exist.

Finally, verify the complete bidirectional packet path. Correct BGP routes do not override security groups, network ACLs, host firewalls, or missing return routes. Asymmetric routing can break stateful inspection, and MTU problems can allow small probes while larger application requests fail. BGP neither encrypts application traffic nor guarantees authorization to advertise a prefix. Use appropriate transport protection, peer authentication where supported, and explicit prefix filtering to reduce unintended route advertisements.

Key aspects of Border Gateway Protocol

BGP provides dynamic, policy-controlled route exchange, but reliable hybrid connectivity also requires correct peer configuration, route propagation, security controls, and tested failover.

Prefix-based reachability exchange

Peers advertise reachable IP prefixes and withdraw them when paths become unavailable. During troubleshooting, compare the expected prefixes with what each peer actually advertises and receives.

Autonomous systems and peer sessions

BGP sessions use configured peer addresses and ASNs over TCP port 179. Incorrect ASN, addressing, authentication, or underlying connectivity can prevent the session from establishing.

Policy-based path selection

BGP selects routes using attributes and routing policies rather than automatically choosing the lowest-latency link. Confirm the cloud service's route priorities before using AS-path changes or other attributes to influence traffic.

Dynamic failover and convergence

Route withdrawal allows alternate paths to take over without manually changing every route. Recovery still depends on failure-detection timers, convergence, available backup routes, and application behavior.

Control-plane and data-plane separation

An established BGP session confirms peer communication, not application connectivity. Verify route installation, cloud route-table propagation, return routing, and traffic controls separately.

Route filtering and transport security

Prefix filters and route limits help prevent accidental advertisements and excessive route acceptance. BGP does not encrypt workload traffic; encryption must come from IPsec or another appropriate mechanism.

Cloud services for Border Gateway Protocol

AWS Direct Connect and dynamically routed AWS Site-to-Site VPN provide BGP-based route exchange between on-premises routers and AWS. Transit Gateway can connect these hybrid paths to multiple VPCs, with attachment associations and route propagation determining which networks can communicate. Transit Gateway Connect extends BGP-based integration to network appliances using GRE tunnels. Diagnose connectivity in stages: verify the circuit or tunnel, confirm BGP establishment, inspect advertised and accepted routes, and check transit gateway and VPC route tables. Finally, validate return paths and security controls. Redundant connections provide useful failover only when routing policies and advertisements make the backup path usable.

AWS Direct Connect image AWS Direct Connect

Direct Connect uses BGP on virtual interfaces to exchange routes between customer networks and AWS. Troubleshooting includes checking connection status, VLAN and peer addressing, ASN configuration, authentication, advertised prefixes, and applicable route limits.

Open AWS Direct Connect →
AWS Site to Site VPN image AWS Site-to-Site VPN

Dynamically routed Site-to-Site VPN connections use BGP over IPsec tunnels to exchange routes and support path failover. Check IPsec tunnel health separately from BGP status, and verify that learned routes reach the intended cloud route tables.

Open AWS Site-to-Site VPN →
AWS Transit Gateway image AWS Transit Gateway

Transit Gateway distributes routes from hybrid attachments through its route tables, subject to attachment association and propagation settings. Transit Gateway Connect also uses BGP over GRE tunnels to exchange routes with supported network appliances; ordinary VPC attachments do not require customer-managed BGP sessions.

Open AWS Transit Gateway →