2

I wonder why we can't see the namespaces created by lxc-create on the output of "ip netns list" For example I create a namespace like below

lxc-create -t download -n cont1 -- -d ubuntu -r trusty -a amd64

I don't see this on "ip netns list" however if I add a namespace myself,

root@lin:~# ip netns add test

root@lin:~# ip netns list
test

it is visible.

containers use namespaces but here namespaces created lxc-create are hidden from admin user? Is there any way to list them via ip netns?

Thanks.

  • Try the lsns command instead of ip netns list. – ʇsәɹoɈ Jun 1 '19 at 9:29
0

The ip netns list command displays only namespaces that have been named, by virtue of a corresponding file in /var/run/netns/. Network namespaces can be created without names, though, and are referenced by a file descriptor. (The ip-netns (8) man page mentions this.)

I believe lxc uses unnamed network namespaces. To see them, start a container and run lsns -t net .

-1

You cannot see LXC namespaces using ip netns.

LXCs use a different LXC can be listed by using

% sudo lxc-ls -f

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.