我们通常演示的时候是通过 ip netns add 来添加对应的ns的。但是Docker创建出来的,我们通过ip netns ls 却看不到,我们有没有什么办法看到呢?我们这里给出一个方法:This post is to illustrate how to access the docker container’s network namespace.1. Identify the docker container id you want to access and run below command as root on host.# docker ps2. Get docker container’s PID:# pid=$(docker inspect -f '{{.State.Pid}}' ${container_id})3. Create netns directory:# mkdir -p /var/run/netns/4. Create the name space softlink:# ln -sfT /proc/$pid/ns/net /var/run/netns/[container_id]5. Run ip netns command to access this name space. For example:# ip netns exec [container_id] ip ahttps://stackoverflow.com/questions/31265993/docker-networking-namespace-not-visible-in-ip-netns-list