From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QAJEC-0007VI-Pl for garchives@archives.gentoo.org; Thu, 14 Apr 2011 09:52:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 482021C038; Thu, 14 Apr 2011 09:50:48 +0000 (UTC) Received: from mail-iw0-f181.google.com (mail-iw0-f181.google.com [209.85.214.181]) by pigeon.gentoo.org (Postfix) with ESMTP id 117D51C038 for ; Thu, 14 Apr 2011 09:50:47 +0000 (UTC) Received: by iwn2 with SMTP id 2so1808780iwn.40 for ; Thu, 14 Apr 2011 02:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=uTgB33SdRgLb9PXAr/nYWhlqWvpQR57Q2Ola43y7X8g=; b=agcTLCdyi+lhXQ++3zHdIIhfcj7V3xzaYdDpqJ7enX7unCwdElW9yEIQU94glfdLAu 8L82I6surIea+9gS9K9AtecNAy8d3TdrcVMt5JEm43dkKL2JksvzOfovItKNCHUAjSd7 If6GzIZH7TwDL/tUKCVdykspSjV2hOOpbAz8k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=M2GNkSe1XdkpROkKHZj4qYtN99FNNp6Brn2g78vRFY3gVscBqZ4q4LyvA+ceayWKsR U5ar9LykN1F0Lz5pQXB1jXvSbY2cY6UXiK4ApKPnU5FdHXKH285njjg9O69+Wvx4SVlv kG2WhD7pJ/qlywQnZbDtQswMBtdm7CsSIYWXU= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.42.174.71 with SMTP id u7mr222285icz.123.1302774647313; Thu, 14 Apr 2011 02:50:47 -0700 (PDT) Received: by 10.42.240.198 with HTTP; Thu, 14 Apr 2011 02:50:47 -0700 (PDT) In-Reply-To: References: <20110413153534.GA13724@gaurahari> Date: Thu, 14 Apr 2011 10:50:47 +0100 Message-ID: Subject: Re: [gentoo-user] Re: configure wlan0 route metric From: Mick To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: a1b47cc50355c9d8c70705213fa17712 On 13 April 2011 20:52, deadeyes wrote: > Mick gmail.com> writes: >> Whether you set NIC priority in the /etc/conf.d/net file or in a post >> up script, the result is the same. =A0One NIC will have a higher >> priority than another for ALL connections. =A0This is because NICs do >> not do NATing. =A0They will send all packets out to the gateway >> (192.168.1.1) and the router at the gateway will determine which >> packet is forwarded to the Internet and which to the LAN. =A0So, if you >> do not want to prioritise one NIC over another, it may be better to >> use iptables to route LAN packets via a particular NIC instead. >> > > Great to see this helps someone else as well :) > > @Mick: I am not sure if I fully understand what you mean. Following the r= outing > table the most specific route will be used, which is not the default rout= e, but > the route to the local lan. *All* routes have to go through the local LAN. That's where you router is. Both NICs are in the same subnet (192.168.1.0/24) and use the same gateway (192.168.1.1). Therefore, the only thing that determines which NIC your packets will go out of is the NIC's metric setting. In your first email you show eth0 with a higher priority than wlan0. All connections will go out eth0, unless eth0 goes down for some reason, or becomes saturated. > In this case the metric is important as there are > multiple interfaces with the same network. > And what do you mean by setting NIC priority (using the metric_eth0 confi= g > option?) using /etc/conf.d/net or in a post script? Both have different o= utcomes > it looks to me. Both have the same outcome - set priority for your eth0 and wlan0 NICs, use the same file - /etc/conf.d/net and set up the same parameter - metric. The post up script also sets the lo interface to 0 which is the default anyway. Unless I misunderstand the file's nomenclature local stands for Local Loopback (127.0.0.1/255.0.0.0) and by default has higher priority. Anyway, that's how I understand this, no doubt some networking guru will correct me if I got it wrong. --=20 Regards, Mick