Cisco ASA – Configuring Spoke-to-Spoke with NAT 9.1

cisco-asafirewall

I have two L2L VPNs connected to a central ASA. I want these VPNs to communicate with each other but there are some caveats i'm having issues with.

On the first VPN (VPN1), everything is working fine. This is a more "traditional" IPSEC VPN, with limited to no NAT. That is to say that everything communicates via real addresses and traffic is routed through the use of an interesting ACL. There are no problems here: HQ and VPN traffic move just fine to one another.

On the second VPN (VPN2), a newly provisioned link, I want clients on VPN2 to communicate with a server at VPN1. The challenge is that VPN2 uses IP space that overlaps with VPN1 and with the headquarters ASA that both of these VPNs connect to.

I want VPN2's traffic, all of it, to PAT to a single address. Headquarters should see this traffic as the PAT'd address and should never see the real addresses. In an ideal world, this PAT would be handled on VPN2 so that HQ doesn't need to know any details or manage any specifics. From HQ's perspective, and from VPN1's perspective, all traffic is simply sourced from an address that is in the interesting traffic ACL.

Additionally, once the PAT traffic hits HQ, another NAT needs to take place. This time, HQ needs to NAT, on a 1:1 basis, traffic going to servers in a "hidden" subnet. HQ exposes a subnet (which is in the interesting traffic ACL of VPN2's ASA, and thus encrypted via ipsec). The logical way you would do this on today's ASA code is

object network foo
 nat (outside,outside) static foo.bar.baz.bang

I can't seem to get a configuration with the following characteristics to work:

  • HQ ASA: Twice NAT with the source being the PAT address of VPN2 and the destination being the hidden and real subnets of VPN1
  • HQ ASA: Simple NAT (with only the straight exposed "hidden" subnet)

I'd like to figure out what the right configuration model is to achieve this. Ideally, my requirements would be that VPN2 only shows up to me as a PAT (and it should be handled on their end), and HQ ASA handles the NAT for traffic from VPN2 to VPN1.

So:

  • HQ talks to VPN1 normally (10.4.0.0->10.5.0.0)
  • I want clients at VPN2 to talk to servers behind VPN1 (192.168.1.1->192.168.200.1)
  • I want HQ to NAT VPN1's "real addresses" to a "hidden subnet" for VPN2 (192.168.200.0->10.5.0.0)
  • I want VPN2's clients to be seen as a single address (PAT) (10.4.0.0->192.168.1.1)
  • Ideally VPN2 would do its own PAT before the traffic ever gets to me (10.4.0.0->192.168.1.1)
  • The interesting traffic ACLs are all correct
  • All devices are running 8.4+ (some 9.x+)
                                        +----+        
                                        |SRV |       
                 Outside +--------+     +----+        
                +-------->  FW1   +-----+             
                |        +--------+ Inside            
                |                           
                |                                     
+----+          |                            +-------+
| HQ |  outside |                            |Client1|
|----+----------+        +--------+          +-------+
                  |        |  FW2   |          |        
                  +--------+--------+----------->       
                   Outside                     |        
                                               +-------+
                                               |Client2|
                                               +-------+
                                                        

Best Answer

This is a really old post, and that's a complex set of requirements. But I'll try to answer this question for anyone else who may be looking to do a similar thing.

First, a diagram:

enter image description here

Now, some notes:

  1. I did not actually test this in a lab, but it should work in real life.
  2. I chose not to do the VPN1<->VPN2 NAT on the HQ, although you can using nat (outside,ouside) .... In order to keep the HQ config more simple, I have the spokes do their own NAT towards each other.
  3. Because of the PAT on VPN2, no traffic will be able to enter VPN2 unless it originated from there. I assume that's what you wanted. If not, just create a twice NAT (a.k.a., A manual NAT) higher up in the order to do something different, instead.

Now, the code:

!! VPN1
access-list crypto_vpn1_acl permit ip 10.5.0.0 255.255.255.0 10.4.0.0 255.255.255.0
access-list crypto_vpn1_acl permit ip 192.168.200.0 255.255.255.0 192.168.1.0 255.255.255.0
object network obj_192.168.1.0_24
 subnet 192.168.1.0 255.255.255.0
object network obj_192.168.200.0_24
 subnet 192.168.200.0 255.255.255.0
object network obj_10.4.0.0_24
 subnet 10.4.0.0 255.255.255.0
object network obj_10.5.0.0_24
 subnet 10.5.0.0 255.255.255.0
nat (inside,outside) source static obj_10.5.0.0_24 obj_10.5.0.0_24 dest static obj_10.4.0.0_24 obj_10.4.0.0_24
nat (inside,outside) source static obj_10.5.0.0_24 obj_192.168.200.0 dest static obj_192.168.1.0_24 obj_192.168.1.0_24
route outside 10.4.0.0 255.255.255.0 x.x.x.x
route outside 192.168.1.0 255.255.255.0 x.x.x.x

!! HQ
same-security-traffic permit intra-interface
access-list crypto_vpn1_acl permit ip 10.4.0.0 255.255.255.0 10.5.0.0 255.255.255.0
access-list crypto_vpn1_acl permit ip 192.168.1.0 255.255.255.0 192.168.200.0 255.255.255.0
access-list crypto_vpn2_acl permit ip 10.4.0.0 255.255.255.0 192.168.1.0 255.255.255.0
access-list crypto_vpn2_acl permit ip 192.168.200.0 255.255.255.0 192.168.1.0 255.255.255.0
object network obj_10.4.0.0_24
 subnet 10.4.0.0 255.255.255.0
object network obj_10.5.0.0_24
 subnet 10.5.0.0 255.255.255.0
object network obj_192.168.1.0_24
 subnet 192.168.1.0 255.255.255.0
nat (inside,outside) source static obj_10.4.0.0_24 obj_10.4.0.0_24 dest static obj_10.5.0.0_24 obj_10.5.0.0_24
nat (inside,outside) source static obj_10.4.0.0_24 obj_10.4.0.0_24 dest static obj_192.168.1.0_24 obj_192.168.1.0_24
route outside 10.5.0.0 255.255.255.0 x.x.x.x
route outside 192.168.1.0 255.255.255.0 x.x.x.x

!! VPN2
access-list crypto_vpn2_acl permit ip 192.168.1.0 255.255.255.0 10.4.0.0 255.255.255.0
access-list crypto_vpn2_acl permit ip 192.168.1.0 255.255.255.0 192.168.200.0 255.255.255.0
object network obj_10.5.0.0_24
 subnet 10.5.0.0 255.255.255.0
object network obj_pat_address
 host 192.168.1.1
object network obj_10.4.0.0_24
 subnet 10.4.0.0 255.255.255.0
object network obj_192.168.200.0_24
 subnet 192.168.200.0 255.255.255.0
nat (inside,outside) source static obj_10.5.0.0_24 obj_pat_address dest static obj_10.4.0.0_24 obj_10.4.0.0_24
nat (inside,outside) source dynamic obj_10.5.0.0_24 obj_pat_address dest static obj_192.168.200.0_24 obj_192.168.200.0_24
route outside 10.4.0.0 255.255.255.0 x.x.x.x
route outside 192.168.200.0 255.255.255.0 x.x.x.x

Hope this helps somebody.