From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH v4 2/5] batman-adv: Use rtnl link in device creation example
Date: Fri, 10 Jun 2016 23:00:56 +0200 [thread overview]
Message-ID: <1465592459-9474-2-git-send-email-sven@narfation.org> (raw)
In-Reply-To: <1465592459-9474-1-git-send-email-sven@narfation.org>
The standard kernel API to add new virtual interfaces and attach other
interfaces to it is rtnl-link. batman-adv supports it since v3.10. This
functionality should be used instead of the legacy batman-adv-only sysfs
interface.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
v4:
- rebase on top of current master
v3:
- rebased on top of current master to fix conflicts with newest patches
v2:
- rebased on top of current master to fix conflicts with newest patches
---
Documentation/networking/batman-adv.txt | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/Documentation/networking/batman-adv.txt b/Documentation/networking/batman-adv.txt
index 1b5e7a7..8a8d3d9 100644
--- a/Documentation/networking/batman-adv.txt
+++ b/Documentation/networking/batman-adv.txt
@@ -43,10 +43,15 @@ new interfaces to verify the compatibility. There is no need to
reload the module if you plug your USB wifi adapter into your ma-
chine after batman advanced was initially loaded.
-To activate a given interface simply write "bat0" into its
-"mesh_iface" file inside the batman_adv subfolder:
+The batman-adv soft-interface can be created using the iproute2
+tool "ip"
-# echo bat0 > /sys/class/net/eth0/batman_adv/mesh_iface
+# ip link add name bat0 type batadv
+
+To activate a given interface simply attach it to the "bat0"
+interface
+
+# ip link set dev eth0 master bat0
Repeat this step for all interfaces you wish to add. Now batman
starts using/broadcasting on this/these interface(s).
@@ -56,10 +61,10 @@ By reading the "iface_status" file you can check its status:
# cat /sys/class/net/eth0/batman_adv/iface_status
# active
-To deactivate an interface you have to write "none" into its
-"mesh_iface" file:
+To deactivate an interface you have to detach it from the
+"bat0" interface:
-# echo none > /sys/class/net/eth0/batman_adv/mesh_iface
+# ip link set dev eth0 nomaster
All mesh wide settings can be found in batman's own interface
--
2.8.1
next prev parent reply other threads:[~2016-06-10 21:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-10 21:00 [B.A.T.M.A.N.] [PATCH v4 1/5] batman-adv: Define module rtnl link name Sven Eckelmann
2016-06-10 21:00 ` Sven Eckelmann [this message]
2016-06-13 4:46 ` [B.A.T.M.A.N.] [PATCH v4 2/5] batman-adv: Use rtnl link in device creation example Marek Lindner
2016-06-10 21:00 ` [B.A.T.M.A.N.] [PATCH v4 3/5] batman-adv: Modify mesh_iface outside sysfs context Sven Eckelmann
2016-06-10 21:00 ` [B.A.T.M.A.N.] [PATCH v4 4/5] batman-adv: Revert "postpone sysfs removal when unregistering" Sven Eckelmann
2016-06-10 21:00 ` [B.A.T.M.A.N.] [PATCH v4 5/5] batman-adv: Avoid sysfs name collision for netns moves Sven Eckelmann
2016-06-13 4:45 ` [B.A.T.M.A.N.] [PATCH v4 1/5] batman-adv: Define module rtnl link name Marek Lindner
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=1465592459-9474-2-git-send-email-sven@narfation.org \
--to=sven@narfation.org \
--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