문제

Using clone() or unshare(), we can create a network namespace. Just as the command:

ns_exec -nm -- /bin/bash

(see http://lxc.sourceforge.net/index.php/about/kernel-namespaces/network/configuration/)

If I have created several network namespaces with ns_exec command, where can I see them? or How can i count the numbers of network namespaces?

도움이 되었습니까?

해결책

You observe them indirectly. Say, lo devices are independent, iptables rules are independent and so on.

netns objects live in it's own kmem_cache: grep net_namespace /proc/slabinfo

But this is unreliable way to count them, as SLUB can share caches.

There is no /proc file or something dedicated specifically as netns counter.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top