Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Dec 2002 17:33:46 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        questions@FreeBSD.ORG
Subject:   Re: Multi-Homed Host
Message-ID:  <20021227173346.GA34814@happy-idiot-talk.infracaninophi>
In-Reply-To: <1313.24.187.33.72.1040950524.squirrel@mrpc.com>
References:  <1313.24.187.33.72.1040950524.squirrel@mrpc.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 27, 2002 at 12:55:24AM -0000, Timmer wrote:


> This machine runs a web server (and a few other things), so all that traffic
> must happen on the T1.  However, the T1 is significantly slower than my cable
> connection, so I would like the machine to use the cable connection for
> downloading large files and so on.
> 
> Is there any way to configure FreeBSD to essentially have two default
> gateways, and to choose the correct gateway based on the source IP address
> (that is, if I try to FTP from the 192.168.1.2 address, it should send all the
> traffic out the 192.168.1.1 gateway)?

What you are describing is called "Policy based routing" --- under
FreeBSD it's generally implemented using IPWF 'fwd' rules. Eg
something like:

    ipfw add fwd 192.168.1.1 all from 192.168.1.2 to any out
    ipfw add fwd 216.46.79.65 all from 216.46.79.72 to any out

Remember to include 'options IPFIREWALL_FORWARD' in your kernel
config, as well as the other options required to enable ipfw(8).
Searching Google Groups for 'FreeBSD policy based routing' will turn
up any number of articles should you need further information.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
                                                      Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021227173346.GA34814>