Subject: Re: Tricky network config.
To: Johnny Billquist <bqt@Update.UU.SE>
From: Perry E. Metzger <perry@piermont.com>
List: netbsd-help
Date: 10/20/2005 10:55:34
Johnny Billquist <bqt@Update.UU.SE> writes:
> I have a machine with three ethernet interfaces, where I would like
> routing to use the source address for next hop decision, but I can't
> figure out how. Does anyone else have any suggestions?
>
> The deal is like this:
>
> o ex0 is an internal network, which is NATed and firewalled.
> o ex1 is an external interface on which I'd like trafic from ex0 go to.
> o tlp0 is an external interface on which I'd like external sessions to
>   connect to.
>
> The deal is that the default route used for traffic initiated in the
> machine, or from the internal network I'd like to go to ex1.
> Externally initiated traffic to the machine will come to tlp0. The machine
> serves mail, web and other stuff.
>
> Right now I can only get the replies to traffic on tlp0 and my own
> outgoing traffic to use the same default route. However, I'd like to send
> traffic which has a source addess of tlp0 to go out on tlp0's next hop
> gateway, while all other traffic would go to ex1's next hope gateway.
>
> This is so that external traffic will not use the same bandwidth that I
> use for my "own" traffic. Load balancing in a crude way. :-)
>
> Anyone know how to do this?
> If my explanation or idea is unclear, please ask, and I'll try to explain
> more.

The "fast route" hack in ipf may be what you are looking for -- it
gives you manual control over where packets of various kinds get
kicked. I use it for such evil purposes. Beware, though, the code is
very buggy.

Perry