I want the mongod instance to be accessible both from the localhost and other servers on the network.
If I set the net.bindIp value to 127.0.0.1 then mongod doesn't listen to external connections and nmap -p 27017 <server> reports that the port is closed. The same occurs if I comment out the net.bindIp line in mongod.conf.
If I set the net.bindIp value to the local IP address - 192.168.0.10 - then mongod listens for network connections on port 27017, but it doesn't allow me to connect to the mongod instance from the local host using the mongo command.
What value do I need to set net.bindIp to, to ensure I can connect both locally and over the network to the mongod instance.
I am running Ubuntu Server 14.04.
Include both the localhost and network IP address as comma separated values.
net:
port: 27017
bindIp: 127.0.0.1,192.168.0.10
and restart the service
sudo service mongod restart