4

I need help to resolve this issue. I have a Cisco ASA 5510 and I’m trying access to my webserver from internet but the connection does not work. Please find the network diagram below: enter image description here

I applied this configuration:

interface Ethernet0/0
 nameif dmz
 security-level 50
 ip address 172.16.16.1 255.255.255.0 

object network dmz-subnet
 subnet 172.16.16.0 255.255.255.0
 nat (dmz,outside) dynamic interface

object network webserver
host 172.16.16.2
nat (dmz,outside) static interface service tcp https https

object network dns-server
 host 10.3.7.5

access-list dmz_acl extended permit udp any object dns-server eq domain
access-list dmz_acl extended deny ip any object LanLOCAL
access-list dmz_acl extended permit ip any any
access-group dmz_acl in interface dmz

access-list outside_acl extended permit tcp any object webserver eq https
access-group outside_acl in interface outside

If I try the connection, the packets are allowed, here’s the packet-tracer result:

packet-tracer input outside tcp 192.0.2.123 12345 192.168.1.200 443

Phase: 1
Type: UN-NAT
Subtype: static
Result: ALLOW
Config:
object network webserver
 nat (dmz,outside) static interface service tcp https https 
Additional Information:
NAT divert to egress interface dmz
Untranslate 192.168.1.200/443 to 172.16.16.2/443

Phase: 2
Type: ACCESS-LIST
Subtype: log
Result: ALLOW
Config:
access-group outside_acl in interface outside
access-list outside_acl extended permit tcp any object webserver eq https 
Additional Information:

Phase: 3
Type: NAT
Subtype: per-session
Result: ALLOW
Config:
Additional Information:

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

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

Phase: 6
Type: NAT
Subtype: rpf-check
Result: ALLOW
Config:
object network webserver
 nat (dmz,outside) static interface service tcp https https 
Additional Information:

Phase: 7
Type: NAT
Subtype: per-session
Result: ALLOW
Config:
Additional Information:

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

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

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

A host on inside network can access to webserver. On my webserver, I can resolve name and I have access to internet. On my ISP router, I have created this route and this NAT rule:

network 172.16.16.0 netmask 255.255.255.0 gateway 192.168.1.200
protocol tcp external ip all external port 443 internal port 443 forward to 192.168.1.200

Below the full Cisco ASA configuration:

Result of the command: "sh run"

: Saved
:
ASA Version 9.1(5) 
!
hostname asa
domain-name NETWORK.local
enable password …………. encrypted
xlate per-session deny tcp any4 any4
xlate per-session deny tcp any4 any6
xlate per-session deny tcp any6 any4
xlate per-session deny tcp any6 any6
xlate per-session deny udp any4 any4 eq domain
xlate per-session deny udp any4 any6 eq domain
xlate per-session deny udp any6 any4 eq domain
xlate per-session deny udp any6 any6 eq domain
passwd …………………. encrypted
names
ip local pool PoolTest 192.168.37.1-192.168.37.50 mask 255.255.255.0
!
interface Ethernet0/0
 nameif dmz
 security-level 50
 ip address 172.16.16.1 255.255.255.0 
!
interface Ethernet0/1
 nameif inside
 security-level 100
 ip address 10.3.7.1 255.255.255.0 
!
interface Ethernet0/2
 nameif outside
 security-level 0
 ip address 192.168.1.200 255.255.255.0 
!
interface Ethernet0/3
 shutdown
 no nameif
 no security-level
 no ip address
!
interface Management0/0
 management-only
 nameif management
 security-level 100
 no ip address
!
boot system disk0:/asa915-k8.bin
ftp mode passive
clock timezone CEST 1
clock summer-time CEDT recurring last Sun Mar 2:00 last Sun Oct 3:00
dns server-group DefaultDNS
 domain-name NETWORK.local
object network obj_any
 subnet 0.0.0.0 0.0.0.0
object network NETWORK_OBJ_10.0.0.0_8
 subnet 10.0.0.0 255.0.0.0
object network LanLOCAL
 subnet 10.3.7.0 255.255.255.0
object network RemoteLANCust
 subnet 172.31.130.84 255.255.255.252
object network dmz-subnet
 subnet 172.16.16.0 255.255.255.0
object network webserver
 host 172.16.16.2
object network dns-server
 host 10.3.7.5
