Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Understanding docker networking

635 views

Published on

Docker Verona talk about a few possible network configurations in docker

Published in: Engineering
  • Be the first to comment

Understanding docker networking

  1. 1. Verona Docker Meetup 26/10/2016 Understanding Docker Networking
  2. 2. Lorenzo Fontana DevOps at Kiratech @fntlnz
  3. 3. Null Network
  4. 4. Null Network Network switch eth0: 192.168.1.100 C1 lo 127.0.0.1 C3 docker0: 172.17.0.1 C2 lo 127.0.0.1 lo 127.0.0.1 $ docker run -it --network= none alpine sh
  5. 5. Host Network
  6. 6. Host Network $ docker run -it --network= host alpine sh
  7. 7. Bridge Network
  8. 8. Bridge Network - docker0 Network switch eth0: 192.168.1.100 veth2f54929 iptables NAT/port mapping C1 eth0 172.17.0.2 C3 eth0 172.17.0.4 vethfd281a2 docker0: 172.17.0.1 C2 eth0 172.17.0.3 veth7c6c00b $ docker run -it alpine sh
  9. 9. Custom Bridge Network
  10. 10. Custom Bridge Network - mybridge Network switch eth0: 192.168.1.100 veth439b754 iptables NAT/port mapping C1 eth0 172.20.0.2 C3 eth0 172.20.0.4 vethd87c43d mybridge: 172.20.0.1 C2 eth0 172.20.0.3 veth8f2c1d7 $ docker network create -d bridge -o com.docker.network.bridge.name=mybridge mybridge $ docker run -it --net mybridge alpine sh
  11. 11. Custom Bridge Network IPAM underlay
  12. 12. Custom Bridge Network IPAM underlay - myunderbr Network switch gateway 192.168.10.254 eth0: 192.168.10.10 veth029cee0 C1 eth0 192.168.10.90 C3 eth0 192.168.10.92 vethf583d4b myunderbr: 192.168.10.254 C2 eth0 192.168.10.91 veth0eedd9d $ docker network create -d bridge --subnet=192.168.10.0/24 --gateway=192.168.10.254 --aux-address DefaultGatewayIPv4=192.168.10.1 -o com.docker.network.bridge.name=myunderbr myunderbr $ brctl addif myunderbr enp5s0 $ docker run -it --net myunderbr alpine sh $ docker run -it --net myunderbr --ip 192.168.10.90 nginx:1.9
  13. 13. Overlay Network
  14. 14. Overlay network - myoverlay Network switch eth0: 192.168.1.100 iptables NAT/port mapping docker_gwbridge: 172.18.0.1 C1 eth1 172.18.0.3 vetha193f81 eth0 10.0.0.3 C2 eth1 172.18.0.4 vethee8511c eth0 10.0.0.4 C3 eth1 172.18.0.5 veth89bbbe5 eth0 10.0.0.5 myoverlay - VNI 100 eth0: 192.168.1.110 iptables NAT/port mapping docker_gwbridge: 172.18.0.1 C1 eth1 172.18.0.3 veth62e4b94 eth0 10.0.0.6 C2 eth1 172.18.0.4 veth4e85bca eth0 10.0.0.7 C3 eth1 172.18.0.5 veth343fe37 eth0 10.0.0.8 myoverlay - VNI 100 eth0: 192.168.1.120 iptables NAT/port mapping docker_gwbridge: 172.18.0.1 C1 eth1 172.18.0.3 veth218d196 eth0 10.0.0.9 C2 eth1 172.18.0.4 veth09fe1d8 eth0 10.0.0.10 C3 eth1 172.18.0.5 veth4000548 eth0 10.0.0.11 myoverlay - VNI 100 $ docker network create -d overlay myoverlay $ docker service create --network myoverlay nginx
  15. 15. Overlay network VXLAN tunnel veth veth VTEP VTEP 10.0.0.5 10.0.0.6 192.168.1.100 192.168.1.200
  16. 16. Macvlan & Ipvlan
  17. 17. Macvlan & Ipvlan Network switch (gateway 172.16.1.1) eth0: 172.16.1.253 (IP optional) C1 eth0 172.16.1.10 C3C2 eth0 172.16.1.11 eth0 172.16.1.12 eth0: 172.16.1.254 (IP optional) C4 eth0 172.16.1.13 C6C5 eth0 172.16.1.14 eth0 172.16.1.15

×