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 1QA5k1-00013o-4B for garchives@archives.gentoo.org; Wed, 13 Apr 2011 19:28:41 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5EB121C11F; Wed, 13 Apr 2011 19:27:15 +0000 (UTC) Received: from mail-gx0-f181.google.com (mail-gx0-f181.google.com [209.85.161.181]) by pigeon.gentoo.org (Postfix) with ESMTP id 2719F1C11F for ; Wed, 13 Apr 2011 19:27:14 +0000 (UTC) Received: by gxk9 with SMTP id 9so578343gxk.40 for ; Wed, 13 Apr 2011 12:27:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=dJshcNiycAjJvq6W4q52mW40mVm5s5UO5/h4KS6RnZw=; b=jGtxmb1AhaEUSWHJSMR3CmGHPEq8wic6AC0TfnOp7NLeM1Fe8AfibRykr3WgJSgVWH gWMOp1gbz6Zr7y/NqXqVRAVdBtDP3tKQfY7DTs0ENrRpF2jt6y3ohhDWO6x2v7y+mFWf SNnCeZgC6JhTjpOYRrEhYiyK6duEJ6EM9YyCk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=HieFkQankOJSOTS3/VW6PiDWjCuXOgSeXE9b5EETufWKRlFhjbgKhbV+ef5o2S8SBw x0oYZZKD1xoYxvLmtWR5sAndUizNCF4MrI1O75XEUqKTX3rKpNpuql+TRz5j+BM4Q1d9 sJhn948mZNt/oL2X8OkW7CeGb/pQnPZcrjVOA= Received: by 10.236.73.230 with SMTP id v66mr10305984yhd.134.1302722834568; Wed, 13 Apr 2011 12:27:14 -0700 (PDT) Received: from gaurahari (adsl-152-79-247.asm.bellsouth.net [72.152.79.247]) by mx.google.com with ESMTPS id 45sm407354yhl.2.2011.04.13.12.27.13 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Apr 2011 12:27:13 -0700 (PDT) Date: Wed, 13 Apr 2011 15:27:11 -0400 From: Indi To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Re: configure wlan0 route metric Message-ID: <20110413192711.GA30568@gaurahari> References: 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Archives-Salt: X-Archives-Hash: 095beb55ca5320c41be337582a13d74c On Wed, Apr 13, 2011 at 09:10:01PM +0200, Mick wrote: > On Wednesday 13 April 2011 18:07:30 Indi wrote: > > On Wed, Apr 13, 2011 at 06:10:05PM +0200, Mick wrote: > > > On 13 April 2011 16:35, Indi 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 > > > >> piece of code that can be added in /etc/conf.d/net: > > > >> postup() { > > > >> local metric=0 > > > >> > > > >> case "${IFACE}" in > > > >> eth0) metric=0 ;; > > > >> eth1) metric=1 ;; > > > >> esac > > > >> ifmetric "${IFACE}" "${metric}" > > > >> > > > >> return 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. > > > > Actually I do want to prioritise one over the other, when both are > > connected. Using netplug with one wired and one wireless, and the > > referenced script in /etc/conf.d/net. > > > > Am I doing it wrong? :) > > No, not at all. It's only that the OP wanted to prioritise the wired > interface against the wireless, but *only* for connections to the LAN. > -- > Regards, > Mick Ah, sorry I missed that part. It does seem to do just I wanted though. -- /\ /\ <\ /> ^ caveat utilitor 'v-v'