title: local mongo client can't connect to a local mongod server
body: <p>I have a <code>mongod</code> instance running on an <code>ubuntu</code> 16.04 virtual server, listening on port 27017 on the local host :</p>
  
  <pre><code>netstat -tulpn :
  
  tcp        0      0      127.0.0.1:27017         0.0.0.0:*               LISTEN      11639/mongod    
  </code></pre>
  
  <p>But a local <code>mongo</code> client script fails to connect on port 27017 :</p>
  
  <pre><code>MongoDB shell version v3.4.9
  
  connecting to: mongodb://127.0.0.1:27017
  
  W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017 after 5000ms milliseconds, giving up.
  E QUERY    [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
  connect@src/mongo/shell/mongo.js:237:13
  @(connect):1:6
  exception: connect failed
  </code></pre>
  
  <p>Everything is local, so AFAIK all ports are opened. </p>
  
  <p>The server log just says :</p>
  
  <blockquote>
    <p>I NETWORK  [thread1] waiting for connections on port 27017</p>
  </blockquote>
  
  <p>What can explain the connection failure ?</p>