Question

The problem is that /var/run/netns/ directory contains all the network namespaces, except the root namespace. So I am not sure, how to get the fd, that should be passed to the following kernel call:

syscall(__NR_setns, fd, CLONE_NEWNET)
Was it helpful?

Solution

AFAIU, you can use /proc/<pid>/ns/net.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top