How to switch user-space process back to the root network namespace?
-
13-12-2019 - |
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)
Solution
AFAIU, you can use /proc/<pid>/ns/net
.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow