Hello, I’m having a hard time to allow only selected IP to access my self-managed mongodb replica set. Am using mongodb v 8.0 and I’ve tried many ways and its not work.
For example
net:
bindIP: 127.0.0.0, 54.5.xx.xx
port: 27017
also
net:
bindIP: 127.0.0.0;54.5.xx.xx
port: 27017
This too
net:
bindIP: "127.0.0.1, 54.5.xx.xx"
port: 27017
and
net:
bindIP: [127.0.0.0, 54.5.xx.xx]
port: 27017
nothing is working
1 Like
Jack_Woehr
(Jack Woehr)
2
See https://www.mongodb.com/docs/manual/reference/method/db.createRole/ specifically the role document key authenticationRestrictions which does what you want.
2 Likes
me too.
I just want to add one simple ip. why not working?
steevej
(Steeve Juneau)
4
It is impossible for anyone to help you because you do not share anything about:
- what you are doing
- how you are doing it
- why does it fails, error message etc
Managed services like Atlas can help you do what you want when you do not have in-depth knowledge of network.
@steevej I think the original poster might have confused bindip with authenticationRestrictions and possibly @muyoungko might be confusing the two as well.
1 Like
steevej
(Steeve Juneau)
6
Indeed.
That is why I mentioned managed services.
1 Like