SlideShare uma empresa Scribd logo
1 de 9
DOCKER NETWORKING
TIPS
Troubleshooting
Presenter’s Name: Sreenivas Makam
Associated Youtube video: https://youtu.be/d-
sgEwmvBko
Troubleshooting levels
Level 1
Debug commands
Level 2
Debug container with
network troubleshoot tools
Level 3
Network namespace
Use container, service,
network inspect
commands
nicolaka/netshoot
container to use network
tools like tcpdump, iperf,
netstat, ipvs etc
look at route table, arp
table, vxlan details,
iptables for nat and
mangle rule, ipvsadm for
load balancing
Swarm Networking - Sample application
detail
 The application will be deployed in 2 node Swarm cluster.
 “client” service has 1 client container task. “vote” service has multiple vote container tasks. Client
service is used to access multi-container voting service. This application is deployed in a multi-node
Swarm cluster.
 “vote” services can be accessed from “client” service as well as from outside the swarm cluster.
docker network create -d overlay overlay1
docker service create --replicas 1 --name client --network overlay1 smakam/myubuntu:v4 sleep infinity
docker service create --name vote --network overlay1 --mode replicated --replicas 2 --publish
mode=ingress,target=80,published=8080 instavote/vote
Swarm Networking - Application access
flow
“Client” service accessing “vote” service using “overlay” network
Accessing “vote” service using “ingress” network externally
Swarm Application - Networking detail
 Sandboxes and “vote” containers are part of “ingress” network and it helps in routing
mesh.
 “client” and “vote” containers are part of “overlay1” network and it helps in service
connectivity.
 All containers are part of the default “docker_gwbridge” network. This helps for external
access when services gets exposed using publish mode “host”
Docker Network debug commands
 Basic Swarm debugging:
Docker node ls
 Service and Container debugging:
Docker service logs <service name/id>
Docker service inspect <service name/id>
Docker service ls
Docker service ps <service name/id>
Docker container logs <container name/id>
Docker container inspect <container name/id>
 Network debugging:
