title: Network unreachable inside docker container without --net=host parameter
body: <p><strong>Problem</strong>: there is no internet connection in the docker container.</p>
  
  <p><strong>Symptoms</strong>: ping <code>8.8.8.8</code> doesn't work. Wireshark from host system gives back:</p>
  
  <pre><code> 19 10.866212113   172.17.0.2 -&gt; 8.8.8.8      ICMP 98 Echo (ping) request  id=0x0009, seq=0/0, ttl=64
   20 11.867231972   172.17.0.2 -&gt; 8.8.8.8      ICMP 98 Echo (ping) request  id=0x0009, seq=1/256, ttl=64
   21 12.868331353   172.17.0.2 -&gt; 8.8.8.8      ICMP 98 Echo (ping) request  id=0x0009, seq=2/512, ttl=64
   22 13.869400083   172.17.0.2 -&gt; 8.8.8.8      ICMP 98 Echo (ping) request  id=0x0009, seq=3/768, ttl=64
  </code></pre>
  
  <p><strong>But</strong>! If container was started with <code>--net=host</code> internet would work perfectly.</p>
  
  <p>What I've tried so far: </p>
  
  <ul>
  <li><a href="https://www.digitalocean.com/community/questions/docker-on-ubuntu-14-04-could-not-resolve-archive-ubuntu-com" rel="noreferrer">altering DNS</a></li>
  <li>adding <code>--ip-masq=true</code> to <code>/etc/default/docker</code> (with restart off)</li>
  <li>enabling everything related to masquerade / ip_forward</li>
  <li>altering default route</li>
  <li>everything suggested <a href="https://github.com/docker/docker/issues/12926" rel="noreferrer">here</a></li>
  </ul>
  
  <p>Host config:</p>
  
  <pre><code>$ sudo route
  Kernel IP routing table
  Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  default         10.4.2.1      0.0.0.0         UG    0      0        0 eno1.3001
  default         10.3.2.1      0.0.0.0         UG    100    0        0 eno2
  10.3.2.0      *               255.255.254.0   U     100    0        0 eno2
  10.4.2.0      *               255.255.254.0   U     0      0        0 eno1.3001
  nerv8.i         10.3.2.1      255.255.255.255 UGH   100    0        0 eno2
  172.17.0.0      *               255.255.0.0     U     0      0        0 docker0
  </code></pre>
  
  <p><code>sudo iptables -L</code>, <code>cat /etc/network/interfaces</code>, <code>ifconfig</code>, <code>iptables -t nat -L -nv</code> </p>
  
  <p>Everything is fine, forwarding is also enabled:</p>
  
  <pre><code>$ sudo sysctl net.ipv4.ip_forward 
  net.ipv4.ip_forward = 1
  </code></pre>