Docker 101 : Network namespace from docker and the host perspective

Network namespace is a Linux concept that allows processes running inside different network namespaces to have their own network stack, routing tables, ...

As an example, we start by running a debian container as follows:

We check its PID - process ID - from the host using the below:

We check the identifier of the process network namespace using the "readlink" command:

The network namespace identifier is "6598423514".

We then check the IP address of the debian container using the following:

The we check the IP address of the network namespace of the process "14587" using the "nsenter" command to see if it coincides with the IP address of the container:

We see that they we get the same IP address.


Leave as a comment: