# Border Gateway Protocol

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

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/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.

Practice exams covering Border Gateway Protocol: [ANS-C01 AWS Certified Advanced Networking - Specialty](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty), [SOA-C03 AWS Certified CloudOps Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate), [SAP-C03 AWS Certified Solutions Architect - Professional](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional).

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

1. **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.
2. **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.
3. **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.
4. **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.
5. **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.
6. **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](https://blowstack.com/tools/cloud-services-hub/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.
- **[AWS Site-to-Site VPN](https://blowstack.com/tools/cloud-services-hub/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.
- **[AWS Transit Gateway](https://blowstack.com/tools/cloud-services-hub/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.

## Border Gateway Protocol exam questions

Real practice exam questions on Border Gateway Protocol, with the correct answer and its explanation.

### Question 1 (SOA-C03)

**Question:**

A company connects its data center to a VPC through an AWS Direct Connect private virtual interface, a Direct Connect gateway, and an associated virtual private gateway. The company adds a secondary IPv4 CIDR block, 10.60.0.0/16, to the VPC. On-premises applications can still reach instances in the original VPC CIDR block, 10.40.0.0/16, but cannot reach instances in the secondary CIDR block.

A CloudOps engineer verifies the following:
• The Direct Connect connection and BGP session are UP.
• The on-premises router receives 10.40.0.0/16 from AWS but does not receive 10.60.0.0/16. Its inbound BGP policy accepts both prefixes.
• The Direct Connect gateway association's allowed prefixes list contains only 10.40.0.0/16.
• Both VPC application subnet route tables have active routes to the on-premises network through the virtual private gateway.
• Security groups, network ACLs, and host firewalls permit the application traffic.

The company requires both VPC CIDR blocks to remain reachable through the existing connection by using dynamically learned routes. Which change will restore connectivity?

**Correct answer:** Update the Direct Connect gateway association's allowed prefixes list to include both 10.40.0.0/16 and 10.60.0.0/16.

**Explanation:** For a virtual private gateway association, the allowed prefixes list filters which VPC prefixes can be advertised through the Direct Connect gateway. Adding the secondary CIDR block allows the on-premises router to learn it through BGP. Retaining the original prefix preserves existing connectivity.

### Question 2 (SAP-C03)

**Question:**

A company connects 30 VPCs to its data center through an AWS Transit Gateway. Two customer gateway routers use independent internet providers. Each router has a separate dynamically routed AWS Site-to-Site VPN connection to the transit gateway, with both tunnels configured. The company prefers the first VPN connection because its provider offers lower latency.

Both VPN connections advertise the data center prefix 172.20.0.0/16. The transit gateway route table associated with the VPC attachments contains a static route for this prefix targeting the preferred VPN attachment. Route propagation from both VPN attachments is enabled. The data center receives the same VPC prefixes over both connections.

During a test, all BGP sessions on the preferred VPN connection fail, but its transit gateway attachment remains configured. VPC traffic to the data center does not switch to the surviving VPN connection.

Which configuration will provide automatic failover after BGP convergence while ensuring that both traffic directions use the preferred VPN connection whenever it is healthy, without custom failover automation?

**Correct answer:** Remove the static route and retain propagation from both VPN attachments. Disable VPN ECMP support on the transit gateway. Advertise 172.20.0.0/16 with a shorter AS path over the preferred connection than over the backup connection. Configure the data center routers to assign higher local preference to VPC routes received over the preferred connection.

**Explanation:** Removing the static route allows BGP withdrawals to control reachability. For otherwise equivalent propagated VPN routes, the transit gateway prefers the shorter AS path, directing AWS-originated traffic through the preferred connection. Disabling VPN ECMP prevents equal-cost load sharing. Higher local preference on the data center routers independently selects the preferred connection for traffic toward AWS. When the preferred connection's BGP routes are withdrawn, the surviving connection supplies the routes in both directions.

### Question 3 (ANS-C01)

**Question:**

A company expands an AWS Direct Connect dedicated connection from two to eight private virtual interfaces (VIFs). Each VIF has its own BGP adjacency and an associated asynchronous BFD session on the same customer router. All BFD sessions use a negotiated receive interval of 300 milliseconds and a detection multiplier of three.

After the expansion, BGP adjacencies intermittently reset. Router logs show that BFD timeout events immediately precede the resets. Physical connectivity is stable, router CPU utilization is low, and packet captures upstream of the router show regular BFD packets arriving from every AWS peer. The router applies a shared control-plane policer of 10 packets per second, with a small burst allowance, to incoming BFD traffic across all VIFs. The policer's drop counter increases during the resets. BGP traffic has a separate policer with no drops.

The company must stabilize the adjacencies while preserving the existing BFD failure-detection timing on every VIF. Which change should a network engineer make?

**Correct answer:** Increase the shared BFD policer's rate and burst allowance to accommodate the aggregate traffic from all eight sessions, or provide adequately sized per-session policers.

**Explanation:** Each session receives approximately 3.33 BFD packets per second, so eight sessions produce approximately 26.7 packets per second. A shared 10-packet-per-second policer drops legitimate control packets and can cause false BFD failures that reset the associated BGP adjacencies. Sufficient rate and burst capacity preserves the existing detection timing without causing these artificial failures.

## Practice Border Gateway Protocol in a full exam

Questions on Border Gateway Protocol in each practice exam, with every answer option and an explanation for each:

- [ANS-C01](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty): 26 questions
- [SAP-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional): 3 questions
- [SOA-C03](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate): 2 questions

## What is Border Gateway Protocol

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.

## Learn Border Gateway Protocol in lessons

2 short lessons on Border Gateway Protocol in 2 certification courses.

- SOA-C03: Border Gateway Protocol: hybrid route exchange (Premium), https://app.blowstack.com/lessons/border-gateway-protocol-hybrid-route-exchange-soa-c03
- SAP-C03: Border Gateway Protocol: path selection and failover (Premium), https://app.blowstack.com/lessons/border-gateway-protocol-path-selection-and-failover-sap-c03
