The docker0 interface is a bridge interface created when we installed docker. One eth0 and one lo as always, and one additional interface called docker0 shown above. So the underlying host has three interfaces. TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 RX packets:3 errors:0 dropped:0 overruns:0 frame:0 TX packets:7374 errors:0 dropped:0 overruns:0 carrier:0 RX packets:90197 errors:0 dropped:0 overruns:0 frame:0 RX packets:23 errors:0 dropped:0 overruns:0 frame:0 Once we have exited from the container, lets see the ifconfig output of the underlying ifconfigĭocker0 Link encap:Ethernet HWaddr 02:42:a8:de:ed:84 Let's exit from the container by typing exit or CTRL + D. Now let's see how the underlying host is dealing with this network. Which means the default docker internal network will always have a network CIDR of 172.17.0.0/16. So the container has an ip address of 172.17.0.2 and a netmask of 255.255.0.0. Then we fired up the basic ifconfig command to see the default IP address we got inside the container. Once the image is pulled and the container is started, we are in the container shell prompt(shown by Here 1dfa7ba191a9 is the container id.) Now as the system does not have that image, it downloads it from dockerhub and runs it interactively. The first command shown above runs the default ubuntu:latest container. TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 RX packets:16 errors:0 dropped:0 overruns:0 frame:0 UP BROADCAST RUNNING MULTICAST MTU:9001 Metric:1 Status: Downloaded newer image for ifconfigĮth0 Link encap:Ethernet HWaddr 02:42:ac:11:00:02 Let’s start an ubuntu default docker container, and analyse its default network configurations to see what's going docker run -it -rm ubuntu Let’s get started by understanding the by default network configuration of a docker container.
#DOCKER NETWORK INTERFACE NAME HOW TO#
Read: How to Build Docker images using a Dockerfile Read: Difference between Containers and Virtual Machines Previous Tutorials can be accessed via the following links. Its really important to understand the networking part of docker, as the primary use case of Docker is to create services that users or other services will connect and communicate to. But we haven't talked about how docker does networking. In our previous tutorials, we talked about introduction to docker containers, docker installation, running our first container, pulling images, creating images etc.