On 13 April 2011 20:52, deadeyes <gvm...@gmail.com> wrote:
> Mick <michaelkintzios <at> 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.  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.
>>
>
> Great to see this helps someone else as well :)
>
> @Mick: I am not sure if I fully understand what you mean. Following the 
> routing
> table the most specific route will be used, which is not the default route, 
> 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 config
> option?) using /etc/conf.d/net or in a post script? Both have different 
> outcomes
> 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.
-- 
Regards,
Mick

Reply via email to