"Jacob Bunk Nielsen" <(E-Mail Removed)> wrote in message
news:spamdrop+(E-Mail Removed).. .
> "dave" <(E-Mail Removed)> writes:
>> <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed) oups.com...
>>> I'm interested in knowing whether it is possible to have a linux server
>>> with two nics on 2 different networks. Serving http traffic through
>>> both interfaces.
>>
>>
>> If you had two NIC's one on the network 10.0.0.0/24 and one
>> 192.168.0.0/24
>> there should be routing table entries for both. The easiest way is just
>> to
>> reset the default gateway through the interface, hopefully without having
>> to
>> provide a remote IP, especially if you got the addresses by DHCP.
>
> This wouldn't work for one of the interfaces if routing is not
> symmetric.
>
> Imagine a setup such as:
>
> HTTP client
> / \
> / \
> R1 R2
> \ /
> N1 \ / N2
> HTTP server
>
> R1 and R2 being routers and N1 and N2 being networks.
>
> If the webserver has it's default gateway on R1 on it's interface in
> N1, but is contacted by the client via R2 and N2. Then it would reply
> back to the client using it's default gateway, namely the interface in
> N1 with the wrong address.
>
> Of course there is a solution to OP's problem. It's called policy
> routing. You have to create a policy stating that all traffic coming in
> on eth0 must be answered on eth0 and all traffic on eth1 must be
> answered on eth1.
Indeed, reading back I realise I made the assumption (stupid me!) that one
or both of the networks would be internal only and one at least would only
be a local subnet. You are totally correct of course that, in my model,
should a packet from a system not local to the subnet of the non-default
network card arrive it would all go wrong (unless the default gateway
happened to have a route back to the host).
Policies are the answer and I stand corrected.
Cheers,
Dave.
|