From patchwork Fri Jun 10 21:00:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16366 X-Patchwork-Delegate: mareklindner@neomailbox.ch Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 4F8B981D0F; Fri, 10 Jun 2016 23:01:16 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=r6R+kQbT; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id 09A9081D00 for ; Fri, 10 Jun 2016 23:01:09 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593C08A003E970EFFFEBFF563.dip0.t-ipconnect.de [IPv6:2003:c5:93c0:8a00:3e97:eff:febf:f563]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 6411D1C8001; Fri, 10 Jun 2016 23:01:09 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1465592469; bh=B1uiHz7k/vLqiIYap+JNm6kqXJfoiwgNWUYk6ye0Yck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r6R+kQbTWVCSDHYgN3pxttc3vLGOdDph07AW1w10DbbP6OGe9cnO5sehBiY/hbwSa FKRgk3R3LNagzo0y2v8Kinr/yewQCOegmM5rMUbyOykXXN8PfOmiiHhwWA0e7jYUX1 0dwG+bGASnBkgSPTojVciNTJ8f/nquoqiOf1edsM= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Fri, 10 Jun 2016 23:00:56 +0200 Message-Id: <1465592459-9474-2-git-send-email-sven@narfation.org> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1465592459-9474-1-git-send-email-sven@narfation.org> References: <1465592459-9474-1-git-send-email-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH v4 2/5] batman-adv: Use rtnl link in device creation example X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" 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 --- 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