Multiple gateways?

BSDServer Redes e Servidores bsdserver at bsdserver.com.br
Tue Jul 25 17:49:41 UTC 2006


Hi there,

With ipfw you can do multiple diverts and natds on different ports,
choosing which traffic will use wich gateway by source or destiny.

xl0 = 192.168.1.2 -> gw 192.168.1.1
xl1 = 10.0.0.2    -> gw 10.0.0.1

...
add divert 8669 ip from any to 192.168.1.2 via xl0 in
add divert 8669 ip from 172.16.0.0/16 to any 80 via xl1 out
add fwd 192.168.1.1 ip from 192.168.1.2 to any
add divert 8668 ip from any to 10.0.0.1 via xl1 in
add divert 8668 ip from 172.16.0.0/16 to any via xl1 in 
...

Suposing your default gateway is 10.0.0.1 and alternative gateway
is 192.168.1.1 and your network is 172.16.0.0, with this rules
your web requests are going through alterative gateway, and all the
rest through default gateway

Another way is using pf, where you can even do a round robin use
of both gateways, as in http://www.openbsd.org/faq/pf/pools.html.

[]'s

--
Rafael Mentz Aquino
BSDServer Ltda.
51 - 9847 8825

---------- Original Message -----------
From: "Atom Powers" <atom.powers at gmail.com>
To: rapopp at eastcentral.edu
Cc: freebsd-questions at freebsd.org
Sent: Tue, 25 Jul 2006 08:18:02 -0700
Subject: Re: Multiple gateways?

> You need to have only one default gateway.
> But you can use routed to configure other gateways.
> Note: without a routing daemon all your gateways are default 
> gateways, this will almost certainly cause you problems.
> 
> On 7/25/06, Reuben A. Popp <rapopp at eastcentral.edu> wrote:
> > Hello all,
> >
> > Another quick question here.. I have a box with dual gb nics and I was 
curious
> > if there was a relatively easy way to connect it to two separate gateways.
> > For example, em0 is configured to be 10.223.223.223 with a gateway of
> > 10.223.223.254 and em1 is configured to be 10.224.224.224 with a gateway 
of
> > 10.224.224.254.
> >
> > TIA
> > Reuben A. Popp
> >
> > Information Technology Department
> > East Central College
> > 1+ 636 583-5195 ext 2480
> > _______________________________________________
> > freebsd-questions at freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to "freebsd-questions-
unsubscribe at freebsd.org"
> >
> 
> -- 
> --
> Perfection is just a word I use occasionally with mustard.
> --Atom Powers--
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
------- End of Original Message -------


More information about the freebsd-questions mailing list