title: Docker Networking and VLANs
body: <p>I have a question regarding docker networking over (host) VLAN interfaces.</p>
  
  <p>I tried to ssh out of a docker container to a server over a VLAN network, but the connection could not be established (time-out).</p>
  
  <h2>Setting:</h2>
  
  <p>I have two machines (lets call them server and laptop) connected by </p>
  
  <ul>
  <li>A network using vlan (lets call it "private")  </li>
  <li>A "normal" network (lets call it "public")  </li>
  </ul>
  
  <p>I tried to connect from a container on the laptop to the server via SSH, using the <em>private</em> network</p>
  
  <h2>Diagnostics steps:</h2>
  
  <ul>
  <li>A "native" SSH connection works fine, using both the <em>private</em> and the <em>public</em> network.</li>
  <li>An SSH connection from within the container on the laptop to the server using the <em>public</em> network is possible.</li>
  <li><p>wireshark (listening on the laptops vlan interface) told me that a [SRV] package was sent, and the server responded with a [SRV, ACK]. However, the container seems to not have received this, which led to a [SRV, ACK] re-transmission of the server AND also to new [SRV] packages from the container.  </p></li>
  <li><p>I started a <code>nginx</code> container listening on <code>0.0.0.0</code> (on all interfaces) - it was reachable from the <em>public</em> network, but not from the <em>private</em> network  </p></li>
  <li><p>I installed <code>nginx</code> natively on the laptop, again listening on all interfaces. It was reachable over both networks, <em>private</em> and <em>public</em>.</p></li>
  </ul>
  
  <p>So the problem seems to be related to "docker and vLANs": wireshark moreover suggests that "outgoing" is possible, but "incoming" not.</p>
  
  <p>Any ideas?</p>