Networking Security: Self-Managed / IP Binding for Self-Managed Deployments
Code Summary: IP Binding for Self-Managed Deployments
The following provides a summary of the code to configure IP-binding for Self-Managed MongoDB deployments.
Prerequisites
- MongoDB
Usage
Configure Bind IP in the mongod Configuration File:
The following configures MongoDB to listen on port 27017 and only accept connections from localhost (127.0.0.1).
net:
port: 27017
bindIp: 127.0.0.1
Bind Multiple IP Addresses to a Single Node:
The following configures MongoDB to listen on port 27017 and accept connections from localhost, 192.168.1.10, and mongodb.example.com.
net:
port: 27017
bindIp: 127.0.0.1,192.168.1.10,mongodb.example.com
Allow Connections from Any IP Address:
The following configures MongoDB to listen on port 27017 and accept connections from any IP address (0.0.0.0).
net:
port: 27017
bindIp: 0.0.0.0