access-list dmz_acl extended permit udp any object dns-server eq domain 
access-list dmz_acl extended deny ip any object LanLOCAL 
access-list dmz_acl extended permit ip any any 
access-list outside_acl extended permit tcp any object webserver eq https 
access-list outside_cryptomap_2 extended permit ip 10.3.7.0 255.255.255.0 172.31.130.84 255.255.255.252 
pager lines 24
logging enable
logging trap notifications
logging asdm informational
logging host inside 10.3.3.100
mtu inside 1500
mtu outside 1500
mtu management 1500
mtu dmz 1500
icmp unreachable rate-limit 1 burst-size 1
asdm image disk0:/asdm-731.bin
no asdm history enable
arp timeout 14400
no arp permit-nonconnected
nat (inside,any) source static LanLOCAL LanLOCAL destination static RemoteLANCust RemoteLANCust no-proxy-arp route-lookup
!
object network dmz-subnet
 nat (dmz,outside) dynamic interface
object network webserver
 nat (dmz,outside) static interface service tcp https https 
!
nat (inside,outside) after-auto source dynamic LanLOCAL interface
access-group outside_acl in interface outside
access-group dmz_acl in interface dmz
route outside 0.0.0.0 0.0.0.0 192.168.1.1 1 
route inside 10.0.0.0 255.0.0.0 10.3.7.250 1 
timeout xlate 3:00:00
timeout pat-xlate 0:00:30
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
timeout tcp-proxy-reassembly 0:01:00
timeout floating-conn 0:00:00
dynamic-access-policy-record DfltAccessPolicy
user-identity default-domain LOCAL
aaa authentication ssh console LOCAL 
http server enable
http 10.0.0.0 255.0.0.0 inside
snmp-server host inside x.x.x.x community ***** version 2c
snmp-server location World
snmp-server contact [email protected]
snmp-server community *****
snmp-server enable traps snmp authentication linkup linkdown coldstart
crypto ipsec ikev1 transform-set ESP-AES-128-SHA esp-aes esp-sha-hmac 
crypto ipsec ikev1 transform-set ESP-AES-128-MD5 esp-aes esp-md5-hmac 
crypto ipsec ikev1 transform-set ESP-AES-192-SHA esp-aes-192 esp-sha-hmac 
crypto ipsec ikev1 transform-set ESP-AES-192-MD5 esp-aes-192 esp-md5-hmac 
crypto ipsec ikev1 transform-set ESP-AES-256-SHA esp-aes-256 esp-sha-hmac 
crypto ipsec ikev1 transform-set ESP-AES-256-MD5 esp-aes-256 esp-md5-hmac 
crypto ipsec ikev1 transform-set ESP-AES-128-SHA-TRANS esp-aes esp-sha-hmac 
crypto ipsec ikev1 transform-set ESP-AES-128-SHA-TRANS mode transport
crypto ipsec ikev1 transform-set ESP-AES-128-MD5-TRANS esp-aes esp-md5-hmac 
crypto ipsec ikev1 transform-set ESP-AES-128-MD5-TRANS mode transport
crypto ipsec ikev1 transform-set ESP-AES-192-SHA-TRANS esp-aes-192 esp-sha-hmac 
crypto ipsec ikev1 transform-set ESP-AES-192-SHA-TRANS mode transport
crypto ipsec ikev1 transform-set ESP-AES-192-MD5-TRANS esp-aes-192 esp-md5-hmac 
crypto ipsec ikev1 transform-set ESP-AES-192-MD5-TRANS mode transport
crypto ipsec ikev1 transform-set ESP-AES-256-SHA-TRANS esp-aes-256 esp-sha-hmac 
crypto ipsec ikev1 transform-set ESP-AES-256-SHA-TRANS mode transport
crypto ipsec ikev1 transform-set ESP-AES-256-MD5-TRANS esp-aes-256 esp-md5-hmac 
crypto ipsec ikev1 transform-set ESP-AES-256-MD5-TRANS mode transport
crypto ipsec ikev1 transform-set ESP-3DES-SHA esp-3des esp-sha-hmac 
crypto ipsec ikev1 transform-set ESP-3DES-MD5 esp-3des esp-md5-hmac 
crypto ipsec ikev1 transform-set ESP-3DES-SHA-TRANS esp-3des esp-sha-hmac 
crypto ipsec ikev1 transform-set ESP-3DES-SHA-TRANS mode transport
crypto ipsec ikev1 transform-set ESP-3DES-MD5-TRANS esp-3des esp-md5-hmac 
crypto ipsec ikev1 transform-set ESP-3DES-MD5-TRANS mode transport
crypto ipsec ikev1 transform-set ESP-DES-SHA esp-des esp-sha-hmac 
crypto ipsec ikev1 transform-set ESP-DES-MD5 esp-des esp-md5-hmac 
crypto ipsec ikev1 transform-set ESP-DES-SHA-TRANS esp-des esp-sha-hmac 
crypto ipsec ikev1 transform-set ESP-DES-SHA-TRANS mode transport
crypto ipsec ikev1 transform-set ESP-DES-MD5-TRANS esp-des esp-md5-hmac 
crypto ipsec ikev1 transform-set ESP-DES-MD5-TRANS mode transport
crypto ipsec ikev2 ipsec-proposal DES
 protocol esp encryption des
 protocol esp integrity sha-1 md5
crypto ipsec ikev2 ipsec-proposal 3DES
 protocol esp encryption 3des
 protocol esp integrity sha-1 md5
crypto ipsec ikev2 ipsec-proposal AES
 protocol esp encryption aes
 protocol esp integrity sha-1 md5
crypto ipsec ikev2 ipsec-proposal AES192
 protocol esp encryption aes-192
 protocol esp integrity sha-1 md5
crypto ipsec ikev2 ipsec-proposal AES256
 protocol esp encryption aes-256
 protocol esp integrity sha-1 md5
crypto ipsec security-association pmtu-aging 20
crypto map outside_map 3 match address outside_cryptomap_2
crypto map outside_map 3 set pfs 
crypto map outside_map 3 set peer a.b.c.d 
crypto map outside_map 3 set ikev1 transform-set ESP-AES-256-SHA
crypto map outside_map 3 set security-association lifetime seconds 3600
crypto map outside_map interface outside
crypto ca trustpool policy
crypto ikev2 policy 1
 encryption aes-256
 integrity sha
 group 5 2
 prf sha
 lifetime seconds 86400
crypto ikev2 policy 10
 encryption aes-192
 integrity sha
 group 5 2
 prf sha
 lifetime seconds 86400
crypto ikev2 policy 20
 encryption aes
 integrity sha
 group 5 2
 prf sha
 lifetime seconds 86400
crypto ikev2 policy 30
 encryption 3des
 integrity sha
 group 5 2
 prf sha
 lifetime seconds 86400
crypto ikev2 policy 40
 encryption des
 integrity sha
 group 5 2
 prf sha
 lifetime seconds 86400
crypto ikev2 enable outside
crypto ikev1 enable outside
crypto ikev1 policy 1
 authentication pre-share
 encryption aes-256
 hash sha
 group 2
 lifetime 7200
crypto ikev1 policy 10
 authentication crack
 encryption aes-256
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 20
 authentication rsa-sig
 encryption aes-256
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 30
 authentication pre-share
 encryption aes-256
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 40
 authentication crack
 encryption aes-192
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 50
 authentication rsa-sig
 encryption aes-192
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 60
 authentication pre-share
 encryption aes-192
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 70
 authentication crack
 encryption aes
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 80
 authentication rsa-sig
 encryption aes
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 90
 authentication pre-share
 encryption aes
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 100
 authentication crack
 encryption 3des
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 110
 authentication rsa-sig
 encryption 3des
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 120
 authentication pre-share
 encryption 3des
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 130
 authentication crack
 encryption des
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 140
 authentication rsa-sig
 encryption des
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 150
 authentication pre-share
 encryption des
 hash sha
 group 2
 lifetime 86400
telnet 10.0.0.0 255.0.0.0 inside
telnet timeout 5
ssh stricthostkeycheck
ssh 10.0.0.0 255.0.0.0 inside
ssh timeout 5
ssh key-exchange group dh-group1-sha1
console timeout 0
dhcpd option 3 ip 10.3.7.13
dhcpd option 6 ip 10.3.7.5 10.3.3.5
dhcpd option 42 ip 10.3.7.5 10.3.3.5
!
dhcpd address 10.3.7.225-10.3.7.249 inside
dhcpd dns 10.3.7.5 interface inside
dhcpd lease 28800 interface inside
dhcpd domain NETWORK.local interface inside
dhcpd enable inside
!
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
ntp server 10.3.7.5 source inside prefer
webvpn
 anyconnect image disk0:/anyconnect-win-3.1.07021-k9.pkg 1
 tunnel-group-list enable
group-policy GroupPolicy_a.b.c.d internal
group-policy GroupPolicy_a.b.c.d attributes
 vpn-tunnel-protocol ikev1 
group-policy GPTestTunnel internal
group-policy GPTestTunnel attributes
 vpn-tunnel-protocol ssl-client ssl-clientless
 webvpn
  url-list none
vpn-group-policy GPTestTunnel
tunnel-group a.b.c.d type ipsec-l2l
tunnel-group a.b.c.d general-attributes
 default-group-policy GroupPolicy_a.b.c.d
tunnel-group a.b.c.d ipsec-attributes
 ikev1 pre-shared-key *****
 ikev2 remote-authentication pre-shared-key *****
 ikev2 local-authentication 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 
  inspect ip-options 
!
service-policy global_policy global
prompt hostname context 
no call-home reporting anonymous
call-home
 profile CiscoTAC-1
  no active
  destination address http https://tools.cisco.com/its/service/oddce/services/DDCEService
  destination address email [email protected]
  destination transport-method http
  subscribe-to-alert-group diagnostic
  subscribe-to-alert-group environment
  subscribe-to-alert-group inventory periodic monthly
  subscribe-to-alert-group configuration periodic monthly
  subscribe-to-alert-group telemetry periodic daily
Cryptochecksum:ce659b6be45d89fb64381df17f7502f7
: end

Can anyone help me?

0

2 Answers 2

5

In this situation (ASA uses all private IPs), you should avoid doing NAT as much as possible.

  1. With your setup, the configuration looks fine and packet-tracer tells you that your static NAT for DMZ Web_Server is good.

    To test this out, put a laptop/PC in the network 192.168.1.0/24 between ASA outside interface and ISP router inside interface (you may need a switch here), then access the Web_Server at https://192.168.1.200 or using telnet 192.168.1.200 443 ...

    • If it works, you can again confirm everything is fine with the configuration and the issue is at ISP router. Ensure that ISP router is configured to forward traffic (source IP: any, source TCP port: any) hitting ISP router outside IP: 193.x.x.x at TCP port 443 to 192.168.1.200 at TCP port 443.

    • If it does not work, then the problem is at ASA. This is unlikely, as your configuration looks good.

    This setup requires you to configure NAT twice (on ASA and on ISP router), meaning traffic is NATted twice when you access the Web_Server from public network.

  2. Another approach is to NOT doing NAT at all on ASA.

    As I mentioned earlier, your ASA uses all private IPs, you can configure ISP router to handle all NATs (PAT for internal network to access the Internet - as it is doing; and static NAT for Web_Server). In this case, ASA acts like an internal router with ACL rules on it (no NAT statements at all).

    From the public network, you can access the Web_Server through https://193.x.x.x, this traffic then is forwarded directly to your Web_Server real IP address - 172.16.16.2.

I hope it is helpful and you can find out where the issue is.

5
  • thank you so much for your good explanation. I'll try tomorrow and I'll tell you if I fixed the issue.
    – Julien
    Nov 12, 2017 at 19:32
  • It works ! But I can't access to my webserver from inside host with my public IP. Do you know how to allow the traffic?
    – Julien
    Nov 13, 2017 at 18:56
  • @Julien Glad to hear it works. And yes, you can also access your Web_Server (with public IP address) from inside hosts with this nat statement nat (dmz,inside) static 193.x.x.x service tcp https https under object network webserver. When an inside host accesses this public IP, ASA translates it to dmz Web_Server real IP and forwards the traffic directly to the Web_Server.
    – Hung Tran
    Nov 14, 2017 at 0:19
  • Thank you, but I can't add 2 nat rules under my object network webserver. I added your nat statement and the first nat rule was remplaced. I think I have to add a global rule. I'll try this.
    – Julien
    Nov 14, 2017 at 6:28
  • @Julien Okay. Another the trick is that you can create another similar object network for dmz Web_Server (with different name, let us say object network webserver_inside), then put the new NAT under this new object.
    – Hung Tran
    Nov 14, 2017 at 8:32
0

You can try to replace:

object network dmz-subnet
 subnet 172.16.16.0 255.255.255.0
 nat (dmz,outside) dynamic interface

By:

nat (dmz,outside) after-auto source dynamic any interface
1
  • Thank you but it doesn't work. I tried to change the http port of ASA but it doesn't work either. Any ideas?
    – Julien
    Nov 12, 2017 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.