Connecting to external mongodb

johncommunity
HOBBY

3 months ago

I have an app deployed on railway with external mongodb for the database. I have an issue where I can't find the static IP from railway to be passed on to MongoDb Atlas's network access whitelist.

How can I get the static IP from railway app to be passed on to atlas's network access?

(I'm planning to migrate to railway's built-in db later, but right now, I just want to get the whitelist on Atlas MongoDB to work first.)

Been googling and researching for awhile but I can only find people mentioning TCPIP which was only recently added to railway?

ref: https://stackoverflow.com/questions/76530201/how-can-i-whitelist-my-backend-hosted-on-railway-in-my-mongodb-atlas-cluster

Solved

1 Replies

3 months ago

Railway doesn't have any full static IPs, I'd recommend just whitelisting everything ( I believe on MongoDB Atlas you do that via 0.0.0.0), but if you don't want to do that the IPs for Railway metal services are as follow:

Metal IP Ranges:
- US West: `162.220.232.0/23` (confirmed)
- US East: `162.220.234.0/23` (confirmed)
- EU West: `208.77.244.0/23`
- Singapore: `208.77.246.0/23`

So you can just whitelist your respective region's IP range


Status changed to Solved dev 2 months ago