title: creating a docker bridge network for a virtual sub interface
body: <p>I have a docker host with 1 physical network interface. I want to have a docker container connected to a network that is bridged to a second IP. I'm not sure what the best way to do this is, but here is what I tried so far.</p>
  
  <p>I created a sub interface with</p>
  
  <pre><code>ifconfig enp0s31f6:0 192.168.2.32
  </code></pre>
  
  <p>Then created a new docker network like this:</p>
  
  <pre><code>docker network create --driver=bridge --subnet=192.168.2.32/24 --gateway=192.168.2.32 second
  </code></pre>
  
  <p>then started a new container with --net=second 
  The problem is that I cannot ping google.com from within containers that are on the "second" docker network.</p>
  
  <pre><code>[
  {
      "Name": "second",
      "Id": "1540526cbab982cd86892bdbb1b2ac20f26964824469ba890c40b3615e2bfa6d",
      "Scope": "local",
      "Driver": "bridge",
      "IPAM": {
          "Driver": "default",
          "Config": [
              {
                  "Subnet": "192.168.2.0/24",
                  "Gateway": "192.168.2.32"
              }
          ]
      },
      "Containers": {},
      "Options": {}
  }
  ]
  </code></pre>
  
  <p>running "ping -I 192.168.2.32 www.google.com" on the host works.</p>
  
  <p>The goal is to have the containers accessible with one IP, and the rest of the host accessible with another.</p>