![docker network host or bridge docker network host or bridge](https://i.stack.imgur.com/qb7pa.png)
Now that we’ve covered some of what’s going on under the hood with Docker networking, let’s look at five ways to configure the network when a Docker container runs: The above output shows that this veth interface has been connected to the docker0 bridge. Inet6 fe80::70f0:84ff:fe31:fbba/64 scope linkĪs you can see, the machine we’re demoing on already has Docker installed, which has led to the creation of the docker0 bridge.ġ6: mtu 1500 qdisc noqueue master docker0 state UP mode DEFAULT group default
![docker network host or bridge docker network host or bridge](https://programming.vip/images/doc/144a23639f6631aa23375bd105b2f8c4.jpg)
Inet6 fe80::42:4aff:fe01:1581/64 scope linkĩ: flannel.1: mtu 1450 qdisc noqueue state UNKNOWN group default Inet6 fe80::200:12ff:feab:1/64 scope linkĤ: docker0: mtu 1500 qdisc noqueue state DOWN group default Inet6 fe80::20c:29ff:fe38:abab/64 scope linkģ: ens33: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 Let’s create two different network namespaces and name them after cities in the US as a demonstration:ġ: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 It’s very easy to create network namespaces using the ip command in any Linux operating system. Namespaces provide functionality that offers different kinds of isolation, with network namespace being the one that provides network isolation. The Linux kernel has various features that have been developed to provide multi-tenancy on hosts. Core Container Networking Demonstrationīefore we jump in to understanding the various options provided by Docker, let’s explore the core technology that powers container networking. Some of the main responsibilities include providing connectivity between containers running on the same host as well as on different hosts - possibly belonging to the same cluster or pool of hosts - exposing the services provided within containers to either the end users or to other systems. Networking is a crucial component in the container ecosystem. End users need a way to interact with the services provided inside these containers. Multiple containers need to interact with each other to provide various useful services. Despite runtime isolation being one of the major advantages, containers working in isolation are often not very useful. Though the underlying technology had been available in the Linux kernel for many years, it did not gain the current widespread adoption until Docker came along and made this technology easy to use. Containers have become a popular way of packaging and delivering applications.