How to use two interface with jail

Kurt Jaeger lists at c0mplx.org
Tue Feb 5 08:37:26 PST 2008


Hi!

> How can I make 
> 
> 	all traffic from the server/for the server pass through the first
> 	interface
> 
> 	all traffic from the jail /for the jail pass through the second
> 	interface.
> 
> In fact : How can make two «default router» on for the server, another for
> all jail. 

Assuming you can use ipfw, here's an example:

- Interfaces:
  if1: 192.168.1.1, gateway 192.168.1.254
  if2: 192.168.2.1, gateway 192.168.2.254
- system uses 192.168.1.254 as its default gateway.
- IP-ranges for jails are in the 192.168.2.0/24 range.
- Then add the following ipfw rule:

/sbin/ipfw add 1000 fwd 192.168.2.254 ip from 192.168.2.0/24 to any out via if2

Give it a try.

-- 
pi at opsec.eu            +49 171 3101372                        12 years to go !


More information about the freebsd-jail mailing list