Hello Po
It all comes down to where and how traffic is processed in eavh VPN type. Specifically, it has to do with the interaction between the routing decision, NAT operations, and the IPsec encryption engine.
On a Cisco IOS router, when traffic flows from an inside interface to an outside interface, operations occur in this order:
- routing
- NAT
- Crypto (IPsec)
(for more on NAT order of operations, take a look at this Cisco documentation)
This ordering is the root cause of the difference.
In Policy-Based VPNs, identity NAT is required because there is no logical tunnel interface. Both regular traffic and VPN-bound traffic are routed out of the same physical WAN interface, which has ip nat outside configured. Because the egress interface is the physical WAN interface, the NAT engine is invoked and will translate the private source IP (e.g., 192.168.1.x) to the router’s public IP. The crypto map ACL (which expects the original private source IP) is checked after NAT has already changed the source address. The result is that the translated packet no longer matches the crypto ACL and the traffic is not encrypted, and either gets sent unencrypted to the Internet or gets dropped.
Identity NAT is used to fix this, to tell the NAT engine “Do not translate traffic destined for the remote VPN subnet.” This preserves the original addresses so the crytpo ACL can match them correctly and encryption proceeds as it should.
When using route-based VPNs (VTIs etc) identity NAT is not required because a logical tunnel interface is created, and the IPsec profile is applied to it via the tunnel protection ipsec profile command. Routing directs traffic destined to the remote subnet via the tunnel interface (i.e. Tunnel0) before it ever reaches the physical outside interface where NAT is configured and applied. Because the Tunnel interface is not configured with ip nat outside, the NAT process is completely bypassed for the inner (payload) traffic.
The IPSec engine encrypts the packet at the tunnel interface. The resulting encrypted outer ESP packet (sourced from the tunnel endpoints’ public IPs) is then routed out the physical WAN interface, but this outer packet is already encapsulated and requires no exemption.
The result is that no Identity NAT is needed because VPN traffic is never presented to the NAT engine on the physical outside interface in the first place.
I hope this has been helpful!
Laz