Docker network inspect <network name/id>
Use “-v” option for verbose output
Troubleshooting using debug container
• All Linux networking tools are packaged inside
“nicolaka/netshoot”(https://github.com/nicolaka/netshoot) container. This can be used
for debugging.
• Using this debug container avoids installation of any debug tools inside the container or
host.
• Linux networking tools like tcpdump, netstat can be accessed from container namespace
or host namespace.
Capture port 80 packets in the Container:
docker run -ti --net container:<containerid> nicolaka/netshoot
tcpdump –i eth0 –n port 80
Capture vxlan packets in the host:
docker run -ti --net host nicolaka/netshoot
tcpdump –i eth1 –n port 4789
• Debug container can also be used to get inside container namespace, network
namespace and do debugging. Inside the namespace, we can run commands like
“ifconfig”, “ip route”, “brctl show” to debug further.
Starting nsenter using debug container:
docker run -it --rm -v /var/run/docker/netns:/var/run/docker/netns --privileged=true nicolaka/netshoot
Getting inside container or network namespace:
nsenter –net /var/run/docker/netns/<networkid> sh
Useful commands inside Network namespace
Interface list:
Ifconfig
Bridge list:
brctl show
Route table:
Ip route show
Link details:
ip -d link show
Arp table:
ip -s neighbor show
Encapsulation detail:
bridge fdb show
Capture packets:
Tcpdump -I <interface> -n port <port number>
Iptables nat and mangle rule:
iptables -nvL -t nat
iptables -nvL -t mangle
Check load balancing:
ipvsadm
References
• Troubleshooting container
• Docker Networking Overview
• Docker Networking – common issues and
troubleshooting techniques
• Docker blogs by me

Mais conteúdo relacionado

Mais de Sreenivas Makam

Mais de Sreenivas Makam (15)

My kubernetes toolkit
My kubernetes toolkitMy kubernetes toolkit
My kubernetes toolkit
 
Top 3 reasons why you should run your Enterprise workloads on GKE
Top 3 reasons why you should run your Enterprise workloads on GKETop 3 reasons why you should run your Enterprise workloads on GKE
Top 3 reasons why you should run your Enterprise workloads on GKE
 
How Kubernetes helps Devops
How Kubernetes helps DevopsHow Kubernetes helps Devops
How Kubernetes helps Devops
 
Deep dive into Kubernetes Networking
Deep dive into Kubernetes NetworkingDeep dive into Kubernetes Networking
Deep dive into Kubernetes Networking
 
Compare Docker deployment options in the public cloud
Compare Docker deployment options in the public cloudCompare Docker deployment options in the public cloud
Compare Docker deployment options in the public cloud
 
Docker Mentorweek beginner workshop notes
Docker Mentorweek beginner workshop notesDocker Mentorweek beginner workshop notes
Docker Mentorweek beginner workshop notes
 
Devops in Networking
Devops in NetworkingDevops in Networking
Devops in Networking
 
Docker Security Overview
Docker Security OverviewDocker Security Overview
Docker Security Overview
 
Docker 1.11 Presentation
Docker 1.11 PresentationDocker 1.11 Presentation
Docker 1.11 Presentation
 
Service Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesService Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and Kubernetes
 
CoreOS Overview and Current Status
CoreOS Overview and Current StatusCoreOS Overview and Current Status
CoreOS Overview and Current Status
 
Container Monitoring with Sysdig
Container Monitoring with SysdigContainer Monitoring with Sysdig
Container Monitoring with Sysdig
 
CI, CD with Docker, Jenkins and Tutum
CI, CD with Docker, Jenkins and TutumCI, CD with Docker, Jenkins and Tutum
CI, CD with Docker, Jenkins and Tutum
 
Docker 1.9 Feature Overview
Docker 1.9 Feature OverviewDocker 1.9 Feature Overview
Docker 1.9 Feature Overview
 
Docker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental NetworkingDocker Networking - Current Status and goals of Experimental Networking
Docker Networking - Current Status and goals of Experimental Networking
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Tips for troubleshooting Docker Networking issues

  • 1. DOCKER NETWORKING TIPS Troubleshooting Presenter’s Name: Sreenivas Makam Associated Youtube video: https://youtu.be/d- sgEwmvBko
  • 2. Troubleshooting levels Level 1 Debug commands Level 2 Debug container with network troubleshoot tools Level 3 Network namespace Use container, service, network inspect commands nicolaka/netshoot container to use network tools like tcpdump, iperf, netstat, ipvs etc look at route table, arp table, vxlan details, iptables for nat and mangle rule, ipvsadm for load balancing
  • 3. Swarm Networking - Sample application detail  The application will be deployed in 2 node Swarm cluster.  “client” service has 1 client container task. “vote” service has multiple vote container tasks. Client service is used to access multi-container voting service. This application is deployed in a multi-node Swarm cluster.  “vote” services can be accessed from “client” service as well as from outside the swarm cluster. docker network create -d overlay overlay1 docker service create --replicas 1 --name client --network overlay1 smakam/myubuntu:v4 sleep infinity docker service create --name vote --network overlay1 --mode replicated --replicas 2 --publish mode=ingress,target=80,published=8080 instavote/vote
  • 4. Swarm Networking - Application access flow “Client” service accessing “vote” service using “overlay” network Accessing “vote” service using “ingress” network externally
  • 5. Swarm Application - Networking detail  Sandboxes and “vote” containers are part of “ingress” network and it helps in routing mesh.  “client” and “vote” containers are part of “overlay1” network and it helps in service connectivity.  All containers are part of the default “docker_gwbridge” network. This helps for external access when services gets exposed using publish mode “host”
  • 6. Docker Network debug commands  Basic Swarm debugging: Docker node ls  Service and Container debugging: Docker service logs <service name/id> Docker service inspect <service name/id> Docker service ls Docker service ps <service name/id> Docker container logs <container name/id> Docker container inspect <container name/id>  Network debugging: Docker network inspect <network name/id> Use “-v” option for verbose output
  • 7. Troubleshooting using debug container • All Linux networking tools are packaged inside “nicolaka/netshoot”(https://github.com/nicolaka/netshoot) container. This can be used for debugging. • Using this debug container avoids installation of any debug tools inside the container or host. • Linux networking tools like tcpdump, netstat can be accessed from container namespace or host namespace. Capture port 80 packets in the Container: docker run -ti --net container:<containerid> nicolaka/netshoot tcpdump –i eth0 –n port 80 Capture vxlan packets in the host: docker run -ti --net host nicolaka/netshoot tcpdump –i eth1 –n port 4789 • Debug container can also be used to get inside container namespace, network namespace and do debugging. Inside the namespace, we can run commands like “ifconfig”, “ip route”, “brctl show” to debug further. Starting nsenter using debug container: docker run -it --rm -v /var/run/docker/netns:/var/run/docker/netns --privileged=true nicolaka/netshoot Getting inside container or network namespace: nsenter –net /var/run/docker/netns/<networkid> sh
  • 8. Useful commands inside Network namespace Interface list: Ifconfig Bridge list: brctl show Route table: Ip route show Link details: ip -d link show Arp table: ip -s neighbor show Encapsulation detail: bridge fdb show Capture packets: Tcpdump -I <interface> -n port <port number> Iptables nat and mangle rule: iptables -nvL -t nat iptables -nvL -t mangle Check load balancing: ipvsadm
  • 9. References • Troubleshooting container • Docker Networking Overview • Docker Networking – common issues and troubleshooting techniques • Docker blogs by me