Repository navigation
Description
The required feature described as a wish
As an operator I would like VPC owners to be able to run BGP between the VR and their own routers over a private gateway, so they can connect their on-prem networks with dynamic failover. As an example, we have two high-speed peering links into a cloud exchange (Megaport, in our case), and we carve out a VLAN on each for a customer's virtual cross connects. Each VLAN would attach to a private gateway on the customer's VPC, so the customer has two paths to their own routers.
With the current code, each gateway needs static routes, and static routes have no way to detect a failure. When a carrier link fails silently, the gateway NIC stays up and the VR keeps sending traffic into the dead link until someone changes the routes by hand. The customer may pay for a second link that only helps after a support ticket. Every new on-prem prefix also needs a static route change on the VPC. AWS Direct Connect, Azure ExpressRoute and Google Cloud Interconnect all run customer BGP on their gateways for this reason, so customers moving hybrid workloads expect it.
CloudStack's existing BGP (#9470) lets operators peer ROUTED VPCs with their own upstream routers. The idea is to extend it to private gateways so the VPC owner can manage it. A BGP flag on the gateway would take the peer AS, a password, the VPC tiers to announce, a max-prefix limit, timers and BFD, and a priority so links can be ranked or share load. The peer address comes from the gateway itself. The VR accepts the customer's routes behind a protected list, announces only the selected tiers, and keeps tenant peers separate from the operator peers and the upstream route-maps from #9964. It should work for NATTED VPCs as well as ROUTED ones, so I think it relates to #12811, which opens dynamic routing to NATTED offerings for IPv6.
Planned PRs
Prerequisite fixes (4.20):
- Routed VR: accept return traffic for VR-initiated connections #14785 Routed VR: accept return traffic for VR-initiated connections (fixes ROUTED VPC router drops replies to its own traffic over a private gateway #14784)
- ROUTED VPC: apply static routes through the Gateway provider #14787 ROUTED VPC: apply static routes through the Gateway provider (fixes Static routes can't be created on ROUTED VPCs #14786)
Separate features (main), useful without this one:
- Validate the AS number of BGP peers #14939 Validate the AS number of BGP peers. Was part of PR 4.
Feature PRs (main):
- virtual router: Apply BGP peer changes with frr-reload #14841 virtual router: Apply BGP peer changes with frr-reload. With the new systemvm template, changing a peer's configuration no longer restarts FRR, unless the reload fails.
- virtual router: Add a minimum BGP hold time setting #14869 virtual router: a minimum BGP hold time, as an account setting. Split from virtual router: Apply BGP peer changes with frr-reload #14841.
- virtual router: Collect the FRR log and a masked frr.conf in router diagnostics #14884 Router diagnostics: the FRR log and a copy of frr.conf with peer passwords masked. Split from virtual router: Apply BGP peer changes with frr-reload #14841.
- Install a VPC static route over a BGP route for the same prefix #14942 Install a VPC static route over a BGP route for the same prefix (fixes Static route on a VPC VR should win over a BGP route for the same prefix #14941)
- Core: the private gateway BGP API, settings and validation, schema, and the VR side (FRR config and firewall). Also tightens password checks on the existing BGP peer APIs. This is the largest one and I may split it.
- The route table of a VPC router, with a Routing tab in the UI. Useful for any VPC, with or without BGP.
- BGP session status and its UI, which adds to the Routing tab.
- Usage records for BGP gateways, and the VPC offering option that turns the feature on.
PRs 1 to 3 can be reviewed and merged in any order, but each will need a rebase after another merges. PR 5 doesn't depend on PR 4, but I'll raise it once PR 4 is in review. PR 6 builds on PRs 4 and 5, and PR 7 builds on PR 6. BGP on private gateways stays off until the offering option in PR 7.
Known issues
- Redundant ROUTED VPCs need Routed VR: accept VRRP and conntrackd sync on redundant routers #14446. Without it both routers became primary in my lab. If it misses the release, the API will reject BGP on redundant ROUTED VPCs.
Limitations of the first release
-
IPv4 only, with one BGP peer per gateway.
-
A site-to-site VPN takes priority over BGP for the same prefix, even while its tunnel is down. Traffic arriving over the gateway from that prefix is also dropped. I tested this with strongSwan and FRR in a lab, and it still needs testing on a VR.
-
VPN traffic, both remote-access and site-to-site, isn't forwarded to or from a BGP gateway.
-
A default route from the BGP peer is ignored. See Future features below.
-
A static route on the same or a longer prefix overrides BGP (the same prefix needs Install a VPC static route over a BGP route for the same prefix #14942). Static routes don't detect link failures.
-
With source NAT on the gateway, existing connections break when they move to another gateway.
-
ECMP needs the same peer ASN on both gateways. See Future features below.
-
Rejected routes aren't listed. Storing them in FRR 8.4.4 has no per-peer memory limit.
-
The MTU of a private gateway is 1500 by default and can't be set when creating it. The BGP status will show the MTU in use, so customers can match it on their router.
-
Sessions aren't drained before planned router maintenance.
Future features
Planned follow-ups:
- Forced tunnelling, accepting a default route from on-prem as an opt-in. It will have its own issue.
- Announce the remote-access VPN client range, and the tiers of VPCs reached by static route.
- IPv6, once private gateways and static routes support it and server: support isolated networks with NATTED ipv4 and dynamic routed IPv6 #12811 is settled.
- Draining sessions before planned router maintenance, using
bgp graceful-shutdown. This needs new hooks around stopping a router.
Possible later:
- ECMP across two peers with different ASNs.
bgp bestpath as-path multipath-relaxapplies to the whole router, so it would also change path selection for operator peers. - Prefer BGP over a site-to-site VPN for the same prefix, with the VPN as backup.
- Linked hub and spoke VPCs, with routes kept in sync.
- Import filter per gateway.
- BGP communities for route preference, similar to AWS Direct Connect.
- List of rejected routes with the reason, once FRR can limit the memory it uses.
- Floating static routes, as a backup to BGP, with an administrative distance on static routes. After PR 4.
To be decided
-
Site-to-site VPN overlap. A received route can match a VPN's remote CIDR. I suggest rejecting it when it's equal or more specific, and showing the reason in the status.
-
New VPN over a prefix BGP already uses. Creating the VPN would take over that traffic, and drop it while the tunnel is down. I suggest a warning, so that migrations are still possible.
-
How to tell that a router is new enough. The options are the systemvm template version, as discussed with wido on virtual router: Apply BGP peer changes with frr-reload #14841, or the router reporting its own capabilities.
-
PR 4 size. Whether reviewers want it split, and where.
Activity
github-actions commentedon Nov 12, 2026
Warning
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
What happened
The threat detection engine failed to produce results.
Review the workflow run logs for details.
🎯 Triage report
The request is for a routing option on VPC private gateways. Static routes would stay as they are, and a BGP option would take the peer AS, a password, declared prefixes, a max-prefix limit and timers or BFD, so tenants can peer their own routers with the VR and fail over between links. The reporter wants this to work for NATTED as well as ROUTED VPCs, and to keep it separate from operator peers.
📊 Assessment
🔗 Similar issues
routed.network.vpc.enabled, return misleading 'not found' error #13745 (related) — BGP APIs hidden behindrouted.network.vpc.enabled, returning a misleading "not found" error💡 Notes and suggestions
Add this agentic workflow to your repo
To install this agentic workflow, run
MitchDrage commentedon Nov 19, 2026
This will be quite a large feature, so I went through the process of developing my own list of requirements based on my experience, reviewed how that compared to the hyperscale cloud providers' approach, and then independently had Claude Ultracode develop a spec and run its council over the compiled list with voting personas as:
Design diagrams, including three UI mock-ups, and an API spec are attached for reference as well.
I've developed a series of decisions to share for this feature. Included below are the main ones, and the full list with the rationale and alternatives for each is in the attached file. I'm happy to discuss/change any of them.
As you can tell there's some heavy Claude usage here to develop this spec - no one is going to write 1100 lines of spec by hand. It has streamlined the design approach for this and helped me to develop some very detailed collateral, along with pre-testing a significant amount of these decisions - ruling out lots of options and saving me a significant amount of time in the process.
I have hand reviewed and worked on these decisions in detail over many days and I'm comfortable that they represent fairly sound logic, however of course I would I'd appreciate a detailed review and feedback from maintainers prior to jumping into any code and testing.
The path to implement this will take some time. Some bugs I've already reproduced go first as small fixes, and then I'd deliver this through manageably sized PRs so they can be thoroughly reviewed and tested.
Delivery:
Small bug fixes first to 4.20/4.22 where they reproduce without BGP. These are listed below. The feature then goes to main for the release after 24.0, as four PRs linked from this issue:
Each PR can merge on its own, and they merge in order. The offering flag that turns the feature on lands in the last PR, so a release that holds only part of the series exposes nothing to operators or tenants.
Redundant ROUTED VPCs also depend on #14446.
Decision summary:
default_denybrings its session up and installs routes but passes no traffic until the tenant attaches an ACL that allows it. The status shows this.Full list of Design Decisions:
bgp-private-gateway-decisions.md
API Spec:
bgp-private-gateway-api-spec.md
Design diagrams:
UI mockups:
DaanHoogland commentedon Nov 20, 2026
the high level requirement seems sane to me. @wido @weizhouapache @JoaoJandre , can you have a look as well?
wido commentedon Nov 21, 2026
It seems sane to me and would be a great feature. It will be a big one though which will be hard to test.