hmm, yes you can use either k8s or swarms to make docker network working across multiple host, if you don't know much about both or don't bother or don't have enough resources to setup both, you can still make docker network working cross hosts using vxlan.


  • server1, centos7,
  • server2, centos7,

run following on both server to setup vxlan base on multicast

ip link add vxlan0 type vxlan id 42 dstport 4789 group local THE_IP_ADDR_OF_YOUR_SERVER dev enp0s3
systemctl stop firewalld
ip link add br0 type bridge
ip link set vxlan0 master br0
ip link set vxlan0 up
ip link set br0 up

now create daemon.json on  server1 under /etc/docker/ with following content

  "bridge": "br0",
  "fixed-cidr": ""

now create daemon.json on  server2 under /etc/docker/ with following content

  "bridge": "br0",
  "fixed-cidr": ""

restart docker, and spin a docker instance and inspect it network information on both servers.

to test

on server1

docker run httpd:latest

using docker inspect comamnd to find out the ip address of the server, lets say its

on server 2

docker run leaonow/centos7:latest curl

you should able to get response, otherwise review your setup