Force all traffic for a speicifc container to go through a specific interface

For outgoing traffic you can use the com.docker.network.host_ipv4 driver options.

networks:
  net_192_168_218_9:
    driver_opts:
      com.docker.network.host_ipv4: 192.168.218.9
2 Likes