From: Simon Wunderlich <sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org> To: davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r@public.gmane.org, Marek Lindner <mareklindner-rVWd3aGhH2z5bpWLKbzFeg@public.gmane.org> Subject: [PATCH 04/19] batman-adv: Use rtnl link in device creation example Date: Fri, 12 Aug 2016 10:56:40 +0200 [thread overview] Message-ID: <1470992215-11009-5-git-send-email-sw@simonwunderlich.de> (raw) In-Reply-To: <1470992215-11009-1-git-send-email-sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org> From: Sven Eckelmann <sven-KaDOiPu9UxWEi8DpZVb4nw@public.gmane.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-KaDOiPu9UxWEi8DpZVb4nw@public.gmane.org> Signed-off-by: Marek Lindner <mareklindner-rVWd3aGhH2z5bpWLKbzFeg@public.gmane.org> Signed-off-by: Simon Wunderlich <sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org> --- 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
WARNING: multiple messages have this Message-ID (diff)
From: Simon Wunderlich <sw@simonwunderlich.de> To: davem@davemloft.net Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Marek Lindner <mareklindner@neomailbox.ch> Subject: [B.A.T.M.A.N.] [PATCH 04/19] batman-adv: Use rtnl link in device creation example Date: Fri, 12 Aug 2016 10:56:40 +0200 [thread overview] Message-ID: <1470992215-11009-5-git-send-email-sw@simonwunderlich.de> (raw) In-Reply-To: <1470992215-11009-1-git-send-email-sw@simonwunderlich.de> From: Sven Eckelmann <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> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> --- 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-08-12 8:56 UTC|newest] Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-08-12 8:56 [PATCH 00/19] pull request for net-next: batman-adv 2016-08-12 Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 02/19] batman-adv: Document optional batadv_algo_ops Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 05/19] batman-adv: Modify mesh_iface outside sysfs context Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich [not found] ` <1470992215-11009-1-git-send-email-sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org> 2016-08-12 8:56 ` [PATCH 01/19] batman-adv: Start new development cycle Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 03/19] batman-adv: Define module rtnl link name Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` Simon Wunderlich [this message] 2016-08-12 8:56 ` [B.A.T.M.A.N.] [PATCH 04/19] batman-adv: Use rtnl link in device creation example Simon Wunderlich 2016-08-12 8:56 ` [PATCH 06/19] batman-adv: Revert "postpone sysfs removal when unregistering" Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 07/19] batman-adv: Avoid sysfs name collision for netns moves Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 08/19] batman-adv: Remove unused primary_if and bat_priv variables Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 09/19] batman-adv: make the GW selection class algorithm specific Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 10/19] batman-adv: make GW election code protocol specific Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 11/19] batman-adv: B.A.T.M.A.N. V - implement GW selection logic Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-13 3:56 ` [PATCH 00/19] pull request for net-next: batman-adv 2016-08-12 David Miller 2016-08-13 3:56 ` [B.A.T.M.A.N.] " David Miller 2016-08-12 8:56 ` [PATCH 12/19] batman-adv: disable sysfs knobs when GW-mode is not implemented Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 13/19] batman-adv: iv_ogm, Reduce code duplication Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 14/19] batman-adv: fix boolreturn.cocci warnings Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 15/19] batman-adv: Introduce forward packet creation helper Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 16/19] batman-adv: use kmem_cache for translation table Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 17/19] batman-adv: Remove orig_node reference handling from send_skb_unicast Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 18/19] batman-adv: Use bitwise instead of arithmetic operator for flags Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich 2016-08-12 8:56 ` [PATCH 19/19] batman-adv: Fix consistency of update route messages Simon Wunderlich 2016-08-12 8:56 ` [B.A.T.M.A.N.] " Simon Wunderlich
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=1470992215-11009-5-git-send-email-sw@simonwunderlich.de \ --to=sw-2yrnx6ruihyiy0qsoawiaoquadtiucjx@public.gmane.org \ --cc=b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r@public.gmane.org \ --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \ --cc=mareklindner-rVWd3aGhH2z5bpWLKbzFeg@public.gmane.org \ --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.