Subject: Re: How to add two gateways ? - NetBSD 1.5.3a/i386
To: None <netbsd-help@netbsd.org>
From: sudog <sudog@sudog.com>
List: netbsd-help
Date: 11/22/2001 10:56:35
On Thursday 22 November 2001 07:42, CRESTIN Frederic wrote:
> Hi everyone !

Hello!

> On a NetBSD 1.5.3a/i386, I'd like know if it's possible to add two
> gateways, and if yes, how ?
>
> I must explain why two gateways:
>
> 	- one will be the *default* gateway, to come out on Internet
>
> 	- second one has an public IP address too. But it will not be used
> to come out, just to come in (mail server for example).
> In this case, problem is that when a request comes in on this network
> interface, answer goes out on the first interface, which is the default
> gateway. I'd like that answers use same interfaces as requests.
>
> How to resolve such a problem ?
>
> Note: I use too IPFilter, that I know well. It it can help...
>
> Thanks in advance for your help !

I don't know if this would help at all, but I have two gateways at 
home--an ADSL and a Cable modem..  I use ipfilter to perform some 
fast-route traffic handling to get outgoing packets to go to the proper 
place based on what the source IP address is.

So when something comes in destined for my 10.0.0.9 internal address it 
*shouldn't* go back out the public interface when the 10.0.0.9 source 
(which NetBSD tries its best to do.) Instead, I have a rule like the 
following:

pass out quick on fxp1 to fxp0:10.0.0.5 from 10.0.0.9/32 to any

10.0.0.5 is my "other" gateway. This way, incoming connections can come in 
on either interface and they go back out the way they came in.

Unfortunately this is the best way to do it without adding in that cool 
extra routing stuff that..  was it der Mouse that wrote it? I forget.

This is fast becoming a regular problem that NetBSD users have. Is there 
some way being planned to resolve it in-situ? Or is the KAME capable of 
handling this stuff properly?

-sudog