All of lore.kernel.org
 help / color / mirror / Atom feed
* How to move wpan interface to another interface?
@ 2016-05-09 22:57 Guangyu Pei
  2016-05-10  5:44 ` Alexander Aring
  0 siblings, 1 reply; 2+ messages in thread
From: Guangyu Pei @ 2016-05-09 22:57 UTC (permalink / raw)
  To: linux-wpan

Hi,

Command “ip link set wpan0 netns pid” returns “RTNETLINK answers: Invalid argument”. For 802.11, we have “iw phy phy1 set netns pid”. But for iwpan, it seems that there is no such option. I need to run some experiments with fakelb driver and hope that I can move wpan devices to different network namespaces.

Would you please let me know whether there is a workaround or I miss anything?

Thanks,

Gary

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

* Re: How to move wpan interface to another interface?
  2016-05-09 22:57 How to move wpan interface to another interface? Guangyu Pei
@ 2016-05-10  5:44 ` Alexander Aring
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Aring @ 2016-05-10  5:44 UTC (permalink / raw)
  To: Guangyu Pei, linux-wpan


Hi,

On 05/10/2016 12:57 AM, Guangyu Pei wrote:
> Hi,
> 
> Command “ip link set wpan0 netns pid” returns “RTNETLINK answers: Invalid argument”. For 802.11, we have “iw phy phy1 set netns pid”. But for iwpan, it seems that there is no such option. I need to run some experiments with fakelb driver and hope that I can move wpan devices to different network namespaces.
> 
> Would you please let me know whether there is a workaround or I miss anything?
> 

Netns support doesn't exist mainline now, but I have patches.

I created them where bluetooth-next was behind net-next for netlink u64
pad patches. I need to clean them up and send them mainline.

kernel:

https://github.com/linux-wpan/linux-wpan-next/commits/netns

wpan-tools:

https://github.com/linux-wpan/wpan-tools/commits/netns

the hwsim starting script from website (updated):

---

#!/bin/sh

# we need some Private Area Network ID
panid="0xbeef"
# number of nodes
numnodes=6

# include the kernel module for a fake node, tell it to create six
# nodes
modprobe fakelb numlbs=$numnodes

# initialize all the nodes
for i in $(seq 0 `expr $numnodes - 1`);
do
	ip netns delete wpan${i}
	ip netns add wpan${i}
	PHYNUM=`iwpan dev | grep -B 1 wpan${i} | sed -ne '1 s/phy#\([0-9]\)/\1/p'`
	iwpan phy${PHYNUM} set netns name wpan${i}

	ip netns exec wpan${i} iwpan dev wpan${i} set pan_id 0xbeef
	ip netns exec wpan${i} ip link add link wpan${i} name lowpan${i} type lowpan
	ip netns exec wpan${i} ip link set wpan${i} up
	ip netns exec wpan${i} ip link set lowpan${i} up
done

---

creates 6 phys and 6 wpan interfaces with a lowpan interface, each
of them in his own net namespace.

btw: I want to mark fakelb deprecated and add a new implementation of
fakelb with the name "mac802154_hwsim", I hate it when I told about the
"fakelb" driver and wireless people told me "do you know hwsim...". It's
simple the same stuff but somebody named the stuff completely different
which makes no sense.

I also don't know if we really should add the netns support flag for
wpan-phy's. This is for HardMAC transceivers only, there exists one
outside but we currently support SoftMAC transceivers currently only.
:-)

I hope I could help you and now I try to bring these patches mainline
since already people want to do experiment like me which is great!

- Alex

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

end of thread, other threads:[~2016-05-10  5:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-09 22:57 How to move wpan interface to another interface? Guangyu Pei
2016-05-10  5:44 ` Alexander Aring

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.