Member-only story
How to create network namespaces like docker or any container runtime ?
Docker or container runtimes implement multiple namespaces. For example, docker uses user, ipc, mount namespaces… and network namespaces.

Namespaces are one of fundamentals about containerization on linux based. Second important tools are cgroups of course.
But namespaces provide you the capacity to isolate process. Without isolation, no containerization. And the network namespace allow you to create a dedicated network for your process. By this way, the process see only its own localhost (127.0.0.1) and its interface connected o the bridge.
So, to begin, I think it’s a good idea to discover how to install some network namespaces and a bridge like docker does for you so easily.
Go go go !!
Let’s define some variables
You’ll see it below, we’ll need to us and re-use many command line.
To avoid to edit again and again same values or if you want to change its, start by defining variables.