1 |
On 13 April 2011 20:52, deadeyes <gvm999@×××××.com> wrote: |
2 |
> Mick <michaelkintzios <at> gmail.com> writes: |
3 |
|
4 |
>> Whether you set NIC priority in the /etc/conf.d/net file or in a post |
5 |
>> up script, the result is the same. One NIC will have a higher |
6 |
>> priority than another for ALL connections. This is because NICs do |
7 |
>> not do NATing. They will send all packets out to the gateway |
8 |
>> (192.168.1.1) and the router at the gateway will determine which |
9 |
>> packet is forwarded to the Internet and which to the LAN. So, if you |
10 |
>> do not want to prioritise one NIC over another, it may be better to |
11 |
>> use iptables to route LAN packets via a particular NIC instead. |
12 |
>> |
13 |
> |
14 |
> Great to see this helps someone else as well :) |
15 |
> |
16 |
> @Mick: I am not sure if I fully understand what you mean. Following the routing |
17 |
> table the most specific route will be used, which is not the default route, but |
18 |
> the route to the local lan. |
19 |
|
20 |
*All* routes have to go through the local LAN. That's where you router is. |
21 |
|
22 |
Both NICs are in the same subnet (192.168.1.0/24) and use the same |
23 |
gateway (192.168.1.1). Therefore, the only thing that determines |
24 |
which NIC your packets will go out of is the NIC's metric setting. |
25 |
|
26 |
In your first email you show eth0 with a higher priority than wlan0. |
27 |
All connections will go out eth0, unless eth0 goes down for some |
28 |
reason, or becomes saturated. |
29 |
|
30 |
|
31 |
> In this case the metric is important as there are |
32 |
> multiple interfaces with the same network. |
33 |
> And what do you mean by setting NIC priority (using the metric_eth0 config |
34 |
> option?) using /etc/conf.d/net or in a post script? Both have different outcomes |
35 |
> it looks to me. |
36 |
|
37 |
Both have the same outcome - set priority for your eth0 and wlan0 NICs, |
38 |
|
39 |
use the same file - /etc/conf.d/net |
40 |
|
41 |
and set up the same parameter - metric. |
42 |
|
43 |
The post up script also sets the lo interface to 0 which is the |
44 |
default anyway. Unless I misunderstand the file's nomenclature local |
45 |
stands for Local Loopback (127.0.0.1/255.0.0.0) and by default has |
46 |
higher priority. |
47 |
|
48 |
Anyway, that's how I understand this, no doubt some networking guru |
49 |
will correct me if I got it wrong. |
50 |
-- |
51 |
Regards, |
52 |
Mick |