SlideShare a Scribd company logo
DOCKER NETWORKING
TIPS
Macvlan Usage
Presenter’s Name: Sreenivas Makam
Associated Youtube video:
https://youtu.be/3vI2DVb8qWk
About me
 Senior Engineering Manager at Cisco Systems Data Center group
 Author of “Mastering CoreOS” https://www.packtpub.com/networking-
and-servers/mastering-coreos/ )
 Docker Captain(https://www.docker.com/community/docker-captains )
 Blog: https://sreeninet.wordpress.com/
 Projects: https://github.com/smakam
 LinkedIn: https://in.linkedin.com/in/sreenivasmakam
 Twitter: @srmakam
Bridge Macvlan
C1
Underlay(ethx)
C2 C1 C2
Underlay(ethx)
C1 C2
Underlay(ethx.1)
Macvlan
C3 C4
Underlay(ethx.2)
Bridge vs Macvlan
• Single physical interface can have multiple mac and ip addresses using macvlan
driver.
• Macvlan bridge is simplified bridge implementation with no mac learning, NAT and
STP.
172.17.x.x
192.168.x.x
192.168.1.x
192.168.1.x
192.168.1.x
192.168.1.x
192.168.2.x
192.168.2.x
Need for Macvlan network driver
 Need Container IP directly in underlay
network managed by enterprise IT
 Explicit control over Container IP assignment
 Connect Containers to legacy applications
 Connect Containers to external network
without overlay network overhead
 Have a need to preserve source IP of
container
Macvlan Use-case 1
Container
Mysql
database
Host 1 Host 2
192.168.99.x network
Eth0
192.168.99.100
Eth0
192.168.99.102
Macvlan
192.168.99.192
docker network create -d macvlan --subnet=192.168.99.0/24 --ip-range=192.168.99.192/26
--gateway=192.168.99.1 -o macvlan_mode=bridge -o parent=eth1 macvlantest
docker run --net=macvlantest -ti smakam/myubuntu:v6 bash
Connecting to Legacy non-containerized application
Macvlan Use-case 2
client
Host 1 Host 2
192.168.99.x network
Eth0
192.168.99.100
Eth0
192.168.99.101
Macvlan
192.168.99.65
Host 1:
docker network create --config-only --subnet 192.168.99.0/24 --gateway 192.168.99.1 -o parent=eth0 --ip-range 192.168.99.64/26
macvlan1c
Host 2:
docker network create --config-only --subnet 192.168.99.0/24 --gateway 192.168.99.1 -o parent=eth1 --ip-range 192.168.99.128/26
macvlan1c
Host 1:
docker network create -d macvlan --scope swarm --config-from macvlan1c macvlanswarm
docker service create --replicas 1 --name client --network macvlanswarm --detach=false smakam/myubuntu:v4 sleep infinity
docker service create --name vote --network macvlanswarm --mode replicated --replicas 2 --publish
mode=ingress,target=80,published=8080 instavote/vote
Vote.1 Vote.2
Swarm
Macvlan
192.168.99.64
Macvlan
192.168.99.128
Multi-service application using Macvlan driver in Swarm cluster
References
 Blog on Macvlan and Ipvlan basics
 Blog on Docker Macvlan and Ipvlan
networking plugin
 Docker Networking – common
issues and troubleshooting techniques

More Related Content

PPTX
Introduction to Kubernetes
PPTX
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
PPTX
Advanced Tools and Techniques for Troubleshooting NetScaler Appliances
PDF
perfを使ったPostgreSQLの解析(前編)
PDF
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
PPTX
Data In Motion Paris 2023
PDF
Cilium - overview and recent updates
PPTX
Introduction to the Container Network Interface (CNI)
Introduction to Kubernetes
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
Advanced Tools and Techniques for Troubleshooting NetScaler Appliances
perfを使ったPostgreSQLの解析(前編)
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
Data In Motion Paris 2023
Cilium - overview and recent updates
Introduction to the Container Network Interface (CNI)

What's hot (20)

PPTX
A visual introduction to Apache Kafka
PDF
[GitOps] Argo CD on GKE (v0.9.2).pdf
PDF
20221122-IBM Power10全新IBM Power10 入門和中階 .pdf
PDF
Can Apache Kafka Replace a Database?
PDF
Microservices in Node.js: Patterns and techniques
PDF
Kubernetes: A Short Introduction (2019)
PPTX
Building flexible ETL pipelines with Apache Camel on Quarkus
PDF
Reactive Web 101: WebFlux, WebClient, and Reactor Netty
PDF
How deep is your buffer – Demystifying buffers and application performance
PPTX
DevOps with Kubernetes
PPTX
【改訂版あり】クラウド・ネイティブ時代に最適なJavaベースのマイクロサービス・フレームワーク ~ Helidonの実力を見極めろ!
ODP
OpenShift Enterprise
PPTX
Stability Patterns for Microservices
PDF
[D20] 高速Software Switch/Router 開発から得られた高性能ソフトウェアルータ・スイッチ活用の知見 (July Tech Fest...
PDF
PPTX
PDF
AvailabilityZoneとHostAggregate
PDF
OpenShift-Technical-Overview.pdf
PDF
[AKIBA.AWS] VGWのルーティング仕様
PDF
[最新バージョンの情報がDescription欄にございます]AWS Black Belt Online Seminar 2018 Amazon Connect
A visual introduction to Apache Kafka
[GitOps] Argo CD on GKE (v0.9.2).pdf
20221122-IBM Power10全新IBM Power10 入門和中階 .pdf
Can Apache Kafka Replace a Database?
Microservices in Node.js: Patterns and techniques
Kubernetes: A Short Introduction (2019)
Building flexible ETL pipelines with Apache Camel on Quarkus
Reactive Web 101: WebFlux, WebClient, and Reactor Netty
How deep is your buffer – Demystifying buffers and application performance
DevOps with Kubernetes
【改訂版あり】クラウド・ネイティブ時代に最適なJavaベースのマイクロサービス・フレームワーク ~ Helidonの実力を見極めろ!
OpenShift Enterprise
Stability Patterns for Microservices
[D20] 高速Software Switch/Router 開発から得られた高性能ソフトウェアルータ・スイッチ活用の知見 (July Tech Fest...
AvailabilityZoneとHostAggregate
OpenShift-Technical-Overview.pdf
[AKIBA.AWS] VGWのルーティング仕様
[最新バージョンの情報がDescription欄にございます]AWS Black Belt Online Seminar 2018 Amazon Connect
Ad

Similar to Docker Networking Tip - Macvlan driver (20)

PDF
CCCEU15 run cloudstack in docker
PDF
CloudStack Collab Conference 2015 Run CloudStack in Docker
PPTX
Docker Networking - Common Issues and Troubleshooting Techniques
PDF
[Docker Tokyo - DockerCon Recap] Updates from Microsoft
PPTX
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
PPTX
Docker and SDL Web/Tridion - SDL UK User Group April 2017
PPTX
Network Design patters with Docker
PPTX
[Codelab 2017] Docker 기초 및 활용 방안
PPTX
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
PPTX
Docker 101 describing basic docker usage
PDF
Build a Docker Swarm cluster on Azure
PPTX
Docker Networking Overview
PDF
Experts Live Europe 2017 - Why you should care about Docker - an introduction
PPTX
EMC World 2016 - code.09 Introduction to the Docker Platform
PDF
FPC for the Masses (SANSFire Edition)
PPTX
Docker 1.11 Presentation
PDF
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
PPTX
No more Dockerfiles? Buildpacks to help you ship your image!
PDF
Cloud orchestration risks
PPTX
Real World Experience of Running Docker in Development and Production
CCCEU15 run cloudstack in docker
CloudStack Collab Conference 2015 Run CloudStack in Docker
Docker Networking - Common Issues and Troubleshooting Techniques
[Docker Tokyo - DockerCon Recap] Updates from Microsoft
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker and SDL Web/Tridion - SDL UK User Group April 2017
Network Design patters with Docker
[Codelab 2017] Docker 기초 및 활용 방안
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker 101 describing basic docker usage
Build a Docker Swarm cluster on Azure
Docker Networking Overview
Experts Live Europe 2017 - Why you should care about Docker - an introduction
EMC World 2016 - code.09 Introduction to the Docker Platform
FPC for the Masses (SANSFire Edition)
Docker 1.11 Presentation
ContainerDays Boston 2016: "Docker For the Developer" (Borja Burgos)
No more Dockerfiles? Buildpacks to help you ship your image!
Cloud orchestration risks
Real World Experience of Running Docker in Development and Production
Ad

More from Sreenivas Makam (18)

PDF
GKE Tip Series - Usage Metering
PDF
GKE Tip Series how do i choose between gke standard, autopilot and cloud run
PDF
Kubernetes design principles, patterns and ecosystem
PDF
My kubernetes toolkit
PDF
Top 3 reasons why you should run your Enterprise workloads on GKE
PDF
How Kubernetes helps Devops
PDF
Deep dive into Kubernetes Networking
PPTX
Docker Networking Tip - Load balancing options
PPTX
Compare Docker deployment options in the public cloud
PPTX
Docker Mentorweek beginner workshop notes
PPTX
Devops in Networking
PPTX
Docker Security Overview
PPTX
Service Discovery using etcd, Consul and Kubernetes
PPTX
CoreOS Overview and Current Status
PPTX
Container Monitoring with Sysdig
PPTX
CI, CD with Docker, Jenkins and Tutum
PPTX
Docker 1.9 Feature Overview
PPTX
Docker Networking - Current Status and goals of Experimental Networking
GKE Tip Series - Usage Metering
GKE Tip Series how do i choose between gke standard, autopilot and cloud run
Kubernetes design principles, patterns and ecosystem
My kubernetes toolkit
Top 3 reasons why you should run your Enterprise workloads on GKE
How Kubernetes helps Devops
Deep dive into Kubernetes Networking
Docker Networking Tip - Load balancing options
Compare Docker deployment options in the public cloud
Docker Mentorweek beginner workshop notes
Devops in Networking
Docker Security Overview
Service Discovery using etcd, Consul and Kubernetes
CoreOS Overview and Current Status
Container Monitoring with Sysdig
CI, CD with Docker, Jenkins and Tutum
Docker 1.9 Feature Overview
Docker Networking - Current Status and goals of Experimental Networking

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
MYSQL Presentation for SQL database connectivity
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
20250228 LYD VKU AI Blended-Learning.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Digital-Transformation-Roadmap-for-Companies.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Unlocking AI with Model Context Protocol (MCP)
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Network Security Unit 5.pdf for BCA BBA.
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Dropbox Q2 2025 Financial Results & Investor Presentation
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Understanding_Digital_Forensics_Presentation.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation_ Review paper, used for researhc scholars
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Empathic Computing: Creating Shared Understanding
MYSQL Presentation for SQL database connectivity

Docker Networking Tip - Macvlan driver

  • 1. DOCKER NETWORKING TIPS Macvlan Usage Presenter’s Name: Sreenivas Makam Associated Youtube video: https://youtu.be/3vI2DVb8qWk
  • 2. About me  Senior Engineering Manager at Cisco Systems Data Center group  Author of “Mastering CoreOS” https://www.packtpub.com/networking- and-servers/mastering-coreos/ )  Docker Captain(https://www.docker.com/community/docker-captains )  Blog: https://sreeninet.wordpress.com/  Projects: https://github.com/smakam  LinkedIn: https://in.linkedin.com/in/sreenivasmakam  Twitter: @srmakam
  • 3. Bridge Macvlan C1 Underlay(ethx) C2 C1 C2 Underlay(ethx) C1 C2 Underlay(ethx.1) Macvlan C3 C4 Underlay(ethx.2) Bridge vs Macvlan • Single physical interface can have multiple mac and ip addresses using macvlan driver. • Macvlan bridge is simplified bridge implementation with no mac learning, NAT and STP. 172.17.x.x 192.168.x.x 192.168.1.x 192.168.1.x 192.168.1.x 192.168.1.x 192.168.2.x 192.168.2.x
  • 4. Need for Macvlan network driver  Need Container IP directly in underlay network managed by enterprise IT  Explicit control over Container IP assignment  Connect Containers to legacy applications  Connect Containers to external network without overlay network overhead  Have a need to preserve source IP of container
  • 5. Macvlan Use-case 1 Container Mysql database Host 1 Host 2 192.168.99.x network Eth0 192.168.99.100 Eth0 192.168.99.102 Macvlan 192.168.99.192 docker network create -d macvlan --subnet=192.168.99.0/24 --ip-range=192.168.99.192/26 --gateway=192.168.99.1 -o macvlan_mode=bridge -o parent=eth1 macvlantest docker run --net=macvlantest -ti smakam/myubuntu:v6 bash Connecting to Legacy non-containerized application
  • 6. Macvlan Use-case 2 client Host 1 Host 2 192.168.99.x network Eth0 192.168.99.100 Eth0 192.168.99.101 Macvlan 192.168.99.65 Host 1: docker network create --config-only --subnet 192.168.99.0/24 --gateway 192.168.99.1 -o parent=eth0 --ip-range 192.168.99.64/26 macvlan1c Host 2: docker network create --config-only --subnet 192.168.99.0/24 --gateway 192.168.99.1 -o parent=eth1 --ip-range 192.168.99.128/26 macvlan1c Host 1: docker network create -d macvlan --scope swarm --config-from macvlan1c macvlanswarm docker service create --replicas 1 --name client --network macvlanswarm --detach=false smakam/myubuntu:v4 sleep infinity docker service create --name vote --network macvlanswarm --mode replicated --replicas 2 --publish mode=ingress,target=80,published=8080 instavote/vote Vote.1 Vote.2 Swarm Macvlan 192.168.99.64 Macvlan 192.168.99.128 Multi-service application using Macvlan driver in Swarm cluster
  • 7. References  Blog on Macvlan and Ipvlan basics  Blog on Docker Macvlan and Ipvlan networking plugin  Docker Networking – common issues and troubleshooting techniques