cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
996
Views
0
Helpful
2
Replies

ASA5550 NAT + static NAT + IPSec problem

luis.repas
Level 1
Level 1

Hi all,

we have a couple of IPSec tunnels configured on a ASA 5550.

until now we were not able to introduce a static NAT command.

    static (outside,inside) d.d.d.d <host at IP-RNx> netmask 255.255.255.255

knowing that NAT takes place before encryption and that everything's OK if we don't use static nat,
what could be the problem here?

thanks in advance,
Luis


relevant config:

!
interface GigabitEthernet0/0
nameif outside
security-level 0
ip address x.y.z.133 255.255.255.240 standby x.y.z.134
!
interface GigabitEthernet0/1
nameif inside
security-level 100
ip address a.b.c.245 255.255.255.240 standby a.b.c.246

!
access-list ACL-R-NAT extended permit ip 172.16.0.0 255.240.0.0 <IP-RN1> 255.255.255.240
access-list ACL-R-NAT extended permit ip 172.16.0.0 255.240.0.0 <IP-RN2> 255.255.255.240
access-list ACL-I-CRYPTO-MAP extended permit ip host n.n.n.17 <IP-RN1> 255.255.255.240
access-list ACL-I-CRYPTO-MAP extended permit ip host n.n.n.17 <IP-RN2> 255.255.255.240
access-list I-A-1-CRYPTO-MAP extended permit ip 172.16.0.0 255.240.0.0 10.254.0.0 255.255.0.0
access-list I-A-2-CRYPTO-MAP extended permit ip 172.16.0.0 255.240.0.0 10.252.0.0 255.255.0.0

global (outside) 5 n.n.n.17
nat (inside) 5 access-list ACL-R-NAT
route outside 0.0.0.0 0.0.0.0 x.y.z.129 1
route inside 172.16.0.0 255.240.0.0 a.b.c.241 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
service resetoutside

crypto ipsec transform-set ESP-AES-128-MD5 esp-aes esp-md5-hmac
crypto ipsec transform-set ESP-AES-128-SHA esp-aes esp-sha-hmac
crypto ipsec transform-set ESP-3DES-SHA esp-3des esp-sha-hmac
crypto ipsec security-association lifetime seconds 10800
crypto ipsec security-association lifetime kilobytes 1048576

crypto map LAN2LAN 10 match address ACL-I-CRYPTO-MAP
crypto map LAN2LAN 10 set peer <PEER-I>
crypto map LAN2LAN 10 set transform-set ESP-AES-128-MD5 ESP-AES-128-SHA
crypto map LAN2LAN 10 set nat-t-disable
crypto map LAN2LAN 10 set reverse-route
crypto map LAN2LAN 20 match address I-A-1-CRYPTO-MAP
crypto map LAN2LAN 20 set peer <PEER-A>
crypto map LAN2LAN 20 set transform-set ESP-AES-128-MD5 ESP-AES-128-SHA
crypto map LAN2LAN 20 set nat-t-disable
crypto map LAN2LAN 20 set reverse-route
crypto map LAN2LAN 30 match address I-A-2-CRYPTO-MAP
crypto map LAN2LAN 30 set peer <PEER-A>
crypto map LAN2LAN 30 set transform-set ESP-AES-128-MD5 ESP-AES-128-SHA
crypto map LAN2LAN 30 set nat-t-disable
crypto map LAN2LAN 30 set reverse-route
crypto map LAN2LAN interface outside
crypto isakmp identity address
crypto isakmp enable outside
crypto isakmp policy 10
authentication pre-share
encryption aes-256
hash sha
group 2
lifetime 14400
crypto isakmp policy 20
authentication pre-share
encryption 3des
hash sha
group 2
lifetime 86400
telnet timeout 5


username infra password DcCt2e9Gr2RmaSJh encrypted
tunnel-group <PEER-I> type ipsec-l2l
tunnel-group <PEER-I> ipsec-attributes
pre-shared-key *
tunnel-group <PEER-A> type ipsec-l2l
tunnel-group <PEER-A> ipsec-attributes
pre-shared-key *
!
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters  
  message-length maximum 512
policy-map global_policy
class inspection_default
  inspect dns preset_dns_map
  inspect ftp
  inspect h323 h225
  inspect h323 ras
  inspect rsh
  inspect rtsp
  inspect esmtp
  inspect sqlnet
  inspect skinny
  inspect sunrpc
  inspect xdmcp
  inspect sip
  inspect netbios
  inspect tftp
!
service-policy global_policy global
prompt hostname context
Cryptochecksum:c1418f0ce554eaedec1d0f995d09474d
: end

2 Replies 2

andrew.prince
Level 10
Level 10

What is the issue you are seeing?

Hi,

thanks for your interest in this issue.

the present flow is the following:

source --> FWSM (DNAT) --> ASA (SNAT)--> (IPSEC tunnel) --> destination


if the static NAT entry is in the FWSM:

static (TPGLAN,Internet) 172.18.139.251 212.x.y.12 netmask 255.255.255.255

there is no problem and the packet trace in the ASA is the following:

ASA/act# packet-tracer input inside tcp 172.31.224.1 1024 212.x.y.12 22

Phase: 1
Type: ACCESS-LIST
Subtype:
Result: ALLOW
Config:
Implicit Rule
Additional Information:
MAC Access list

Phase: 2
Type: FLOW-LOOKUP
Subtype:
Result: ALLOW
Config:
Additional Information:
Found no matching flow, creating a new flow

Phase: 3
Type: ROUTE-LOOKUP
Subtype: input
Result: ALLOW
Config:
Additional Information:
in   0.0.0.0         0.0.0.0         outside
             
Phase: 4
Type: IP-OPTIONS
Subtype:
Result: ALLOW
Config:
Additional Information:

Phase: 5
Type: FOVER
Subtype: standby-update
Result: ALLOW
Config:
Additional Information:

Phase: 6
Type: NAT
Subtype:
Result: ALLOW
Config:
nat (inside) 4402 access-list UK-R-NAT2
  match ip inside 172.31.224.0 255.255.240.0 outside host 212.x.y.12
    dynamic translation to pool 4402 (85.x.y.222)
    translate_hits = 2838, untranslate_hits = 0
Additional Information:
Dynamic translate 172.31.224.1/1024 to 85.x.y.222/52350 using netmask 255.255.255.255

Phase: 7
Type: NAT
Subtype: host-limits
Result: ALLOW
Config:
nat (inside) 31 access-list R-NAT
  match ip inside 172.31.224.0 255.255.240.0 outside host 62.x.y.20
    dynamic translation to pool 31 (85.x.y.224)
    translate_hits = 0, untranslate_hits = 0
Additional Information:

Phase: 8
Type: VPN
Subtype: encrypt
Result: ALLOW
Config:
Additional Information:

Phase: 9
Type: VPN
Subtype: ipsec-tunnel-flow
Result: ALLOW
Config:
Additional Information:

Phase: 10
Type: IP-OPTIONS
Subtype:
Result: ALLOW
Config:
Additional Information:

Phase: 11
Type: FLOW-CREATION
Subtype:
Result: ALLOW
Config:
Additional Information:
New flow created with id 1158511635, packet dispatched to next module

Result:
input-interface: inside
input-status: up
input-line-status: up
output-interface: outside
output-status: up
output-line-status: up
Action: allow

ASA/act# packet-tracer input inside tcp 172.31.224.1 1024 212.x.y.12 22

Phase: 1
Type: FLOW-LOOKUP
Subtype:
Result: ALLOW
Config:
Additional Information:
Found flow with id 1158511635, using existing flow

Result:
input-interface: inside
input-status: up
input-line-status: up
Action: allow

ASA/act#


After removing the static NAT statement on the FWSM, and applying it on the ASA:

FWSM/act(config)# no static (TPGLAN,Internet) 172.18.139.251 212.$

ASA/act(config)# static (outside,inside) 172.18.139.251 212.x.y.12 netmask 255.255.255.255


source --> FWSM --> ASA (DNAT,SNAT)--> (IPSEC tunnel) --> destination


ASA/act(config)# packet-tracer input inside tcp 172.31.224.1 1024 212.x.y.12 22         

Phase: 1
Type: FLOW-LOOKUP
Subtype:
Result: ALLOW
Config:
Additional Information:
Found no matching flow, creating a new flow

Phase: 2
Type: ROUTE-LOOKUP
Subtype: input
Result: ALLOW
Config:
Additional Information:
in   0.0.0.0         0.0.0.0         outside

Phase: 3
Type: IP-OPTIONS
Subtype:
Result: ALLOW
Config:
Additional Information:

Phase: 4
Type: FOVER  
Subtype: standby-update
Result: ALLOW
Config:
Additional Information:

Phase: 5
Type: NAT
Subtype:
Result: ALLOW
Config:
nat (inside) 4402 access-list UK-R-NAT2
  match ip inside 172.31.224.0 255.255.240.0 outside host 212.x.y.12
    dynamic translation to pool 4402 (85.x.y.222)
    translate_hits = 2839, untranslate_hits = 0
Additional Information:
Dynamic translate 172.31.224.1/1024 to 85.x.y.222/49816 using netmask 255.255.255.255

Phase: 6
Type: NAT
Subtype: host-limits
Result: ALLOW
Config:
nat (inside) 31 access-list R-NAT
  match ip inside 172.31.224.0 255.255.240.0 outside host 62.x.y.20
    dynamic translation to pool 31 (85.x.y.224)
    translate_hits = 0, untranslate_hits = 0
Additional Information:

Phase: 7
Type: VPN
Subtype: encrypt
Result: ALLOW
Config:
Additional Information:

Phase: 8
Type: NAT
Subtype: rpf-check
Result: DROP
Config:
static (outside,inside) 172.18.139.251 212.x.y.12 netmask 255.255.255.255
  match ip outside host 212.x.y.12 inside any
    static translation to 172.18.139.251
    translate_hits = 0, untranslate_hits = 0
Additional Information:

Result:
input-interface: inside
input-status: up
input-line-status: up
output-interface: outside
output-status: up
output-line-status: up
Action: drop
Drop-reason: (acl-drop) Flow is denied by configured rule

ASA/act(config)#

ASA/act# packet-tracer input inside tcp 172.31.224.1 1024 172.18.139.251 22 detailed

Phase: 1
Type: FLOW-LOOKUP
Subtype:
Result: ALLOW
Config:
Additional Information:
Found no matching flow, creating a new flow

Phase: 2
Type: UN-NAT
Subtype: static
Result: ALLOW
Config:
static (outside,inside) 172.18.139.251 212.x.y.12 netmask 255.255.255.255
  match ip outside host 212.x.y.12 inside any
    static translation to 172.18.139.251
    translate_hits = 0, untranslate_hits = 5
Additional Information:
NAT divert to egress interface outside
Untranslate 172.18.139.251/0 to 212.x.y.12/0 using netmask 255.255.255.255

Phase: 3
Type: IP-OPTIONS
Subtype:
Result: ALLOW
Config:
Additional Information:
Forward Flow based lookup yields rule:
in  id=0x1a0a0028, priority=0, domain=permit-ip-option, deny=true
    hits=5197093697, user_data=0x0, cs_id=0x0, reverse, flags=0x0, protocol=0
    src ip=0.0.0.0, mask=0.0.0.0, port=0
    dst ip=0.0.0.0, mask=0.0.0.0, port=0, dscp=0x0

Phase: 4
Type: FOVER
Subtype: standby-update
Result: ALLOW
Config:
Additional Information:
Forward Flow based lookup yields rule:
in  id=0x1a0f1af8, priority=20, domain=lu, deny=false
    hits=6847147, user_data=0x0, cs_id=0x0, flags=0x0, protocol=6
    src ip=0.0.0.0, mask=0.0.0.0, port=0
    dst ip=0.0.0.0, mask=0.0.0.0, port=0, dscp=0x0

Phase: 5
Type: NAT
Subtype: host-limits
Result: ALLOW
Config:
nat (inside) 31 access-list R-NAT
  match ip inside 172.31.224.0 255.255.240.0 outside host 62.x.y.20
    dynamic translation to pool 31 (85.x.y.224)
    translate_hits = 0, untranslate_hits = 0
Additional Information:
Forward Flow based lookup yields rule:
in  id=0x1ae6b778, priority=2, domain=host, deny=false
    hits=9298, user_data=0x1ae4e5c0, cs_id=0x0, reverse, flags=0x0, protocol=0
    src ip=172.31.224.0, mask=255.255.240.0, port=0
    dst ip=0.0.0.0, mask=0.0.0.0, port=0, dscp=0x0

Phase: 6
Type: NAT
Subtype: rpf-check
Result: ALLOW
Config:
static (outside,inside) 172.18.139.251 212.x.y.12 netmask 255.255.255.255
  match ip outside host 212.x.y.12 inside any
    static translation to 172.18.139.251
    translate_hits = 0, untranslate_hits = 5
Additional Information:
Forward Flow based lookup yields rule:
out id=0x1c213558, priority=5, domain=nat-reverse, deny=false
    hits=12, user_data=0x1b657da0, cs_id=0x0, flags=0x0, protocol=0
    src ip=0.0.0.0, mask=0.0.0.0, port=0
    dst ip=212.x.y.12, mask=255.255.255.255, port=0, dscp=0x0

Phase: 7
Type: NAT
Subtype: host-limits
Result: ALLOW
Config:
static (outside,inside) 172.18.139.251 212.x.y.12 netmask 255.255.255.255
  match ip outside host 212.x.y.12 inside any
    static translation to 172.18.139.251
    translate_hits = 0, untranslate_hits = 5
Additional Information:
Reverse Flow based lookup yields rule:
in  id=0x1bbeab20, priority=5, domain=host, deny=false
    hits=17, user_data=0x1b657da0, cs_id=0x0, reverse, flags=0x0, protocol=0
    src ip=212.x.y.12, mask=255.255.255.255, port=0
    dst ip=0.0.0.0, mask=0.0.0.0, port=0, dscp=0x0

Phase: 8
Type: IP-OPTIONS
Subtype:
Result: ALLOW
Config:
Additional Information:
Reverse Flow based lookup yields rule:
in  id=0x1a0459e0, priority=0, domain=permit-ip-option, deny=true
    hits=5447198553, user_data=0x0, cs_id=0x0, reverse, flags=0x0, protocol=0
    src ip=0.0.0.0, mask=0.0.0.0, port=0
    dst ip=0.0.0.0, mask=0.0.0.0, port=0, dscp=0x0

Phase: 9
Type: FLOW-CREATION
Subtype:
Result: ALLOW
Config:
Additional Information:
New flow created with id 1158629055, packet dispatched to next module
Module information for forward flow ...
snp_fp_inspect_ip_options
snp_fp_tcp_normalizer
snp_fp_translate
snp_fp_adjacency
snp_fp_fragment
snp_fp_tracer_drop
snp_ifc_stat
             
Module information for reverse flow ...
snp_fp_inspect_ip_options
snp_fp_translate
snp_fp_tcp_normalizer
snp_fp_adjacency
snp_fp_fragment
snp_fp_tracer_drop
snp_ifc_stat

Phase: 10
Type: ROUTE-LOOKUP
Subtype: output and adjacency
Result: ALLOW
Config:
Additional Information:
found next-hop 85.x.y.1 using egress ifc outside
adjacency Active
next-hop mac address 0000.0c07.ac03 hits 29506

Result:
input-interface: inside
input-status: up
input-line-status: up
output-interface: outside
output-status: up
output-line-status: up
Action: allow

ASA/act#

the traffic is not being encrypted.

Does anyone have any suggestions?