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 <gentoo-user+bounces-121624-garchives=archives.gentoo.org@lists.gentoo.org>) id 1QA2ZC-0000ZR-AG for garchives@archives.gentoo.org; Wed, 13 Apr 2011 16:05:18 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B94041C104; Wed, 13 Apr 2011 16:03:40 +0000 (UTC) Received: from mail-iy0-f181.google.com (mail-iy0-f181.google.com [209.85.210.181]) by pigeon.gentoo.org (Postfix) with ESMTP id 8C21C1C10C for <gentoo-user@lists.gentoo.org>; Wed, 13 Apr 2011 16:03:40 +0000 (UTC) Received: by iyb26 with SMTP id 26so962869iyb.40 for <gentoo-user@lists.gentoo.org>; Wed, 13 Apr 2011 09:03:40 -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=J59DvMOBcyQqU+nvYrVz1bsCRH+yM4lbkhpHgPhCUgc=; b=Ok017FVSGG0wk+DGJ0UnG6070UqP1SroBRy0DklZBmTGiSpwxfOHwLxllimIcSZI9y R7PNk4O3wM1l2Kmkey31cwUMV1lKVjWm67CXUh/GPX6jsUa649C5WAHiokElz4VyWNw+ UWUxf1sJHkfX6nyZm37Ompg+RFdAwS0IXQEes= 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=fomiRjmHEXSPc5Vy6lLoFvelWPqBi+8M2XR3Y/l/C4r2gt9qtTYbCe5CJq9UNox2EC Aiy/feuZyhFutLqVnSe9Qwpu8hqZSPtRQaJ9G40Vp1V/A3PO2QQTVwAOx2ayfQhiYeh0 sti5d3bfhp0lbqwNALPzKw4OrZGGLGBaW0yWY= Precedence: bulk List-Post: <mailto:gentoo-user@lists.gentoo.org> List-Help: <mailto:gentoo-user+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-user.gentoo.org> X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.43.46.129 with SMTP id uo1mr1698988icb.123.1302710619092; Wed, 13 Apr 2011 09:03:39 -0700 (PDT) Received: by 10.42.240.198 with HTTP; Wed, 13 Apr 2011 09:03:36 -0700 (PDT) In-Reply-To: <20110413153534.GA13724@gaurahari> References: <gGTjR-4Xq-33@gated-at.bofh.it> <gH4Ii-7li-33@gated-at.bofh.it> <gH5kZ-8uC-5@gated-at.bofh.it> <gH6qK-1Rf-19@gated-at.bofh.it> <gH6K6-2j1-11@gated-at.bofh.it> <20110413153534.GA13724@gaurahari> Date: Wed, 13 Apr 2011 17:03:36 +0100 Message-ID: <BANLkTimfKz-VVBRG8paJk1dbPqd=XH9ZzQ@mail.gmail.com> Subject: Re: [gentoo-user] Re: configure wlan0 route metric From: Mick <michaelkintzios@gmail.com> 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: 2b6641a02ad917670286d1ecdd85aa16 On 13 April 2011 16:35, Indi <thebeelzebubtrigger@gmail.com> wrote: > On Wed, Apr 13, 2011 at 01:50:02PM +0200, deadeyes wrote: >> >> I was searching around the gentoo forums for ifmetric and found this pie= ce of >> code that can be added in /etc/conf.d/net: >> postup() { >> =A0 =A0local metric=3D0 >> >> =A0 =A0case "${IFACE}" in >> =A0 =A0 =A0 eth0) metric=3D0 ;; >> =A0 =A0 =A0 eth1) metric=3D1 ;; >> =A0 =A0esac >> =A0 =A0ifmetric "${IFACE}" "${metric}" >> >> =A0 =A0return 0 >> } >> > > Hey, that works very well here -- thanks! > Been wanting that solution for some time now. > :) My apologies! It took some time between reading your message and replying to it - by which time I had forgotten the finer points. Whether you set NIC priority in the /etc/conf.d/net file or in a post up script, the result is the same. One NIC will have a higher priority than another for ALL connections. This is because NICs do not do NATing. They 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. So, 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. --=20 Regards, Mick