Link to home
Start Free TrialLog in
Avatar of Pv020396
Pv020396

asked on

Cisco 5505 to Azure site to site IPsec problem

Hi everyone,

I'm having difficulties setting up site to site to windows Azure from cisco 5505.

Here's the setup:
Public IP is 116.254.102.xx
Azure gateway is 168.63.250.xx
IP from ISP private is 11.24.10.46
Gateway from ISP is 11.24.10.45
Local network is 192.168.0.0/24
Azure is 192.168.6.0/24

Here is my running configuration.

On the log it says UDP is blocked from Azure gateway to my public IP on port 500.

Please help. Thanks in advance.

: Saved
:
ASA Version 8.4(4)1
!
hostname CiscoFW
enable password 8Ry2YjIyt7RRXU24 encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
!
interface Ethernet0/0
switchport access vlan 2
!
interface Ethernet0/1
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
!
interface Vlan1
nameif inside
security-level 100
ip address 192.168.0.2 255.255.255.0
!
interface Vlan2
nameif outside
security-level 0
ip address 11.24.10.46 255.0.0.0
!
ftp mode passive
dns domain-lookup outside
dns domain-lookup inside
dns server-group DefaultDNS
name-server 116.254.101.2
object network obj_any
subnet 0.0.0.0 0.0.0.0
object network 116.254.102.xx
host 116.254.102.xx
object network 11.24.10.45
host 11.24.10.45
object-group network AzureNetwork
network-object 192.168.6.0 255.255.255.0
object-group network BetaOnpremise
network-object 192.168.0.0 255.255.255.0
access-list AzureAccessList extended permit ip object-group BetaOnpremise object-group AzureNetwork
pager lines 24
logging enable
logging asdm informational
mtu outside 1500
mtu inside 1500
no failover
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
!
nat (inside,outside) after-auto source dynamic any 116.254.102.xx
route outside 0.0.0.0 0.0.0.0 11.24.10.45 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
http server enable
http 192.168.0.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart warmstart
sysopt connection tcpmss 1350
crypto ipsec ikev1 transform-set Azure_IPSecTransformSet esp-aes esp-sha-hmac
crypto ipsec security-association lifetime seconds 3600
crypto ipsec security-association lifetime kilobytes 102400000
crypto map Azure_IPSecCryptoMap 1 match address AzureAccessList
crypto map Azure_IPSecCryptoMap 1 set peer 168.63.250.xx
crypto map Azure_IPSecCryptoMap 1 set ikev1 transform-set Azure_IPSecTransformSet
crypto map Azure_IPSecCryptoMap 1 set reverse-route
crypto map Azure_IPSecCryptoMap interface outside
crypto ikev1 enable outside
crypto ikev1 policy 10
authentication pre-share
encryption aes
hash sha
group 2
lifetime 28800
telnet timeout 5
ssh timeout 5
ssh key-exchange group dh-group1-sha1
console timeout 0

dhcpd auto_config outside
!
dhcpd address 192.168.0.6-192.168.0.254 inside
dhcpd dns 8.8.8.8 interface inside
dhcpd enable inside
!
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
tunnel-group 168.63.250.xx type ipsec-l2l
tunnel-group 168.63.250.xx ipsec-attributes
ikev1 pre-shared-key *****
!
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum client auto
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
call-home reporting anonymous prompt 2
Cryptochecksum:484d479fb6460a44a2636e6bb1463f3a
: end
no asdm history enable
Avatar of agonza07
agonza07
Flag of United States of America image

Did you follow this doc? It can build your Cisco Config for you.

http://msdn.microsoft.com/en-us/library/windowsazure/jj156210#bkmk_ConfigVPN
Avatar of Pv020396
Pv020396

ASKER

Hi Agonza, thanks for replying.

Yes, we followed the site you recommended above, and also followed this script:
http://msdn.microsoft.com/en-us/library/windowsazure/jj156089

Before using ASA 5505, we were using mikrotik, and the IPSec site to site VPN worked fine although sometime it would disconnect and be slow. This is why we changed to ASA 5505.

However, the person from the ISP who setup the ASA 5505 for internet access is not an expert at Cisco. The internet works at this moment, but we suspect the way he has set the NAT/PAT could be causing this failure. If we go to check our public IP on 'what's my IP' website, it comes up correctly though as that 116.254.102.xx

When I type "show crypto isakmp sa" it says:
There are no IKEv1 SAs
There are no IKEv2 SAs

Is this possible? The way the NAT/PAT is setup is causing this?
You are missing the no nat or twice nat statement.
Hi rauenpc, thanks for the reply.

I'm not very good at cisco at all, so after searching on the net, I tried this, but still doesn't work. Is this what you mean?

nat (inside, outside) source static BetaOnpremise BetaOnpremise destination static AzureNetwork AzureNetwork

I have also checked the log again, and it still says that:
"Deny Inbound UDP from 168.63.250.xx/500 to 0.0.0.0/500 on interface outside"

(168.63.250.xx) is the Azure Gateway.

I've tried adding ACLs (is this what I'm supposed to do?) but it didn't work. Maybe I'm not doing this properly though.

Thanks.
That is the correct nat statement as far as I can tell.

The crypto map along with enabling ikev1 on the interface supersedes any acl you have in place, so there shouldn't be a need to add any interface acl's.

 The destination the azure must be configured for will be the ip configured on the outside interface which for you is 11.24.10.46. The only way around this is to have a nat device in front of the Asa, which can sometimes cause additional challenges.

Is the azure configured for the 11.24.10.46 address or 116.254.102.x?
Hi rauenpc, thanks for the super fast reply. I have changed the azure to the 11.24 (it was the 116.254 before). It still doesn't work.

But when I open a website 'what's my ip', it shows the 116.254. Is this how we're supposed to set it?
Hi,

you need group policy config:

group-policy DfltGrpPolicy attributes
 vpn-tunnel-protocol ikev1 l2tp-ipsec ssl-client ssl-clientless

you need same ike policy on booth sides:

crypto ikev2 enable outside
crypto ikev1 enable outside
crypto ikev1 ipsec-over-tcp port 10000 
crypto ikev1 policy 5
 authentication rsa-sig
 encryption aes-256
 hash sha
 group 5
 lifetime 86400
crypto ikev1 policy 10
 authentication pre-share
 encryption 3des
 hash sha
 group 2
 lifetime 86400
crypto ikev1 policy 40
 authentication pre-share
 encryption 3des
 hash md5
 group 1
 lifetime 86400
crypto ikev1 policy 50
 authentication pre-share
 encryption des
 hash md5
 group 2
 lifetime 86400
crypto ikev1 policy 65535
 authentication pre-share
 encryption 3des
 hash sha
 group 2
 lifetime 86400

Open in new window


you need to create double nat for IPSEC traffic:

object-group network AzureNetwork
network-object 192.168.6.0 255.255.255.0
object-group network BetaOnpremise
network-object 192.168.0.0 255.255.255.0
nat (inside,any) source static AzureNetwork AzureNetwork destination static BetaOnpremise BetaOnpremise

Open in new window

Hi Ikalmar (and Rauenpc), I have tried adding group policy, ike policy and double nat as per your solution, but I still get the same error:

"Deny Inbound UDP from 168.63.250.xx/500 to 0.0.0.0/500 on interface outside"

I have then reset everything back and re run the config script from Microsoft. Here's my final running config. Still the same error as above though.

: Saved
:
ASA Version 8.4(4)1
!
hostname CiscoFW
domain-name BETA.xx.xx
enable password r5pjmbuPbmjfkxyd encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
!
interface Ethernet0/0
 switchport access vlan 2
!
interface Ethernet0/1
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
!
interface Vlan1
 nameif inside
 security-level 100
 ip address 192.168.0.2 255.255.255.0
!
interface Vlan2
 nameif outside
 security-level 0
 ip address 11.24.10.46 255.0.0.0
!
ftp mode passive
dns domain-lookup outside
dns domain-lookup inside
dns server-group DefaultDNS
 name-server 116.254.101.2
 domain-name BETA.xx.xx
object network obj_any
 subnet 0.0.0.0 0.0.0.0
object network 116.254.102.xx
 host 116.254.102.xx
object network 11.24.10.45
 host 11.24.10.45
object network 168.63.250.xx
 host 168.63.250.xx
object-group network AzureNetwork
 network-object 192.168.6.0 255.255.255.0
object-group network BetaOnpremise
 network-object 192.168.0.0 255.255.255.0
access-list AzureAccessList extended permit ip object-group BetaOnpremise object-group AzureNetwork log debugging
access-list outside_access_in extended permit esp any any
access-list outside_access_in extended permit udp object 168.63.250.xx any
access-list outside_access_in extended permit udp object 168.63.250.xx any eq isakmp
pager lines 24
logging enable
logging asdm informational
mtu outside 1500
mtu inside 1500
no failover
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
nat (inside,outside) source static BetaOnpremise BetaOnpremise destination static AzureNetwork AzureNetwork
nat (inside,outside) source static any 116.254.102.xx
route outside 0.0.0.0 0.0.0.0 11.24.10.45 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 enable console LOCAL
aaa authentication ssh console LOCAL
http server enable
http 192.168.0.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart warmstart
sysopt connection tcpmss 1350
crypto ipsec ikev1 transform-set Azure_IPSecTransformSet esp-aes esp-sha-hmac
crypto ipsec security-association lifetime seconds 3600
crypto ipsec security-association lifetime kilobytes 102400000
crypto map Azure_IPSecCryptoMap 1 match address AzureAccessList
crypto map Azure_IPSecCryptoMap 1 set peer 168.63.250.xx
crypto map Azure_IPSecCryptoMap 1 set ikev1 transform-set Azure_IPSecTransformSet
crypto map Azure_IPSecCryptoMap 1 set reverse-route
crypto map Azure_IPSecCryptoMap interface outside
crypto ikev1 enable outside
crypto ikev1 policy 10
 authentication pre-share
 encryption aes
 hash sha
 group 2
 lifetime 28800
telnet timeout 5
ssh 192.168.0.0 255.255.255.0 inside
ssh timeout 5
ssh key-exchange group dh-group1-sha1
console timeout 0

dhcpd auto_config outside
!
dhcpd address 192.168.0.6-192.168.0.254 inside
dhcpd dns 8.8.8.8 interface inside
dhcpd enable inside
!
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
group-policy DfltGrpPolicy attributes
 vpn-tunnel-protocol ikev1 ikev2 l2tp-ipsec ssl-client ssl-clientless
username paul.somadjaja password IimsKcHNK3W5HLxb encrypted
tunnel-group 168.63.250.xx type ipsec-l2l
tunnel-group 168.63.250.xx ipsec-attributes
 ikev1 pre-shared-key *****
!
class-map inspection_default
 match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
 parameters
  message-length maximum client auto
  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
call-home reporting anonymous prompt 2
Cryptochecksum:d424293057efd21df39f6114936ed276
: end
no asdm history enable
Hi Rauenpc, I think you might be on to something. When I configure azure for the 11.24.10.46 address instead of the 116.254.102.x, the error (that it's being blocked on UDP 500) doesn't show anymore.

What should I do next? I'm still not connected. Should I send some logs/debug? How do I get the logs/debug?

I also tried the packet trace from local network to azure network. It says packet dropped. I assume this is bad?
question-expert-exchange.jpg
please debug:

deb cry ikev1 128
deb cry ips 128
Hi ikalmar and all, what I've done now is:
- Reset cisco to factory settings
- Asked the ISP to give me a public IP (no more P2P) so I can put this on the outside interface
- Put the script from Microsoft Azure

The good news is that IPSec now works, but we can't access the internet/the azure network (ping doesn't work).

