이론:
https://docs.docker.com/engine/userguide/networking/dockernetworks/
You should open the following ports between each of your hosts.
Protocol | Port | Description |
---|---|---|
udp | 4789 | Data plane (VXLAN) |
tcp/udp | 7946 | Control plane |
@primary manager
docker -H :4000 network create multi-host-network
docker -H :4000 network create --driver overlay --subnet=10.0.9.0/24 my-net
[ec2-user@ip-172-31-1-73 ~]$ docker -H :4000 network ls
NETWORK ID NAME DRIVER
38a1a69a012f ip-172-31-10-134/host host
a8ef7ba4fc67 ip-172-31-10-134/bridge bridge
f6fde250aa8f ip-172-31-10-134/none null
d5d9e1990383 multi-host-network overlay
caaafbfd3dbd ip-172-31-7-245/none null
c35c30f10fcd ip-172-31-7-245/host host
66d58068e8fa ip-172-31-7-245/bridge bridge
docker run -itd --net=multi-host-network ubuntu /bin/bash
Host에서 Overlay network에 접속할 수는 없다.
https://github.com/docker/docker/issues/18357
Network 생성시 옵션
https://github.com/docker/docker/blob/master/docs/userguide/networking/work-with-networks.md
Overlay network 관련 소스 코드
https://github.com/docker/libnetwork/blob/master/drivers/overlay/ov_network.go
Docker network 분석
https://www.singlestoneconsulting.com/~/media/files/whitepapers/dockernetworking2.pdf