From patchwork Sat Oct 31 03:05:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yousong Zhou X-Patchwork-Id: 538587 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2339B140D24 for ; Sat, 31 Oct 2015 14:09:02 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=etX3Mcjy; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 27B8828BFD9; Sat, 31 Oct 2015 04:04:32 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id DD9C128BFB6 for ; Sat, 31 Oct 2015 04:04:09 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -8.5 Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 31 Oct 2015 04:04:01 +0100 (CET) Received: by padhy1 with SMTP id hy1so84670048pad.0 for ; Fri, 30 Oct 2015 20:05:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=M0tnJqMqrq2ke2ol/jnW0ZGk6OjhvexJZFw/zgfRLqs=; b=etX3McjyeBW5qXLhIInAPqejIsRtwvN55ICW6q1HHLhQnwK4p0TavFGLv7EhGC00sW i26M/dbN/GeSt5ilivHBvPdQCJWXp4rmg87io/2sdqpjXcdDZDx6Bggq7iU0gRy2PdxU E/NMXaPjAg5EKNXUaJ7GjO/eQZSo+gVxufrYSReszXj1+JZJu4sp6uZHcTsw1kf4ROhR qOc+iziMXr48Pt7a1P6gg9I246mzEAn4vDgIbWFFHl40SfSrOY133AvS5hQr8A3MvUW4 dgIC0I9XLREFWKG0MH6hBEbhHrK/FlGAm4JLDQkBRX2ViYGX4QjdRDeOAtoDJiBKJV8h hyzw== X-Received: by 10.66.181.234 with SMTP id dz10mr12501759pac.51.1446260745315; Fri, 30 Oct 2015 20:05:45 -0700 (PDT) Received: from debian.corp.sankuai.com ([103.29.140.57]) by smtp.gmail.com with ESMTPSA id we9sm10835653pab.3.2015.10.30.20.05.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Oct 2015 20:05:44 -0700 (PDT) From: Yousong Zhou To: florian@openwrt.org Date: Sat, 31 Oct 2015 11:05:27 +0800 Message-Id: <1446260727-25188-6-git-send-email-yszhou4tech@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1446260727-25188-1-git-send-email-yszhou4tech@gmail.com> References: <1446260727-25188-1-git-send-email-yszhou4tech@gmail.com> Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH v2 5/5] malta: make eth0 the wan interface by default X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Many packages for OpenWrt currently assume that lan is the "internal" side of the network map, e.g. if installed, dnsmasq will hand out DHCP leases on lan, firewall will allow forwarding on lan. While at it, also configure a lan interface if eth1 exists. Signed-off-by: Yousong Zhou --- target/linux/malta/base-files/etc/uci-defaults/02-network | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/linux/malta/base-files/etc/uci-defaults/02-network b/target/linux/malta/base-files/etc/uci-defaults/02-network index e90ecbe..7b3e225 100644 --- a/target/linux/malta/base-files/etc/uci-defaults/02-network +++ b/target/linux/malta/base-files/etc/uci-defaults/02-network @@ -3,4 +3,7 @@ . /lib/functions/uci-defaults.sh ucidef_set_interface_loopback -ucidef_set_interface_raw "lan" "eth0" "dhcp" +ucidef_set_interface_wan "eth0" +if [ -d "/sys/class/net/eth1" ]; then + ucidef_set_interface_lan "eth1" +fi