linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* wireless network interfaces and network namespaces
@ 2013-11-30 12:12 Kevin Wilson
  2013-11-30 12:45 ` Sergey Ryazanov
  2013-11-30 13:14 ` Johannes Berg
  0 siblings, 2 replies; 9+ messages in thread
From: Kevin Wilson @ 2013-11-30 12:12 UTC (permalink / raw)
  To: linux-wireless

Hello,
I am trying to move a wireless interface to a network namespace I
created and I get an error:

ip link set wlan0 netns ns1
RTNETLINK answers: Invalid argument

I do it with latest iproute2 git sources,  on 3.8 kernel.

I want to verify this: all wireless interfaces do no support
network namespace. Is this true ? what in fact is the reason for this ?

regards,
Kevin

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

* Re: wireless network interfaces and network namespaces
  2013-11-30 12:12 wireless network interfaces and network namespaces Kevin Wilson
@ 2013-11-30 12:45 ` Sergey Ryazanov
  2013-11-30 13:14 ` Johannes Berg
  1 sibling, 0 replies; 9+ messages in thread
From: Sergey Ryazanov @ 2013-11-30 12:45 UTC (permalink / raw)
  To: Kevin Wilson; +Cc: linux-wireless

Hi,

2013/11/30 Kevin Wilson <wkevils@gmail.com>:
> I want to verify this: all wireless interfaces do no support
> network namespace. Is this true ? what in fact is the reason for this ?
>
Yes it is. You may use couple of virtual ethernet interfaces and
bridge to carry traffic between the process that is isolated in
separate namespace and a wireless interface.

--
BR,
Sergey

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

* Re: wireless network interfaces and network namespaces
  2013-11-30 12:12 wireless network interfaces and network namespaces Kevin Wilson
  2013-11-30 12:45 ` Sergey Ryazanov
@ 2013-11-30 13:14 ` Johannes Berg
  2013-11-30 13:36   ` Sergey Ryazanov
  2013-11-30 13:58   ` Kevin Wilson
  1 sibling, 2 replies; 9+ messages in thread
From: Johannes Berg @ 2013-11-30 13:14 UTC (permalink / raw)
  To: Kevin Wilson; +Cc: linux-wireless

On Sat, 2013-11-30 at 14:12 +0200, Kevin Wilson wrote:
> Hello,
> I am trying to move a wireless interface to a network namespace I
> created and I get an error:
> 
> ip link set wlan0 netns ns1
> RTNETLINK answers: Invalid argument
> 
> I do it with latest iproute2 git sources,  on 3.8 kernel.
> 
> I want to verify this: all wireless interfaces do no support
> network namespace. Is this true ? what in fact is the reason for this ?

At least mac80211-based wireless interfaces *do* support namespaces, but
you have to change the entire wireless NIC's namespace using iw --
having different virtual interfaces of the same NIC in different
namespaces is not supported.

johannes


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

* Re: wireless network interfaces and network namespaces
  2013-11-30 13:14 ` Johannes Berg
@ 2013-11-30 13:36   ` Sergey Ryazanov
  2013-11-30 13:57     ` Johannes Berg
  2013-11-30 13:58   ` Kevin Wilson
  1 sibling, 1 reply; 9+ messages in thread
From: Sergey Ryazanov @ 2013-11-30 13:36 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Kevin Wilson, linux-wireless

2013/11/30 Johannes Berg <johannes@sipsolutions.net>:
> having different virtual interfaces of the same NIC in different
> namespaces is not supported.
>
Is this rule applicable to hwsim interfaces too?

-- 
BR,
Sergey

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

* Re: wireless network interfaces and network namespaces
  2013-11-30 13:36   ` Sergey Ryazanov
@ 2013-11-30 13:57     ` Johannes Berg
  0 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2013-11-30 13:57 UTC (permalink / raw)
  To: Sergey Ryazanov; +Cc: Kevin Wilson, linux-wireless



Sergey Ryazanov <ryazanov.s.a@gmail.com> wrote:
>2013/11/30 Johannes Berg <johannes@sipsolutions.net>:
>> having different virtual interfaces of the same NIC in different
>> namespaces is not supported.
>>
>Is this rule applicable to hwsim interfaces too?

Yes. Hwsim should work with namespaces.

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

* Re: wireless network interfaces and network namespaces
  2013-11-30 13:14 ` Johannes Berg
  2013-11-30 13:36   ` Sergey Ryazanov
@ 2013-11-30 13:58   ` Kevin Wilson
  2013-11-30 19:35     ` Johannes Berg
  1 sibling, 1 reply; 9+ messages in thread
From: Kevin Wilson @ 2013-11-30 13:58 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

