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.

Docker Networking Tip - Macvlan driver


Published on

This covers basics of Docker Macvlan driver, use-cases and demo of 2 use-cases. Associated Youtube video(

Published in: Technology
  • Be the first to comment

Docker Networking Tip - Macvlan driver

  1. 1. DOCKER NETWORKING TIPS Macvlan Usage Presenter’s Name: Sreenivas Makam Associated Youtube video:
  2. 2. About me  Senior Engineering Manager at Cisco Systems Data Center group  Author of “Mastering CoreOS” and-servers/mastering-coreos/ )  Docker Captain( )  Blog:  Projects:  LinkedIn:  Twitter: @srmakam
  3. 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. 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. 5. Macvlan Use-case 1 Container Mysql database Host 1 Host 2 192.168.99.x network Eth0 Eth0 Macvlan docker network create -d macvlan --subnet= --ip-range= --gateway= -o macvlan_mode=bridge -o parent=eth1 macvlantest docker run --net=macvlantest -ti smakam/myubuntu:v6 bash Connecting to Legacy non-containerized application
  6. 6. Macvlan Use-case 2 client Host 1 Host 2 192.168.99.x network Eth0 Eth0 Macvlan Host 1: docker network create --config-only --subnet --gateway -o parent=eth0 --ip-range macvlan1c Host 2: docker network create --config-only --subnet --gateway -o parent=eth1 --ip-range 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 Macvlan Multi-service application using Macvlan driver in Swarm cluster
  7. 7. References  Blog on Macvlan and Ipvlan basics  Blog on Docker Macvlan and Ipvlan networking plugin  Docker Networking – common issues and troubleshooting techniques