routing and fwd

Antoine Jacoutot ajacoutot at lphp.org
Sat Jan 10 04:20:03 PST 2004


Hi :)

I have a simple problem and I was told this was possible to use ipfw to 
resolve this.
I have a FreeBSD gateway which has 2 internet connexions:
- con1 with a fixed public @ip range
- con2 with a dynamic @ip connection with a DSL modem

I would like to route all paquets coming from the DMZ (fixed public @ip range) 
and going to the Internet using con1 and route all paquets coming from LAN 
and going to the Internet using con2+NAT. I would also like to route paquets 
normally between LAN and DMZ.
The default route on the gateway would be con2 (the dynamic @ip DSL 
connexion).
Is it possible to build such a setup with ipfw ?

I was thinking about something like:
add divert 8668 ip from $LAN to !$DMZ via $con2
add fwd ip from $DMZ to !$LAN via $con1

But I was concerned about the fact that since my default route (on the 
gateway) would be con2, how would the paquets coming from the DMS be routed 
using con1 ?

I hope this is understandable...

----------------
INTERNET
----------------
   |          |
   |          |
----------------
  con1       con2
FREEBSD_GATEWAY
  em1        em0
----------------
   |          |
   |          |
   DMZ        LAN

Thanks for any inputs....
Note that I do no need failover, load balance, bonding... I just want to 
convert 2 gateways (one for each NET connection) into 1.

Regards,

Antoine



More information about the freebsd-ipfw mailing list