* Re: [gentoo-user] Re: configure wlan0 route metric
[not found] ` <gHdBT-5Tb-3@gated-at.bofh.it>
@ 2011-04-13 19:27 99% ` Indi
0 siblings, 0 replies; 1+ results
From: Indi @ 2011-04-13 19:27 UTC (permalink / raw
To: gentoo-user
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 <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
> > > >> 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'
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
[not found] <gHbTt-2Ui-33@gated-at.bofh.it>
[not found] ` <gHbTt-2Ui-45@gated-at.bofh.it>
[not found] ` <gHbTt-2Ui-31@gated-at.bofh.it>
[not found] ` <gHdBT-5Tb-3@gated-at.bofh.it>
2011-04-13 19:27 99% ` [gentoo-user] Re: configure wlan0 route metric Indi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox