IPSec/NAT/Gateway Query

Crist J. Clark cristjc at comcast.net
Mon Mar 15 23:28:25 PST 2004


On Fri, Mar 12, 2004 at 09:55:31AM +1300, Neil Fenemor wrote:
[snip]
> What I'm having an issue, is if the "client" has a range of RFC 1918
> addresses behind it, and I have to introduce NAT into the equation.
> 
> I've best tracked it down to the order that the kernel looks at the
> packets to decide what to do with it.
> 
> This is where I stand at the moment.
> 
> x.y.z.11 -> x.y.z.254             : works perfectly
> x.y.z.11 -> x.y.z.254 -> 0.0.0.0  : works perfectly
> rfc 1918 -> x.y.z.11 -> x.y.z.254 : Fails
> rfc 1918 -> x.y.z.11 -> x.y.z.254 -> 0.0.0.0 : Fails

Why not do IPsec between x.y.z.11 and x.y.z.254 in tunnel mode and do
the NAT on the host with the x.y.z.254 interface?

If you want to do the NAT on x.y.z.11, you can "trick" it to doing NAT
before IPsec by doing some of the ol' gif(4)-IPsec gymnastics.
-- 
Crist J. Clark                     |     cjclark at alum.mit.edu
                                   |     cjclark at jhu.edu
http://people.freebsd.org/~cjc/    |     cjc at freebsd.org


More information about the freebsd-current mailing list