Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jul 2006 14:49:33 -0300
From:      "BSDServer Redes e Servidores" <bsdserver@bsdserver.com.br>
To:        freebsd-questions@freebsd.org
Subject:   Re: Multiple gateways?
Message-ID:  <20060725174920.M97774@bsdserver.com.br>
References:  <200607250737.54118.rapopp@eastcentral.edu> <df9ac37c0607250818v646d5e67ud995698a12b5485b@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@gmail.com>
To: rapopp@eastcentral.edu
Cc: freebsd-questions@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@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@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to "freebsd-questions-
unsubscribe@freebsd.org"
> >
> 
> -- 
> --
> Perfection is just a word I use occasionally with mustard.
> --Atom Powers--
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
------- End of Original Message -------



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