All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Peter Fassberg <pf@leissner.se>, netdev@vger.kernel.org
Subject: Re: Default network namespace name
Date: Wed, 21 May 2014 11:44:13 +0200	[thread overview]
Message-ID: <537C756D.4070407@6wind.com> (raw)
In-Reply-To: <alpine.BSF.2.00.1405210826570.47766@nic-i.leissner.se>

Le 21/05/2014 08:36, Peter Fassberg a écrit :
>
> Hi!
>
> Is there a name of the default network namespace?
No.

>
> I would like to execute a command in the default network namespace while running
> a shell in a non-default namespace.
>
> Like this: ip netns exec "" ip link
> Or this:   ip netns exec . ip link
>
> That command end up with a mis-spelled error message: :)
> seting the network namespace "" failed: Invalid argument

You can try something like this (I suppose that init runs in your
"default network namespace") :

ip netns add foo (just to create /var/run/netns which is a tmpfs)
ip netns del foo
touch /var/run/netns/default
mount --bind /proc/1/ns/net /var/run/netns/default
ip netns exec default ip link

Regards,
Nicolas

  reply	other threads:[~2014-05-21  9:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21  6:36 Default network namespace name Peter Fassberg
2014-05-21  9:44 ` Nicolas Dichtel [this message]
2014-05-21 16:43 ` Cong Wang
2014-05-21 16:51 ` Rami Rosen
2014-05-21 17:21   ` Peter Fassberg
2014-05-21 17:29     ` Cong Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=537C756D.4070407@6wind.com \
    --to=nicolas.dichtel@6wind.com \
    --cc=netdev@vger.kernel.org \
    --cc=pf@leissner.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.