Thanks!
Running:
iw phy phy0 set netns 3433
indeed moved wlan0 to the network namespace I created, where process 3433 ran.
I did not see a way to specify the network namespace name for moving
wlan0 in this command (at least iw help does not show it and  I am
using iw 3.4-1 on ubuntu). I did not looked into the source code of iw
though.




On Sat, Nov 30, 2013 at 3:14 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Sat, 2013-11-30 at 14:12 +0200, Kevin Wilson wrote:
>> Hello,
>> I am trying to move a wireless interface to a network namespace I
>> created and I get an error:
>>
>> ip link set wlan0 netns ns1
>> RTNETLINK answers: Invalid argument
>>
>> I do it with latest iproute2 git sources,  on 3.8 kernel.
>>
>> I want to verify this: all wireless interfaces do no support
>> network namespace. Is this true ? what in fact is the reason for this ?
>
> At least mac80211-based wireless interfaces *do* support namespaces, but
> you have to change the entire wireless NIC's namespace using iw --
> having different virtual interfaces of the same NIC in different
> namespaces is not supported.
>
> johannes
>

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

* Re: wireless network interfaces and network namespaces
  2013-11-30 13:58   ` Kevin Wilson
@ 2013-11-30 19:35     ` Johannes Berg
  2014-05-22  8:54       ` Hannes Raddatz
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2013-11-30 19:35 UTC (permalink / raw)
  To: Kevin Wilson; +Cc: linux-wireless

On Sat, 2013-11-30 at 15:58 +0200, Kevin Wilson wrote:
> Thanks!
> Running:
> iw phy phy0 set netns 3433
> indeed moved wlan0 to the network namespace I created, where process 3433 ran.
> I did not see a way to specify the network namespace name for moving
> wlan0 in this command (at least iw help does not show it and  I am
> using iw 3.4-1 on ubuntu). I did not looked into the source code of iw
> though.

No, that's not supported since all virtual interfaces (e.g. wlan0)
belonging to a device (e.g. phy0) must move namespaces together.
Otherwise you could do

iw wlan0 interface add wlan0b type managed

and then try to move wlan0 while wlan0b stays in the namespace. In
theory that might actually be useful given appropriate resource
reservation and multi-interface/multi-channel capable devices, but it
would require a massive effort to get it right - it's not useful
enough ;)

johannes


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

* Re: wireless network interfaces and network namespaces
  2013-11-30 19:35     ` Johannes Berg
@ 2014-05-22  8:54       ` Hannes Raddatz
  2014-05-22 10:46         ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Hannes Raddatz @ 2014-05-22  8:54 UTC (permalink / raw)
  To: linux-wireless

I would like to dig this thread out, 
because there might be a bug regarding this topic.

Using ubuntu 12.10, the move of virtual wirless devices (hwsim) to a 
namespace and 
configuring them inside the namespace with iw wasn't a problem. 
But since ubuntu 14.04 I can't 
access the devices inside the namespace with iw.
The same problem occurs while using 
ubuntu 12.10 with newest backports installed.
Has something changed with the namespaces in 
the new linux kernels or is it a bug?

br,
Hannes


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

* Re: wireless network interfaces and network namespaces
  2014-05-22  8:54       ` Hannes Raddatz
@ 2014-05-22 10:46         ` Johannes Berg
  0 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2014-05-22 10:46 UTC (permalink / raw)
  To: Hannes Raddatz; +Cc: linux-wireless

On Thu, 2014-05-22 at 08:54 +0000, Hannes Raddatz wrote:
> I would like to dig this thread out, 
> because there might be a bug regarding this topic.
> 
> Using ubuntu 12.10, the move of virtual wirless devices (hwsim) to a 
> namespace and 
> configuring them inside the namespace with iw wasn't a problem. 
> But since ubuntu 14.04 I can't 
> access the devices inside the namespace with iw.
> The same problem occurs while using 
> ubuntu 12.10 with newest backports installed.
> Has something changed with the namespaces in 
> the new linux kernels or is it a bug?

No idea. Works fine for me on kernel 3.14+mac80211-next.

johannes


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

end of thread, other threads:[~2014-05-22 10:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-30 12:12 wireless network interfaces and network namespaces Kevin Wilson
2013-11-30 12:45 ` Sergey Ryazanov
2013-11-30 13:14 ` Johannes Berg
2013-11-30 13:36   ` Sergey Ryazanov
2013-11-30 13:57     ` Johannes Berg
2013-11-30 13:58   ` Kevin Wilson
2013-11-30 19:35     ` Johannes Berg
2014-05-22  8:54       ` Hannes Raddatz
2014-05-22 10:46         ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).