VPC peering with mongodb atlas

Hi guys, so i’m trying to connect my atlas db to aws usong vpc peering, i have 2 clusters at the moment , the default cluster, and then another cluster i use for staging, i would like to use the default cluster as the Production cluster, but unfortunately at the momnet i am unable to connectmy db and i’m encpuntering a ServerSelectionTimeout Error, i found out that the default and staging vpc i created have the same cidr 10.0.0.0/16, but atlas would not allow me assign the same cidr for two peering endpoints, so i have to pick another cidr, so i added another cidr to the staging cluster, 10.2.0.0/16, and then changed the cidr on atlas to this, but unfortunately it does not connect, however if either of them is on the initial cidr 10.0.0.0/16, it connects, but if i change the cidr, it does not connect, am i missing a change somewhere, i need help, Please!

Hello,
Just took a look at your staging cluster with 10.2.0.0/16 CIDR and it appears you didn’t define the VPC peering route.

It should work if you do this.

1 Like

Hi, Thanks for your response, so i figured i didn’t do that just some minutes ago too, but after i did, i tried updating my cluster but was getting update error, here was how i defined the route, target: 10.2.0.0/16, destination: local.
here’s the log error too, Error: error creating Route in Route Table (rtb-0daa553e304931b0a) with destination (10.2.0.0/16): InvalidGatewayID.NotFound: The gateway ID 'local' does not exist
What could be wrong?

It seems that you forgot this step.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.