-
Notifications
You must be signed in to change notification settings - Fork 21
Accessing the default network namespace
If there are no network interfaces configured in the default (root) network namespace, we can't get to that network namespace via ssh
, and we can't switch to it using the ip netns exec <network_namespace>
command since the default network namespace has no name.
A workaround is to do the following:
-
create a name for the default network namespace, e.g. 'default'
sudo ln -s /proc/1/ns/net /var/run/netns/default
now it shows up in the list of network namespaces:
pi@netperf:~ $ ip netns default ns_wlan0 ns_enxb827eb16f253 bwmonitor
-
now we can switch to the default network namespace:
sudo ip netns exec default sudo -H -u pi bash
view the network namespace our shell is now in:
ip netns identify $$
The output should be an empty line; this means that we're in the default (root) network namespace.
Installation Guide
Additional Information