Subject: Re: ipsec after nat
To: Mipam <>
From: None <>
List: tech-net
Date: 01/13/2001 15:32:31
>Okay, clear it is.
>But then, one question about the example placed here:
>Traffic from to and vice versa is being encrypted this
>way. Internally they use the 10 address space and no natting is done
>here. But are these machines from the internal network supposed to reach
>the internet and receive traffic back (not using ipsec) cause in that
>case natting needs to be done for the internal addresses.
>Or is natting only done in case traffic is destined/comming from addresses
>other then
>Or was this example just for a leased line between those networks?

	in the above example, outbound IPsec operation will be performed only
	for packets between ->  so if someone in tries to contact global address (like
	IPsec will do nothing about the packet.  if you want NAT to
	take place, that's your choice. ->		IPsec takes place -> some other address	IPsec won't take place
		(if you do NAT, that's fine go ahead)

	of course there can be other places to look at.  for example,
	with the current code, you want to carefully check if ipfilter or
	IPsec looks at the packet first, to make your configuration work right.
	PR 11844 suggests to run ipfilter first in ip_input, but there are
	configuration/people favors to run ipsec first.

	what we have to do are:
	1. integrate IPsec policy lookup filter and ipfilter, into single
	   packet classifier.  also we may want to integrate ALTQ classifier
	   too.  if we have more than one classifier/filter/whatever we have
	   ordering problem, so make a single unified classifier.
	   (NOTE: IPsec has socket policy as well so we need to think about
	   ordering between socket policy and filter-like policy)
	2. make the packet classifier to understand tunnelled packets well.
	   tunnelled packets may visit classifier more than once (like ip_input
	   was invoked again), and we would like to run different rules on each
	   invocation.  to do this we need to keep encapsulation/decapsulation
	   history for each of the mbuf and make classifier aware of the
	   history table.