So now I hope it's just a simple nat/acl problem. How do I get access to internet? Strangely it was working when it was using the P2P using the private IP from the ISP.

I have setup the default route, but maybe there's something wrong with the PAT/NAT? When I do a packet trace it says packet dropped by acl.

Current config is:
: Saved
:
ASA Version 8.4(4)1
!
hostname ciscoasa
enable password r5pjmbuPbmjfkxyd encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
!
interface Ethernet0/0
 switchport access vlan 2
!
interface Ethernet0/1
!
interface Ethernet0/2
!
interface Ethernet0/3
!
interface Ethernet0/4
!
interface Ethernet0/5
!
interface Ethernet0/6
!
interface Ethernet0/7
!
interface Vlan1
 nameif inside
 security-level 90
 ip address 192.168.0.1 255.255.255.0
!
interface Vlan2
 nameif outside
 security-level 0
 ip address 116.254.102.xx 255.255.255.248
!
ftp mode passive
object network obj_any
 subnet 0.0.0.0 0.0.0.0
object-group network AzureNetwork
 network-object 192.168.6.0 255.255.255.0
object-group network BetaOnpremise
 network-object 192.168.0.0 255.255.255.0
access-list AzureAccessList extended permit ip object-group BetaOnpremise object-group AzureNetwork
pager lines 24
logging enable
logging asdm informational
mtu outside 1500
mtu inside 1500
no failover
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
nat (inside,outside) source dynamic obj_any interface
route outside 0.0.0.0 0.0.0.0 116.254.102.70 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
http server enable
http 192.168.0.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart warmstart
sysopt connection tcpmss 1350
crypto ipsec ikev1 transform-set Azure_IPSecTransformSet esp-aes esp-sha-hmac
crypto ipsec security-association lifetime seconds 3600
crypto ipsec security-association lifetime kilobytes 102400000
crypto map Azure_IPSecCryptoMap 1 match address AzureAccessList
crypto map Azure_IPSecCryptoMap 1 set peer 168.63.250.xx
crypto map Azure_IPSecCryptoMap 1 set ikev1 transform-set Azure_IPSecTransformSet
crypto map Azure_IPSecCryptoMap 1 set reverse-route
crypto map Azure_IPSecCryptoMap interface outside
crypto ikev1 enable outside
crypto ikev1 policy 10
 authentication pre-share
 encryption aes
 hash sha
 group 2
 lifetime 28800
telnet timeout 5
ssh timeout 5
ssh key-exchange group dh-group1-sha1
console timeout 0

dhcpd auto_config outside
!
dhcpd address 192.168.0.5-192.168.0.254 inside
dhcpd enable inside
!
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
tunnel-group 168.63.250.xx type ipsec-l2l
tunnel-group 168.63.250.xx ipsec-attributes
 ikev1 pre-shared-key *****
!
class-map inspection_default
 match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
 parameters
  message-length maximum client auto
  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
call-home reporting anonymous prompt 2
Cryptochecksum:2ccfdfb45e9a712688a04c32cbb38c9b
: end
no asdm history enable
ASKER CERTIFIED SOLUTION
Avatar of rauenpc
rauenpc
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Rauenpc, thanks for your response. Unfortunately it doesn't work still. Please see current config attached in this message as well as packet tracer.

Internet doesn't work (unable to ping to gateway from inside).

IPSec still connected but still no ping doable.

Do I need to add acls? I haven't modified any acls yet.
packet-tracer.png
cisco-config.txt
cisco-nat.png
The reason we failed is because we were using pings to test for internet connectivity. Pings still doesnt work but internet works. Sorry for the confusion. Now both ipsec site to site and internet works.