public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
* Move an interface to init_ne
@ 2012-11-28 14:39 David Shwatrz
  2012-11-28 15:01 ` Renato Westphal
  0 siblings, 1 reply; 4+ messages in thread
From: David Shwatrz @ 2012-11-28 14:39 UTC (permalink / raw)
  To: netdev; +Cc: Eric W. Biederman

Hello,

How to I move an interface back to the original namespace ?
I created three namespaces:

ip netns add namespace1
ip netns add namespace2
ip netns add namespace3

And move eth0 to namespace1:
ip link set  eth0 netns namespace1

How do I return it back to the original, default network namespace ? (init_net)

	
Regards,
DS

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Move an interface to init_ne
  2012-11-28 14:39 Move an interface to init_ne David Shwatrz
@ 2012-11-28 15:01 ` Renato Westphal
  2012-11-28 15:31   ` David Shwatrz
  0 siblings, 1 reply; 4+ messages in thread
From: Renato Westphal @ 2012-11-28 15:01 UTC (permalink / raw)
  To: David Shwatrz; +Cc: netdev, Eric W. Biederman

2012/11/28 David Shwatrz <dshwatrz@gmail•com>:
> Hello,
>
> How to I move an interface back to the original namespace ?
> I created three namespaces:
>
> ip netns add namespace1
> ip netns add namespace2
> ip netns add namespace3
>
> And move eth0 to namespace1:
> ip link set  eth0 netns namespace1
>
> How do I return it back to the original, default network namespace ? (init_net)

# ip link set eth0 netns 1

The 'netns' argument can be either a netns name or a process ID (pid).
Providing a pid, you'll be moving the interface to the netns of the
given process, which is the initial network namespace for pid = 1 (the
init process).

-- 
Renato Westphal

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Move an interface to init_ne
  2012-11-28 15:01 ` Renato Westphal
@ 2012-11-28 15:31   ` David Shwatrz
  2012-11-28 16:28     ` Eric W. Biederman
  0 siblings, 1 reply; 4+ messages in thread
From: David Shwatrz @ 2012-11-28 15:31 UTC (permalink / raw)
  To: Renato Westphal; +Cc: netdev, Eric W. Biederman

Renato,

Thanks a lot!

I have an additional question if I may on network namespaces.

I have a machine with two different nics, with two different drivers,
r8169 and 8139too (both RealTek nics).
I have eth0 on the  initial network namespace and
no interface on namespace1. (8139too module is not loaded).

But when I run "modprobe 8139too" on namespace1, a device named "eth1"
is created on the initial network namespace and not on namesapce1.
I expected that in such a case, a device named "eth0" will be created
on namespace1, since it was called from namespace1. Or maybe modprobe
does
not consider the namespace from which it was called ?

regards,
DS

On Wed, Nov 28, 2012 at 5:01 PM, Renato Westphal
<renatowestphal@gmail•com> wrote:
> initial network namespace

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Move an interface to init_ne
  2012-11-28 15:31   ` David Shwatrz
@ 2012-11-28 16:28     ` Eric W. Biederman
  0 siblings, 0 replies; 4+ messages in thread
From: Eric W. Biederman @ 2012-11-28 16:28 UTC (permalink / raw)
  To: David Shwatrz; +Cc: Renato Westphal, netdev

David Shwatrz <dshwatrz@gmail•com> writes:

> But when I run "modprobe 8139too" on namespace1, a device named "eth1"
> is created on the initial network namespace and not on namesapce1.
> I expected that in such a case, a device named "eth0" will be created
> on namespace1, since it was called from namespace1. Or maybe modprobe
> does
> not consider the namespace from which it was called ?

modprobe has no concept of the namespace from which it was called.

Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-28 16:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-28 14:39 Move an interface to init_ne David Shwatrz
2012-11-28 15:01 ` Renato Westphal
2012-11-28 15:31   ` David Shwatrz
2012-11-28 16:28     ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox