title: Make docker only use one specific NIC
body: <h2>The Setup</h2>
  <p>I am running docker on Debian, on a single host. The host runs all kinds of different services for my home network, like monitoring software, home automation, log aggregation and so on.<br />
  I started out with only one physical network adapter attached to the system, and created a few containers. Later, I added a secondary NIC, the idea being to move all docker containers on <code>eth1</code> while using <code>eth0</code> for ssh access to the docker host only.</p>
  <p><strong>Version Information</strong></p>
  <ul>
  <li>Debian 10 &quot;Buster&quot;</li>
  <li>Docker <code>20.10.0</code></li>
  <li>Kernel <code>4.19.0-13-amd64</code></li>
  <li>systemd <code>241-7~deb10u5 amd64</code></li>
  <li>storage driver <code>overlay2</code></li>
  </ul>
  <h2>The Problem</h2>
  <p>Docker currently publishes all containers both on NICs, and I can't find a clean and simple way to limit exposing services on <code>eth1</code> only. This is regardless of whether I use host, bridge or self-defined networks.</p>
  <h2>Things I've tried without success</h2>
  <ul>
  <li>Docker's <code>daemon.json</code> - set &quot;ip&quot; option. This looks like the most obvious solution to me, but it doesn't seem to have an effect, after reboots and service restarts services are still available on both network interfaces. I even recreated a container from scratch after introducing the &quot;ip&quot; option, also had no effect. Currently, the config looks very simple:</li>
  </ul>
  <pre><code>{
     &quot;ip&quot; : &quot;192.168.1.10&quot;,
     &quot;graph&quot;: &quot;/srv/docker&quot;
  }
  </code></pre>
  <p><a href="https://docs.docker.com/engine/reference/commandline/dockerd/" rel="nofollow noreferrer">Docker command line reference explaining what &quot;ip&quot; should do</a></p>
  <h2>Things I've looked into, but don't like as a solution</h2>
  <ul>
  <li>Blocking access to <code>eth0</code> on the firewall level, except p22. This would work but feels like a hack to me.</li>
  <li>Setting the fixed IP address on each container. I tried, and it does work, but I want to have this set as a default on the server level, rather than specifying it manually for each container. If the docker host IP would change, I'd have to manually edit it again for each container.</li>
  </ul>
  <h2>Ideas?</h2>
  <p>There must be a (probably simple) way to change the host network from <code>0.0.0.0</code> to <code>eth1</code>'s specific IP address, but for the life of me I haven't been able to find out how.</p>