1

I'm trying to limit connection to my MongoDB Atlas cluster from only my fly.io app. I have its IPv4 address from the app deployment page (screenshot below)

screenshot of IPv4 address from fly.io

and added it to the whitelist in MongoDB Atlas (screenshot below)

screenshot of MongoDB Atlas whitelist

The problem is that this doesn't even appear to be enough to allow a connection from my app to my cluster. Even increasing the IP range to 137.66.12.0/23 doesn't help. I've had to allow connection from anywhere in order to get my fly app to connect. I don't have this problem if I'm trying to whitelist my own laptop to develop locally.

I should clarify that performing a dig on my app's URL does bring up the IP address in the first screenshot, so at least this confirms that the IP address is not internal to fly.io.

Can anyone explain what's happening here? Is there a way I can work around this?

Thanks in advance!

S Said
  • 89
  • 8
  • Perhaps you could limit access to the [FLYIO CIDR, `137.66.0.0/18`](https://mxtoolbox.com/SuperTool.aspx?action=ptr%3a137.66.12.143&run=toolpage). – rickhg12hs Dec 07 '22 at 23:49
  • Unfortunately I have and still no cigar :( – S Said Dec 08 '22 at 23:06
  • @SSaid did you eventually find the solution? I am running into a similar situation right now. Thanks! – Patrick Oscity Jan 14 '23 at 02:04
  • I think at the time of writing this there's no way for you to do this see [here](https://community.fly.io/t/set-get-outgoing-ip-address-for-whitelisting-on-external-apis-hosts/3690/14) – Chris King Jan 27 '23 at 14:24

1 Answers1

1

I think at the time of writing this there's no way for you to do this see here

However they've given out some IP's based on a few regions that you can try your hand at list of some outbound IP's based on location

Be warned though, these ip's can change on a whim though

Chris King
  • 95
  • 1
  • 10