SlideShare a Scribd company logo
1 of 17
Verona Docker Meetup 26/10/2016
Understanding Docker
Networking
Lorenzo Fontana
DevOps at Kiratech
@fntlnz
Null Network
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
Host Network
Host Network
$ docker run -it --network= host alpine sh
Bridge Network
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
Custom Bridge Network
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
Custom Bridge Network
IPAM underlay
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
Overlay Network
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
Overlay network
VXLAN tunnel
veth veth
VTEP VTEP
10.0.0.5 10.0.0.6
192.168.1.100 192.168.1.200
Macvlan & Ipvlan
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

More Related Content

What's hot

Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
Docker, Inc.
 

What's hot (20)

Kubernetes in Docker
Kubernetes in DockerKubernetes in Docker
Kubernetes in Docker
 
Docker Networking Deep Dive
Docker Networking Deep DiveDocker Networking Deep Dive
Docker Networking Deep Dive
 
Docker Swarm for Beginner
Docker Swarm for BeginnerDocker Swarm for Beginner
Docker Swarm for Beginner
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Docker swarm introduction
Docker swarm introductionDocker swarm introduction
Docker swarm introduction
 
Docker 基礎介紹與實戰
Docker 基礎介紹與實戰Docker 基礎介紹與實戰
Docker 基礎介紹與實戰
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
 
Docker intro
Docker introDocker intro
Docker intro
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
 
Intro docker
Intro dockerIntro docker
Intro docker
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 

Viewers also liked

Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
Ryan Cuprak
 

Viewers also liked (20)

georchestra SDI: Project Status Report
georchestra SDI: Project Status Reportgeorchestra SDI: Project Status Report
georchestra SDI: Project Status Report
 
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in BerlinDeploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
 
moscmy2016: Extending Docker
moscmy2016: Extending Dockermoscmy2016: Extending Docker
moscmy2016: Extending Docker
 
Introduction to Docker - Learning containerization XP conference 2016
Introduction to Docker - Learning containerization  XP conference 2016Introduction to Docker - Learning containerization  XP conference 2016
Introduction to Docker - Learning containerization XP conference 2016
 
Using docker to develop NAS applications
Using docker to develop NAS applicationsUsing docker to develop NAS applications
Using docker to develop NAS applications
 
Containers for sensor web services, applications and research @ Sensor Web Co...
Containers for sensor web services, applications and research @ Sensor Web Co...Containers for sensor web services, applications and research @ Sensor Web Co...
Containers for sensor web services, applications and research @ Sensor Web Co...
 
Docker for the Brave
Docker for the BraveDocker for the Brave
Docker for the Brave
 
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
 
Docker Dhahran Nov 2016 meetup
Docker Dhahran Nov 2016 meetupDocker Dhahran Nov 2016 meetup
Docker Dhahran Nov 2016 meetup
 
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSS
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSSCordova / PhoneGap, mobile apps development with HTML5/JS/CSS
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSS
 
DevOps FTW!, Will cloud and DevOps make you sleep peacefully?
DevOps FTW!, Will cloud and DevOps make you sleep peacefully?DevOps FTW!, Will cloud and DevOps make you sleep peacefully?
DevOps FTW!, Will cloud and DevOps make you sleep peacefully?
 
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
 
Building a private CI/CD pipeline with Java and Docker in the Cloud as presen...
Building a private CI/CD pipeline with Java and Docker in the Cloud as presen...Building a private CI/CD pipeline with Java and Docker in the Cloud as presen...
Building a private CI/CD pipeline with Java and Docker in the Cloud as presen...
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Advanced Docker Developer Workflows on MacOS X and Windows
Advanced Docker Developer Workflows on MacOS X and WindowsAdvanced Docker Developer Workflows on MacOS X and Windows
Advanced Docker Developer Workflows on MacOS X and Windows
 
Jelastic - DevOps for Java with Docker Containers - Madrid 2015
Jelastic - DevOps for Java with Docker Containers - Madrid 2015Jelastic - DevOps for Java with Docker Containers - Madrid 2015
Jelastic - DevOps for Java with Docker Containers - Madrid 2015
 
Docker and java
Docker and javaDocker and java
Docker and java
 
Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]Top 50 java ee 7 best practices [con5669]
Top 50 java ee 7 best practices [con5669]
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day training
 
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
50 EJB 3 Best Practices in 50 Minutes - JavaOne 201450 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
 

Similar to Understanding docker networking

Chris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks TutorialChris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks Tutorial
Cohesive Networks
 

Similar to Understanding docker networking (20)

Deep dive in Docker Overlay Networks
Deep dive in Docker Overlay NetworksDeep dive in Docker Overlay Networks
Deep dive in Docker Overlay Networks
 
Deeper Dive in Docker Overlay Networks
Deeper Dive in Docker Overlay NetworksDeeper Dive in Docker Overlay Networks
Deeper Dive in Docker Overlay Networks
 
Deep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay NetworksDeep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay Networks
 
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
Docker Meetup: Docker Networking 1.11, by Madhu VenugopalDocker Meetup: Docker Networking 1.11, by Madhu Venugopal
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
 
Docker Meetup: Docker Networking 1.11 with Madhu Venugopal
Docker Meetup: Docker Networking 1.11 with Madhu VenugopalDocker Meetup: Docker Networking 1.11 with Madhu Venugopal
Docker Meetup: Docker Networking 1.11 with Madhu Venugopal
 
Docker 1.11 Meetup: Networking Showcase
Docker 1.11 Meetup: Networking ShowcaseDocker 1.11 Meetup: Networking Showcase
Docker 1.11 Meetup: Networking Showcase
 
Deeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay NetworksDeeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay Networks
 
Octo talk : docker multi-host networking
Octo talk : docker multi-host networking Octo talk : docker multi-host networking
Octo talk : docker multi-host networking
 
Deep Dive in Docker Overlay Networks - Laurent Bernaille - Architect, D2SI
Deep Dive in Docker Overlay Networks - Laurent Bernaille - Architect, D2SIDeep Dive in Docker Overlay Networks - Laurent Bernaille - Architect, D2SI
Deep Dive in Docker Overlay Networks - Laurent Bernaille - Architect, D2SI
 
Docker Networking with New Ipvlan and Macvlan Drivers
Docker Networking with New Ipvlan and Macvlan DriversDocker Networking with New Ipvlan and Macvlan Drivers
Docker Networking with New Ipvlan and Macvlan Drivers
 
Docker SDN (software-defined-networking) JUG
Docker SDN (software-defined-networking) JUGDocker SDN (software-defined-networking) JUG
Docker SDN (software-defined-networking) JUG
 
Learning kubernetes
Learning kubernetesLearning kubernetes
Learning kubernetes
 
Chris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks TutorialChris Swan ONUG Academy - Container Networks Tutorial
Chris Swan ONUG Academy - Container Networks Tutorial
 
Docker networking Tutorial 101
Docker networking Tutorial 101Docker networking Tutorial 101
Docker networking Tutorial 101
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
 
DeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerDeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to Docker
 
Docker practice
Docker practiceDocker practice
Docker practice
 
Docker Networking
Docker NetworkingDocker Networking
Docker Networking
 
Cloud RPI4 tomcat ARM64
Cloud RPI4 tomcat ARM64Cloud RPI4 tomcat ARM64
Cloud RPI4 tomcat ARM64
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 

Recently uploaded

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 

Understanding docker networking

  • 1. Verona Docker Meetup 26/10/2016 Understanding Docker Networking
  • 2. Lorenzo Fontana DevOps at Kiratech @fntlnz
  • 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
  • 6. Host Network $ docker run -it --network= host alpine sh
  • 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
  • 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
  • 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
  • 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. Overlay network VXLAN tunnel veth veth VTEP VTEP 10.0.0.5 10.0.0.6 192.168.1.100 192.168.1.200
  • 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