public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Antonio Quartulli <a@unstable.cc>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH] batctl: Add support for network namespaces
Date: Fri, 29 Jan 2016 04:01:40 +0100	[thread overview]
Message-ID: <20160129030140.GD12692@lunn.ch> (raw)
In-Reply-To: <20160128040638.GE22112@prodigo.lan>

On Thu, Jan 28, 2016 at 12:06:38PM +0800, Antonio Quartulli wrote:
> On Thu, Jan 28, 2016 at 04:54:19AM +0100, Andrew Lunn wrote:
> > When running within a network namespace, access to files within
> > debugfs have to take into account the network name space. Each
> > namespace has its own directory under
> > /sys/kernel/debug/batman_adv/netns.
> 
> Thanks for providing the batctl patch Andrew.
> 
> What do you think about documenting this feature in the README file as well?
> Imho a few words in the "How does it work?" section plus an example on how to
> use it would be really nice!

Yes, i can do that. Here is a little example for three nodes which i
used for testing.

     Andrew

EMU1="ip netns exec emu1"
EMU2="ip netns exec emu2"

ip netns add emu1
ip netns add emu2

ip link add emu1-veth1 type veth peer name emu2-veth1
ip link set emu1-veth1 netns emu1
ip link set emu2-veth1 netns emu2

$EMU1 ip link set emu1-veth1 name veth1
$EMU2 ip link set emu2-veth1 name veth1

$EMU1 ip link set veth1 up
$EMU2 ip link set veth1 up

ip link add emu1-veth2 type veth peer name veth2
ip link set emu1-veth2 netns emu1
$EMU1 ip link set emu1-veth2 name veth2

$EMU1 ip link set veth2 up
ip link set veth2 up

$EMU1 batctl if add veth1
$EMU1 batctl if add veth2
$EMU1 ip link set bat0 up

$EMU2 batctl if add veth1
$EMU2 ip link set bat0 up

batctl if add veth2
ip link set bat0 up

# Give DAD time to complete
echo Waiting for DAD
sleep 4

($EMU1 alfred -m -i bat0 -u /var/run/emu1-alfred.soc) &
($EMU2 alfred -m -i bat0 -u /var/run/emu2-alfred.soc) &
alfred -m -i bat0 &

sleep 1

($EMU1 batadv-vis -s -u /var/run/emu1-alfred.soc) &
($EMU2 batadv-vis -s -u /var/run/emu2-alfred.soc) &
batadv-vis -s &

      reply	other threads:[~2016-01-29  3:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28  3:54 [B.A.T.M.A.N.] [PATCH] batctl: Add support for network namespaces Andrew Lunn
2016-01-28  4:06 ` Antonio Quartulli
2016-01-29  3:01   ` Andrew Lunn [this message]

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=20160129030140.GD12692@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=a@unstable.cc \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox