All of lore.kernel.org
 help / color / mirror / Atom feed
* Request to enable setting the nested network namespace
@ 2018-06-14  8:04 Pamela Mei
  2018-06-14  9:27 ` Jiri Pirko
  0 siblings, 1 reply; 3+ messages in thread
From: Pamela Mei @ 2018-06-14  8:04 UTC (permalink / raw)
  To: netdev

In linux, set up 2 network namespaces, ns1 and ns2. "ip netns list"
can view the 2 network namespaces.
Move one network device from linux root namespace to ns1 then from ns1
to ns2, then delete ns2,
expect that network device can move back to ns1,
but actual result is that eth1 is back to linux root network
namespace. I'm not sure whether it's as expected.

Here is the detail test steps:

1.ip netns add ns1

2.ip netns add ns2

3.ip link set eth1 netns ns1

4.ip netns exec ns1 ip link set eth1 netns ns2

5.ip netns del ns2

Expected result: eth1 will be in ns1

Actual result: eth1 is back in linux root namespace 1

Question: is there any method to realize such scenario to make sure
device can be back to ns1 not linux root network namespace 1?

How about if there's a function to enable nest network namespace e.g.
can set ns1 as the parent namespace of ns2, then device can return to
ns1 when ns2 is gone.


Cheers,

Pamela MEI

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

* Re: Request to enable setting the nested network namespace
  2018-06-14  8:04 Request to enable setting the nested network namespace Pamela Mei
@ 2018-06-14  9:27 ` Jiri Pirko
  2018-06-26  9:10   ` Pamela Mei
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Pirko @ 2018-06-14  9:27 UTC (permalink / raw)
  To: Pamela Mei; +Cc: netdev

Thu, Jun 14, 2018 at 10:04:57AM CEST, pamela.mei@gmail.com wrote:
>In linux, set up 2 network namespaces, ns1 and ns2. "ip netns list"
>can view the 2 network namespaces.
>Move one network device from linux root namespace to ns1 then from ns1
>to ns2, then delete ns2,
>expect that network device can move back to ns1,
>but actual result is that eth1 is back to linux root network
>namespace. I'm not sure whether it's as expected.
>
>Here is the detail test steps:
>
>1.ip netns add ns1
>
>2.ip netns add ns2
>
>3.ip link set eth1 netns ns1
>
>4.ip netns exec ns1 ip link set eth1 netns ns2
>
>5.ip netns del ns2
>
>Expected result: eth1 will be in ns1
>
>Actual result: eth1 is back in linux root namespace 1
>
>Question: is there any method to realize such scenario to make sure
>device can be back to ns1 not linux root network namespace 1?
>
>How about if there's a function to enable nest network namespace e.g.
>can set ns1 as the parent namespace of ns2, then device can return to
>ns1 when ns2 is gone.

You would have to track the whole history of netns changes for each
netdevice. That does not sound right. Move back to initial netns seems
correct to me.


>
>
>Cheers,
>
>Pamela MEI

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

* Re: Request to enable setting the nested network namespace
  2018-06-14  9:27 ` Jiri Pirko
@ 2018-06-26  9:10   ` Pamela Mei
  0 siblings, 0 replies; 3+ messages in thread
From: Pamela Mei @ 2018-06-26  9:10 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: netdev

I don't mean to track the whole history of netns changes as mandatory.
I mean it's better to have an option to ask user to set the new parent
of the child netns, not only the initial one.
Is there any technical bottle neck on this request?

Cheers,
Pamela MEI

On Thu, Jun 14, 2018 at 5:27 PM, Jiri Pirko <jiri@resnulli.us> wrote:
> Thu, Jun 14, 2018 at 10:04:57AM CEST, pamela.mei@gmail.com wrote:
>>In linux, set up 2 network namespaces, ns1 and ns2. "ip netns list"
>>can view the 2 network namespaces.
>>Move one network device from linux root namespace to ns1 then from ns1
>>to ns2, then delete ns2,
>>expect that network device can move back to ns1,
>>but actual result is that eth1 is back to linux root network
>>namespace. I'm not sure whether it's as expected.
>>
>>Here is the detail test steps:
>>
>>1.ip netns add ns1
>>
>>2.ip netns add ns2
>>
>>3.ip link set eth1 netns ns1
>>
>>4.ip netns exec ns1 ip link set eth1 netns ns2
>>
>>5.ip netns del ns2
>>
>>Expected result: eth1 will be in ns1
>>
>>Actual result: eth1 is back in linux root namespace 1
>>
>>Question: is there any method to realize such scenario to make sure
>>device can be back to ns1 not linux root network namespace 1?
>>
>>How about if there's a function to enable nest network namespace e.g.
>>can set ns1 as the parent namespace of ns2, then device can return to
>>ns1 when ns2 is gone.
>
> You would have to track the whole history of netns changes for each
> netdevice. That does not sound right. Move back to initial netns seems
> correct to me.
>
>
>>
>>
>>Cheers,
>>
>>Pamela MEI

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

end of thread, other threads:[~2018-06-26  9:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-14  8:04 Request to enable setting the nested network namespace Pamela Mei
2018-06-14  9:27 ` Jiri Pirko
2018-06-26  9:10   ` Pamela Mei

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.