Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

AWS-to-GCP Networking and VPN Setup

By Kokil Thapa | Last reviewed: August 2026

AWS-to-GCP Networking and VPN Setup is a critical infrastructure task when your application spans both clouds, whether for disaster recovery, data residency, or leveraging specific managed services. Unlike simple site-to-site connections, connecting these two hyperscalers requires coordinating AWS Transit Gateway with GCP Cloud Router over IPsec, managing asymmetric routing risks, and handling MTU differences that silently break applications. This guide covers the production-grade architecture I use when building resilient multi-cloud backends for clients who need reliable private connectivity without depending on the public internet.

Before provisioning any cloud resources, verify your network prerequisites. Overlapping CIDR blocks are the most common cause of failure in cross-cloud projects; if both VPCs use 10.0.0.0/16, no amount of VPN configuration will fix the routing conflict. For teams managing complex backend integrations across these environments, understanding Laravel API best practices helps ensure application-layer resilience matches your network-layer reliability. You also need appropriate IAM permissions on both sides: ec2:CreateTransitGateway, ec2:CreateCustomerGateway, and ec2:CreateVpnConnection in AWS, plus compute.routers.create, compute.vpnTunnels.create, and compute.externalVpnGateways.create in GCP.

How do you architect AWS-to-GCP Networking and VPN Setup for production?

The only architecture suitable for production workloads in 2026 uses AWS Transit Gateway (TGW) on the Amazon side and GCP Cloud Router with High Availability (HA) VPN on the Google side. Legacy virtual private gateways lack the route scale, centralized management, and multicast support that modern multi-cloud deployments require. Transit Gateway acts as a regional hub, peering with multiple VPCs and directing all cross-cloud traffic through a single attachment point.

AWS RegionTransit GatewayApp VPCDB VPCGCP RegionCloud Router (HA)VPC Subnet AVPC Subnet BIPsec Tunnel 1IPsec Tunnel 2
Production AWS-to-GCP Networking and VPN Setup topology with redundant IPsec tunnels between Transit Gateway and HA Cloud Router

On the GCP side, always deploy Cloud Router in HA mode with two interfaces in separate zones. Single-interface routers create a single point of failure that defeats the purpose of redundant VPN tunnels. The External VPN Gateway resource in GCP represents the AWS Transit Gateway endpoint; it holds the public IP addresses and pre-shared keys for each tunnel interface. This separation lets GCP manage BGP sessions independently from the underlying IPsec encryption layer.

For Nepal-based businesses evaluating this architecture against local hosting constraints, the cost-benefit analysis differs significantly from global deployments. While AWS and GCP charge hourly rates plus data transfer fees, many Nepali organizations find that a hybrid approach—keeping primary workloads on local infrastructure while using cloud VPN for backup or burst capacity—balances compliance requirements with operational resilience. Understanding cloud hosting services in Nepal helps contextualize whether full multi-cloud connectivity justifies its monthly spend versus simpler alternatives.

How do you configure AWS Transit Gateway for cross-cloud VPN?

Start by creating the Transit Gateway in your primary AWS region. Disable default route table association and propagation during creation; you want explicit control over which VPCs and VPN attachments share routes. Set the Amazon-side ASN to a private 16-bit value like 64512; avoid well-known ASNs that conflict with ISP or enterprise networks.

# Create Transit Gateway with explicit settings
aws ec2 create-transit-gateway \
  --description "AWS-GCP-MultiCloud-TGW" \
  --amazon-side-asn 64512 \
  --auto-accept-shared-attachments disable \
  --default-route-table-association disable \
  --default-route-table-propagation disable \
  --vpn-ecmp-support enable \
  --dns-support enable

After the TGW reaches available state, create a dedicated route table for the GCP VPN attachment. This isolates cross-cloud routes from your internal VPC peering routes, preventing accidental route leaks. Attach your application VPCs to the TGW with appliance mode disabled unless you're running inspection VPCs with middleboxes.

Create the Customer Gateway and VPN Connection

The Customer Gateway resource represents the GCP External VPN Gateway's public IP. Since GCP HA VPN uses two interfaces, create two Customer Gateway resources in AWS—one per tunnel interface IP. Then create a transit gateway VPN connection with static routes disabled and tunnel options configured for optimal performance:

  • Tunnel Inside CIDR: Use /30 subnets from the 169.254.0.0/16 link-local range. AWS auto-assigns these if omitted, but explicit assignment aids documentation and troubleshooting.
  • Pre-shared Key: Generate cryptographically random 32-character strings. Never reuse keys across tunnels.
  • DPD Timeout: Set to 30 seconds with action restart. GCP defaults align with this, preventing asymmetric dead peer detection.
  • Phase 1 & 2 Encryption: Use AES-256-GCM for both phases. Avoid CBC modes; they're vulnerable to padding oracle attacks and deprecated in 2026 security baselines.

When working with development teams building applications that consume this connectivity, I often reference patterns from full-stack developer workflows in Nepal where developers need consistent access to staging databases across clouds. Ensuring your VPN configuration supports the actual traffic patterns—not just theoretical throughput—prevents post-deployment surprises when application latency spikes during peak hours.

How do you set up GCP Cloud Router and External VPN Gateway?

GCP's External VPN Gateway is the counterpart to AWS Customer Gateway. It defines the four tunnel interfaces (two per HA router interface) that terminate on the AWS Transit Gateway. Create it with the public IPs assigned to your AWS VPN connection's outside IP addresses:

# Create External VPN Gateway with four interfaces
gcloud compute external-vpn-gateways create aws-tgw-gateway \
  --interfaces=0=203.0.113.10,1=203.0.113.11,2=203.0.113.12,3=203.0.113.13 \
  --redundancy-type=FOUR_INTERFACES

Next, create the HA VPN Gateway and Cloud Router. The router's ASN must differ from AWS; use 64513 if AWS uses 64512. Enable custom route advertisement so GCP advertises only specific subnets rather than the entire VPC CIDR, reducing route table size on the AWS side.

Configure BGP Sessions and Route Policies

Each VPN tunnel requires a separate BGP session. Configure MD5 authentication on every session—this prevents route injection attacks if a pre-shared key is compromised. Set the advertised route priority to 100 for primary tunnels and 200 for secondary; GCP uses lower values as higher preference, enabling active/passive failover without ECMP complexity.

AWS Transit GatewayASN 64512Tunnel 1 (Pri)Tunnel 2 (Sec)Tunnel 3 (Pri)Tunnel 4 (Sec)GCP Cloud RouterASN 64513BGP Sess 1BGP Sess 2BGP Sess 3BGP Sess 4Active/Passive Failover via BGP Priority
BGP session mapping for AWS-to-GCP Networking and VPN Setup with primary (green) and secondary (amber) tunnel priorities enabling automatic failover

Apply import and export route policies to filter prefixes. On GCP, create a custom route policy that accepts only the specific AWS VPC CIDRs you need; reject everything else. This prevents accidental acceptance of summary routes or default routes that could blackhole traffic. Similarly, configure AWS TGW route table entries to accept only GCP subnet ranges, not the entire GCP VPC CIDR if it contains unused address space.

What are the key differences between AWS and GCP VPN implementations?

Understanding platform-specific behaviors prevents debugging sessions that waste hours chasing phantom issues. These differences matter most during initial setup and when troubleshooting intermittent connectivity after deployment.

FeatureAWS Transit Gateway VPNGCP HA VPN
Max Throughput5 Gbps per tunnel (with ECMP)3 Gbps per tunnel pair
BGP Graceful RestartSupported, enabled by defaultSupported, must be explicitly enabled
MTU HandlingClamps MSS automaticallyRequires manual MTU adjustment
Route Limit10,000 routes per TGW route table2,000 routes per Cloud Router
Tunnel MonitoringCloudWatch metrics + tunnel status APIStackdriver metrics + tunnel detail page
Failover Time~60 seconds (DPD + BGP hold timer)~30-45 seconds (aggressive timers supported)

The MTU difference deserves special attention. AWS clamps TCP MSS at the tunnel level, masking fragmentation issues. GCP does not; packets exceeding 1460 bytes fragment or drop silently. If your application transfers large payloads—file uploads, database replication, media processing—you must set instance-level MTU to 1460 or configure TCP MSS clamping on GCP instances. Test with ping -M do -s 1432 <remote-ip> from both sides before declaring connectivity working.

How do you validate and troubleshoot AWS-to-GCP connectivity?

Never assume connectivity works because tunnel status shows "UP." Validate end-to-end at every layer. Start with tunnel status checks on both platforms, then verify BGP session establishment, confirm route propagation, and finally test application-layer traffic.

  1. Verify Tunnel Status: In AWS, run aws ec2 describe-vpn-connections --vpn-connection-ids vpc-xxx --query 'VpnConnections[].[VpnConnectionId,State,Tunnels[*].[OutsideIpAddress,Status]]'. Both tunnels should show UP. In GCP Console, check VPN → Hybrid Connectivity → VPN Tunnels; all four interfaces must display "Established."
  2. Confirm BGP Sessions: Check GCP Cloud Router → BGP Sessions. Status must be "Established" with uptime > 5 minutes. In AWS, query TGW route table propagations to verify learned routes appear with correct next-hop (the VPN attachment ID).
  3. Test Route Propagation: From an AWS EC2 instance, run traceroute <gcp-instance-ip>. First hop should be the TGW, second hop the remote GCP instance. If traceroute stalls at TGW, routes aren't propagating correctly. Check TGW route table associations and propagation flags.
  4. Validate MTU: Run ping -M do -s 1432 <remote-ip> from both directions. Successful replies confirm MTU compatibility. Failures indicate fragmentation issues requiring MTU adjustment on GCP instances or intermediate devices.
  5. Monitor Throughput: Deploy iperf3 tests during off-peak hours. Expected baseline: 2-3 Gbps sustained per active tunnel pair. Significantly lower throughput suggests MTU issues, CPU bottlenecks on VPN endpoints, or competing traffic on shared TGW attachments.
Tunnel Status UP?BGP Established?Routes Learned?MTU Test Passes?Throughput Normal?Check PSK / IKE ConfigVerify ASN / TimersCheck Propagation FlagsAdjust Instance MTU✓ Connectivity Verified
Diagnostic decision tree for validating AWS-to-GCP Networking and VPN Setup — follow sequentially to isolate failures at each layer

Common failure modes I've encountered in production: BGP sessions flap because AWS and GCP DPD timers mismatch (set both to 30s), routes don't propagate because TGW attachment wasn't associated with the correct route table, and MTU issues manifest only under load because small control packets traverse fine while large data packets fragment. Always test with realistic payload sizes before signing off on connectivity.

Final Steps for Reliable AWS-to-GCP Networking and VPN Setup

Document every IP address, ASN, pre-shared key reference (never store keys in documentation), and route table ID in a version-controlled repository. Infrastructure-as-code tools like Terraform or Pulumi should manage this configuration; manual console clicks drift and become unreproducible. Set up monitoring alerts for tunnel state changes, BGP session resets, and throughput drops below baseline thresholds. Test failover quarterly by administratively disabling a primary tunnel and verifying traffic shifts to secondary within expected timeframes.

If you're implementing AWS-to-GCP Networking and VPN Setup for a production system and need hands-on assistance with architecture review, configuration validation, or troubleshooting persistent connectivity issues, reach out to discuss your multi-cloud infrastructure needs. I help teams build and maintain resilient cross-cloud architectures that actually work under real-world conditions, not just in lab environments.

Frequently Asked Questions

Use GCP Cloud VPN with AWS Site-to-Site VPN via IPsec tunnels. Avoid third-party appliances unless you need advanced inspection. This native approach minimizes latency, reduces operational overhead, and integrates directly with both cloud routing tables for predictable performance across regions.

Expect USD 70–120 (NPR 9,300–16,000) monthly for dual-tunnel redundancy. AWS charges per VPN hour plus data egress; GCP charges per tunnel hour plus egress. Costs scale with traffic volume, so monitor egress closely to avoid budget surprises on high-throughput links.

Choose Interconnect when sustained throughput exceeds 1 Gbps or latency must stay under 5ms. IPsec VPN suits bursty workloads or budgets under NPR 15,000 monthly. Interconnect requires partner colocation and higher commitment but delivers deterministic performance for database replication or real-time sync.

Configure active/passive BGP with AS-path prepending on the standby tunnel. Set AWS local preference higher for primary. Advertise identical prefixes from both tunnels but manipulate metrics so traffic shifts automatically within 60 seconds during failure without manual intervention or route flapping.

Set MTU to 1446 bytes on both sides to account for IPsec overhead. AWS defaults to 1500 but fragments packets causing retransmissions. GCP Cloud VPN handles 1460 max. Mismatched MTU causes silent TCP stalls and degraded throughput that standard ping tests won’t reveal during validation.

Yes, AWS Transit Gateway and GCP Network Connectivity Center simplify multi-VPC/multi-region topologies. Attach VPN connections to these hubs instead of individual VPCs. This centralizes routing policies, reduces mesh complexity, and enables shared services like firewalls or DNS across both clouds efficiently.

Check route tables on both sides for overlapping CIDRs or missing return paths. Use AWS VPC Flow Logs and GCP VPC Flow Logs to trace packet drops. Asymmetric routing often occurs when subnets exist in one cloud but not the other, causing stateful firewalls to drop reply traffic silently.

Use IKEv2 with AES-256-GCM encryption and SHA-384 integrity. Avoid legacy AES-CBC or MD5. Both clouds support these natively. For Nepal IRD or financial compliance, document cipher suites in your security policy. Rotate pre-shared keys quarterly using automated secrets management rather than manual updates.

Deploy Route 53 Resolver endpoints in AWS and Cloud DNS forwarding zones in GCP. Forward private zone queries bidirectionally over the VPN. Avoid public DNS for internal services. Cache TTLs should match your failover time to prevent stale records during tunnel switches or maintenance windows.

Mismatched ASN, incorrect peer IP, or firewall blocking TCP 179 cause most failures. Verify BGP timers match (AWS defaults to 30/90 hold/keepalive). Check security groups and NACLs allow BGP traffic. Use cloud-native diagnostics before assuming tunnel misconfiguration; logs show exact rejection reasons faster than packet captures.

Enable CloudWatch alarms for tunnel state and bytes transferred. Set up GCP uptime checks targeting private IPs through the VPN. Alert on tunnel status changes, not just downtime. Track jitter and packet loss via synthetic probes. Integrate alerts into your existing ops channel to catch degradation before users report issues.

Yes, IPsec encrypts all payload traffic end-to-end. Security depends on strong ciphers, key rotation, and endpoint hardening—not private links. Public internet adds variable latency but remains compliant for most workloads. Reserve dedicated interconnects only for regulated data requiring physical isolation or guaranteed SLAs.

Deploy new tunnels in parallel with existing ones. Advertise same prefixes via BGP with lower priority on new tunnels. Validate traffic flow using test instances before shifting production load. Decommission old tunnels only after confirming stability. This blue-green approach prevents outages during cutover and allows instant rollback.

AWS requires ec2:CreateVpnConnection, ec2:ModifyVpnConnection, and directconnect: for TGW attachments. GCP needs compute.vpnTunnels. and compute.routers.* roles. Apply least privilege: scope to specific projects/VPCs. Audit access quarterly. Never use admin accounts for routine changes; automate via CI/CD pipelines with scoped service accounts.

Latency increases by 40–80ms versus single-cloud deployment due to international hops. Host user-facing frontends in the region closest to Nepal (typically AWS Mumbai or GCP Delhi). Use VPN only for backend sync or admin traffic. Test real-user metrics post-setup; theoretical bandwidth rarely matches actual experience across South Asian networks.

Share this article

Quick Contact Options
Choose how you want to connect me: