I have manged to setup a three nodes overlay network environment, 1. consul node, 2. swarm master 3. swarm slave.
the multi-host networking works as expected.
When i was trying to deep dive into the overlay network mechanism, from /var/run/docker/netns/, it shows:
root@ubuntu1:/var/run/docker/netns# ls /var/run/docker/netns/
22265cd326d8 2-e6bd07dcef 3f753c31a708 5-53206a655f 9b0db332c3f0 d918fe481a28
my question is how to check the contents within 2-e6bd07dcef or 5-53206a655f?
since 2-e6bd07dcef or 5-53206a655f do not belong to a specif container process, the common way of ln -s /proc/$pid/ns/net /var/run/netns doesnot work. so i have no idea to how to reach it. can you provide some help?
The namespaces marked with x-{id} represents network namespace managed by the overlay network driver for its operation (such as creating a bridge, terminating vxlan tunnel, etcā¦). They donāt represent the container network namespace. Since it is managed by the driver, it is not recommended to manipulate anything within this namespace. But if you are curious on the deep dive, then you can use the ānsenterā tool to understand more about this internal namespace.
Example : nsenter -net=/var/run/docker/netns/2-e6bd07dcef ifconfig
thanks for the information. but seems it does not work for this case, nsenter always response as below:
root@ubuntu1:~# nsenter --net=/var/run/docker/netns/1-53206a655f ifconfig
nsenter: reassociate to namespace āns/netā failed: Invalid argument