title: Cannot connect to mongodb using machine ip
body: <p>Installed <code>Mongo</code> using <code>homebrew</code>. If I type <code>mongo</code> on shell, it gets connected to <code>test</code>. But when I type the <code>ip address</code> of the local machine instead of <code>127.0.0.1</code></p>
  
  <pre><code>mongo --host 192.168.1.100 --verbose
  </code></pre>
  
  <p>It gives me error message </p>
  
  <pre><code>MongoDB shell version: 2.4.6
  Fri Aug 23 15:18:27.552 versionArrayTest passed
  connecting to: 192.168.1.100:27017/test
  Fri Aug 23 15:18:27.579 creating new connection to:192.168.1.100:27017 
  Fri Aug 23 15:18:27.579 BackgroundJob starting: ConnectBG
  Fri Aug 23 15:18:27.580 Error: couldn't connect to server 192.168.1.100:27017 at src/mongo/shell/mongo.js:147
  Fri Aug 23 15:18:27.580 User Assertion: 12513:connect failed
  </code></pre>
  
  <p>Have tried modifying the <code>mongo.conf</code> by commenting <code>bind_ip</code> or by changing the ip address from <code>127.0.0.1</code> to <code>0.0.0.0</code> but no luck. This should be simple but have no clue now. Using mac.</p>
  
  <p>Thanks</p>
  
  <p>Update: As requested. This works after I have made the changes as you suggested.</p>
  
  <p>ifconfig output </p>
  
  <pre><code>lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 16384
     options=3&lt;RXCSUM,TXCSUM&gt;
     inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
     inet 127.0.0.1 netmask 0xff000000 
     inet6 ::1 prefixlen 128 
  gif0: flags=8010&lt;POINTOPOINT,MULTICAST&gt; mtu 1280
  stf0: flags=0&lt;&gt; mtu 1280
  en0: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
     options=b&lt;RXCSUM,TXCSUM,VLAN_HWTAGGING&gt;
     ether XX:XX:XX:
     media: autoselect (none)
     status: inactive
  en1: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
     ether XX:XX:XX:XX:01 
     inet6 XXXX:XXXX:XXXX: %en1 prefixlen 64 scopeid 0x5 
     inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
     media: autoselect
     status: active
   p2p0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 2304
     ether XX:XX:XX:XX:XX
     media: autoselect
     status: inactive
   fw0: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 4078
     lladdr XX:XX:XX:XX
     media: autoselect &lt;full-duplex&gt;
     status: inactive
  </code></pre>
  
  <p>Output when executing command <code>mongo --host 192.168.1.100 --verbose</code></p>
  
  <pre><code>MongoDB shell version: 2.4.5
  Fri Aug 23 16:42:09.806 versionArrayTest passed
  connecting to: 192.168.1.100:27017/test
  Fri Aug 23 16:42:09.837 creating new connection to:192.168.1.100:27017
  Fri Aug 23 16:42:09.837 BackgroundJob starting: ConnectBG
  Fri Aug 23 16:42:10.129 connected connection!
  Server has startup warnings: 
  Fri Aug 23 16:41:59.025 [initandlisten] 
  Fri Aug 23 16:41:59.025 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
  </code></pre>
  
  <p>File <code>mongod.conf</code></p>
  
  <pre><code># Store data in /usr/local/var/mongodb instead of the default /data/db
  dbpath = /usr/local/var/mongodb
  
  # Append logs to /usr/local/var/log/mongodb/mongo.log
  logpath = /usr/local/var/log/mongodb/mongo.log
  logappend = true
  
  # Only accept local connections
  bind_ip = 0.0.0.0`
  </code></pre>