02-21-2019 12:56 PM
How to configure a ipsec tunnel between a Cisco ASA 5520 and a Cisco ASA 5505?
============================---------------------------remoteasa172-------------------------------=================================
remoteasa172#
remoteasa172#
remoteasa172#
remoteasa172#
remoteasa172#
: Hardware: ASA5520, 2048 MB RAM, CPU Pentium 4 Celeron 2000 MHz
: ASA Version 9.1(7)32
!
interface GigabitEthernet0/0
nameif outside
security-level 0
ip address 192.168.168.232 255.255.255.0
!
interface GigabitEthernet0/1
nameif inside
security-level 100
ip address 192.168.172.1 255.255.255.0
!
access-list OUTSIDE-IN extended permit ip any any log
access-list OUTSIDE-IN extended permit icmp any any log
access-list OUTSIDE-IN extended permit tcp any any log
access-list OUTSIDE-OUT extended permit ip any any log
access-list OUTSIDE-OUT extended permit icmp any any log
access-list OUTSIDE-OUT extended permit tcp any any log
access-list INSIDE-IN extended permit ip any any log
access-list INSIDE-IN extended permit icmp any any log
access-list INSIDE-IN extended permit tcp any any log
access-list INSIDE-OUT extended permit ip any any log
access-list INSIDE-OUT extended permit icmp any any log
access-list INSIDE-OUT extended permit tcp any any log
!
access-list LAN_Traffic extended permit ip 182.168.172.0 255.255.255.0 192.168.180.0 255.255.255.0 log
!
nat (inside,outside) after-auto source dynamic any interface
access-group OUTSIDE-IN in interface outside
access-group OUTSIDE-OUT out interface outside
access-group INSIDE-IN in interface inside
access-group INSIDE-OUT out interface inside
!
route outside 0.0.0.0 0.0.0.0 192.168.168.1 1
route inside 192.168.180.0 255.255.255.0 192.168.168.240 1
!
crypto ipsec ikev1 transform-set TS esp-aes-256 esp-sha-hmac
crypto map CMAP 80 match address LAN_Traffic
crypto map CMAP 80 set peer 192.168.168.240
crypto map CMAP 80 set ikev1 transform-set TS
crypto map enable interface outside
crypto ikev1 enable outside
crypto ikev1 policy 1
authentication pre-share
encryption aes
hash sha
group 2
lifetime 86400
!
dhcpd dns 192.168.168.1
dhcpd lease 3000
dhcpd ping_timeout 20
dhcpd domain mydomain.com
dhcpd option 3 ip 192.168.172.1
dhcpd option 2 ascii dhcpd_option_2_ascii_examplestring_HERE
!
dhcpd address 192.168.172.3-192.168.172.63 inside
dhcpd enable inside
!
tunnel-group 192.168.168.240 type ipsec-l2l
tunnel-group 192.168.168.240 ipsec-attributes
ikev1 pre-shared-key *****
!
remoteasa172#
============================---------------------------remoteasa180-------------------------------=================================
remoteasa180#
remoteasa180#
remoteasa180#
remoteasa180#
remoteasa180#
remoteasa180#
: Hardware: ASA5505, 512 MB RAM, CPU Geode 500 MHz
: ASA Version 9.2(4)5
!
interface Ethernet0/0
description OUTSIDE_200
switchport access vlan 200
!
interface Ethernet0/1
description INSIDE_180
switchport access vlan 180
!
interface Vlan180
nameif inside
security-level 100
ip address 192.168.180.1 255.255.255.0
!
interface Vlan200
description OUTSIDE_200
nameif outside
security-level 0
ip address 192.168.168.240 255.255.255.0
!
access-list OUTSIDE-IN extended permit ip any any log
access-list OUTSIDE-IN extended permit icmp any any log
access-list OUTSIDE-IN extended permit tcp any any log
access-list OUTSIDE-OUT extended permit ip any any log
access-list OUTSIDE-OUT extended permit icmp any any log
access-list OUTSIDE-OUT extended permit tcp any any log
access-list INSIDE-IN extended permit ip any any log
access-list INSIDE-IN extended permit icmp any any log
access-list INSIDE-IN extended permit tcp any any log
access-list INSIDE-OUT extended permit ip any any log
access-list INSIDE-OUT extended permit icmp any any log
access-list INSIDE-OUT extended permit tcp any any log
!
access-list LAN_Traffic extended permit ip 192.168.180.0 255.255.255.0 192.168.172.0 255.255.255.0 log
!
nat (inside,outside) after-auto source dynamic any interface
access-group INSIDE-IN in interface inside
access-group INSIDE-OUT out interface inside
access-group OUTSIDE-IN in interface outside
access-group OUTSIDE-OUT out interface outside
!
route outside 0.0.0.0 0.0.0.0 192.168.168.1 1
route inside 192.168.172.0 255.255.255.0 192.168.168.232 1
!
crypto ipsec ikev1 transform-set TS esp-aes-256 esp-sha-hmac
crypto ipsec security-association pmtu-aging infinite
crypto map CMAP 72 match address LAN_Traffic
crypto map CMAP 72 set pfs
crypto map CMAP 72 set peer 192.168.168.232
crypto map CMAP 72 set ikev1 transform-set TS
crypto map CMAP interface outside
crypto ikev1 enable outside
crypto ikev1 policy 1
authentication pre-share
encryption aes
hash sha
group 2
lifetime 86400
dhcpd dns 192.168.168.1
dhcpd ping_timeout 20
dhcpd domain myudomain.com
dhcpd auto_config outside
dhcpd option 3 ip 192.168.180.1
dhcpd option 2 ascii dhcpd_option_2_ascii_examplestring_HERE
!
dhcpd address 192.168.180.3-192.168.180.63 inside
dhcpd enable inside
!
tunnel-group 192.168.168.232 type ipsec-l2l
tunnel-group 192.168.168.232 ipsec-attributes
ikev1 pre-shared-key *****
!
remoteasa180#
Solved! Go to Solution.
02-27-2019 07:42 AM
Thanks for sharing the current config. Glad that it is working. I am a bit surprised to see the inside in acl begin with a statement which denies traffic from the local subnet to the remote peer subnet.
I would think that the PAT should not cause a problem on the 5520. But since I am not clear why it was a problem on the router there may be some aspect that I am not considering which could also impact the 5520.
HTH
Rick
02-27-2019 01:20 PM - edited 02-28-2019 10:46 AM
Tested the NAT overload, L3 tunnel, and PAT to www on the 5505 and it all works (see the following screen shots). HURRAY. I've added the final-final configuration attached (Apache2_PAT_5505.txt). Any idea why the 2921 RTR wouldn't do this (PATandL3conflict_2921.txt)? The PAT worked accessing www from outside, but it would block accessing the www server through the tunnel - it would not do what is shown in the second screen shot.
02-27-2019 02:21 PM
I am not real clear what I am looking at in these configs. But as far as I tell the configs that I believe are indicated as good both include the command
nat (inside, outside) after-auto source dynamic any interface
and the configs that seem to be labeled as bad did not have this command.
HTH
Rick
02-28-2019 10:49 AM
Sorry Rick, I attached the wrong files. I've corrected the posting. It has the good 5505 ASA configuration with overload NAT, PAT to www, and L3 tunnel (as shown in the screen shots). The other is for the 2921 that does the same thing but will not let the tunnel access the www server because of the Port Mapping to it from the outside.
03-01-2019 02:12 PM
Hi,
Will you please modify your router static NAT & add couple of lines as per beneath (this should be applicable to access the 192.168.175.66 host from 192.168.176.0/24 subnet via VPN tunnel):
ip nat source static tcp 192.168.175.66 80 192.168.168.235 8080 route-map nonat
access-list 176 deny ip host 192.168.175.66 192.168.176.0 0.0.0.255
access-list 176 permit ip host 192.168.175.66 any
route-map nonat permit 10
match ip address 176
Best regards,
Antonin
03-07-2019 06:03 AM
Hi Rick, I'll do that but I have to start up my router workbench. Thanks for the recommendation.
03-07-2019 11:18 AM
Hi Amikat, I'll get to that NAT on the 2921 as soon as I can. Thank you for your help :-)
I just found out something interesting (but it may be solved with your recommended NAT on the 2921). I'm connecting the remote sites to an alternate ISP so the address for the gateway ASA/RTR on our ops network is not 192.168.168.1 (it's already used) but instead an available address like 192.168.168.233; so I have to put in a ip route on the servers to get back to the remote site gateway router.
When I did this with the 2921, the L2 tunnel source address within the ops network was the ISP static ip network. Like 72.163.4.0/29 - not our real address). But the ASA is showing up as the actual private address from the remote end (host 192.168.180.4 for example).... It makes it much easier to put in routes on the servers.
ASA -------------------------------PING
[root@snips ahuffman]# tcpdump -n -i em1 | grep ICMP
19:10:32.407631 IP 192.168.180.4 > 192.168.168.200: ICMP echo request, id 12268, seq 751, length 64
19:10:32.407656 IP 192.168.168.200 > 192.168.180.4: ICMP echo reply, id 12268, seq 751, length 64
19:10:33.431642 IP 192.168.180.4 > 192.168.168.200: ICMP echo request, id 12268, seq 752, length 64
19:10:33.431658 IP 192.168.168.200 > 192.168.180.4: ICMP echo reply, id 12268, seq 752, length 64
19:10:34.455633 IP 192.168.180.4 > 192.168.168.200: ICMP echo request, id 12268, seq 753, length 64
19:10:34.455649 IP 192.168.168.200 > 192.168.180.4: ICMP echo reply, id 12268, seq 753, length 64
19:10:35.479617 IP 192.168.180.4 > 192.168.168.200: ICMP echo request, id 12268, seq 754, length 64
19:10:35.479634 IP 192.168.168.200 > 192.168.180.4: ICMP echo reply, id 12268, seq 754, length 64
^C283 packets captured
RTR------------------SEE 72.163.4.0 -----------------------IP ROUTE
-----------this is what I had to do to get the 2921 to work------------------
[root@snips ahuffman]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.168.1 0.0.0.0 UG 0 0 0 em1
10.10.10.0 0.0.0.0 255.255.255.224 U 0 0 0 em2
72.163.4.0 192.168.168.233 255.255.255.248 UG 0 0 0 em1
192.168.168.0 0.0.0.0 255.255.255.0 U 0 0 0 em1
192.168.168.0 0.0.0.0 255.255.255.0 U 0 0 0 em1
192.168.174.0 192.168.168.238 255.255.255.0 UG 0 0 0 em1
[root@snips ahuffman]#
03-22-2019 08:59 AM
Hi Amikat, on a Cisco 2921 - I tried to add a static NAT & route-map (this is applied access the 192.168.175.4 host from 192.168.177.0/24 subnet via VPN tunnel) as follows. But the 2921 c2900-universalk9-mz.SPA.157-3.M2.bin will not accept the command at the "route-map".
ip nat source static tcp 192.168.175.4 80 192.168.168.235 8888 route-map NONAT
access-list 177 deny ip host 192.168.175.4 192.168.177.0 0.0.0.255
access-list 177 permit ip host 192.168.175.4 any
route-map NONAT permit 10
match ip address 177
03-22-2019 01:05 PM
Why doesn't my 2921 accept this syntax?
ip nat source static tcp 192.168.175.66 80 192.168.168.235 8080 route-map nonat
The only route-map that it will accept is # ip nat inside source route-map
All the examples that I see on the Internet are the syntax that you suggest?
03-22-2019 03:59 PM - edited 03-22-2019 04:03 PM
Hi,
I am sorry for the typo I made, the correct syntax for my suggestion is:
"ip nat inside source static tcp 192.168.175.66 80 192.168.168.235 8080 route-map NONAT"
Best regards,
Antonin
02-25-2019 11:40 AM
Be sure to let me know when you come to DC :=)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide