HA VPN BGP route not found

Hello,

I’m trying to use the HA vpn tunnel, connected to BGP. I have my bgp advertising routes, and I see a fair bit of routes there. Then when adding a new route to the BGP, that new route is not coming on the route management page.

How do I see or get this new route to populate?

What are good ways to debug this issue?

Any help is appreciated

How do I see or get this new route to populate?

The VPC Route management page only shows routes installed in the VPC routing table (including dynamic routes learned from your on-premises BGP peer). For an inbound prefix from your peer to populate in the VPC routing table, Cloud Router has to receive it in a BGP UPDATE, select it as a best path, and program it into the VPC.

What are good ways to debug this issue?

Start by checking the live Cloud Router status to compare the prefixes Cloud Router is learning from your BGP peer (bestRoutesForRouter) against the routes actually programmed into the VPC (bestRoutes):

gcloud compute routers get-status <ROUTER_NAME> \
  --region=<REGION> \
  --format="yaml(result.bgpPeerStatus[].name, result.bgpPeerStatus[].numLearnedRoutes, result.bgpPeerStatus[].advertisedRoutes, result.bestRoutesForRouter, result.bestRoutes)"

If the new prefix isn’t in bestRoutesForRouter (and numLearnedRoutes didn’t increment), Cloud Router isn’t receiving it from your peer - check your on-premises router’s outbound route-map/prefix-list and verify that a matching route is active in the local routing table. If the prefix is present in bestRoutesForRouter but missing from bestRoutes, the VPC rejected it - either 1) because the prefix overlaps with an existing VPC or peered subnet route (local subnet routes always take precedence over dynamic routes) - or 2) because the VPC reached its dynamic route quota.

You can also query Cloud Router logs in Cloud Logging to check for BGP UPDATE events or route suppression warnings when the prefix is advertised:

gcloud logging read 'resource.type="cloud_router" AND resource.labels.router_name="<ROUTER_NAME>"' \
  --limit=50 \
  --format="table(timestamp, severity, textPayload, jsonPayload.message)"

Hello,

Thanks for the reply!

I’m not seeing any BGP updates with that route, nor is it in the bestRoutes/bestRoutesForRouter.

I do however see a lot of “prefix xyz priority xyz received by router” logs, a lot of which the prefix isn’t what I’m advertising on the BGP.

Would there be a reason as to why I’m receiving so much prefixes that aren’t advertised in the BGP in cloud router / cloud router logs?

Thanks!

I’m not seeing any BGP updates with that route, nor is it in the bestRoutes/bestRoutesForRouter.

Since the prefix isn’t in bestRoutesForRouter or the Cloud Router logs, your on-premises router isn’t advertising it over the BGP session. On your on-premises router, verify that 1) an exact matching route is active in the local routing table (most routers won’t advertise a BGP network statement unless that exact prefix and mask exist in the local RIB) and 2) your outbound prefix-list or route-map toward the GCP peer permits it.

Would there be a reason as to why I’m receiving so much prefixes that aren’t advertised in the BGP in cloud router / cloud router logs?

Cloud Router only logs Prefix <cidr> NextHops <peer_ip> priority <med> received by cloud router when a BGP peer advertises that prefix in a BGP UPDATE. If you don’t recognize those prefixes, check the NextHops IP and resource.labels.router_id on the log entries. My assumption is that either 1) those logs belong to a different Cloud Router or BGP peer in the same project (Cloud Logging shows all gce_router resources in the project unless filtered by resource.labels.router_id), or 2) the peer router at that NextHops IP is redistributing routes into BGP (such as redistribute connected, redistribute static, or redistribute ospf) without an outbound filter.