<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Troubleshoot Archives - Think Netsec</title>
	<atom:link href="https://www.thinknetsec.com/tag/troubleshoot/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.thinknetsec.com/tag/troubleshoot/</link>
	<description>Think Network Security</description>
	<lastBuildDate>Fri, 09 Nov 2018 17:16:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>

<image>
	<url>https://www.thinknetsec.com/wp-content/uploads/2017/08/cropped-ThinkNetsec-Full-Logo-1-32x32.png</url>
	<title>Troubleshoot Archives - Think Netsec</title>
	<link>https://www.thinknetsec.com/tag/troubleshoot/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">133674323</site>	<item>
		<title>ISAKMP (IKE Phase 1) Status Messages MM_WAIT_MSG</title>
		<link>https://www.thinknetsec.com/isakmp-ike-phase-1-status-messages-mm_wait_msg/</link>
					<comments>https://www.thinknetsec.com/isakmp-ike-phase-1-status-messages-mm_wait_msg/#respond</comments>
		
		<dc:creator><![CDATA[John Finnegan]]></dc:creator>
		<pubDate>Mon, 27 Aug 2018 16:07:32 +0000</pubDate>
				<category><![CDATA[ASA]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[IKE]]></category>
		<category><![CDATA[isakmp]]></category>
		<category><![CDATA[MM_WAIT]]></category>
		<category><![CDATA[Phase 1]]></category>
		<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[VPN]]></category>
		<guid isPermaLink="false">https://www.thinknetsec.com/?p=524</guid>

					<description><![CDATA[<p>ISAKMP (IKE Phase 1) Status Messages MM_WAIT_MSG To establish Phase 1 of a IKE VPN, 6 messages need to be sent between the 2 peers before it can complete. Sometimes when you try to establish a VPN, you will see that the VPN gets stuck at one of these MM_WAIT_MSGs.<a class="moretag" href="https://www.thinknetsec.com/isakmp-ike-phase-1-status-messages-mm_wait_msg/"> Read more&#8230;</a></p>
<p>The post <a href="https://www.thinknetsec.com/isakmp-ike-phase-1-status-messages-mm_wait_msg/">ISAKMP (IKE Phase 1) Status Messages MM_WAIT_MSG</a> appeared first on <a href="https://www.thinknetsec.com">Think Netsec</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div id="pl-524"  class="panel-layout" ><div id="pg-524-0"  class="panel-grid panel-no-style" ><div id="pgc-524-0-0"  class="panel-grid-cell" ><div id="panel-524-0-0-0" class="so-panel widget widget_sow-editor panel-first-child panel-last-child" data-index="0" ><div
			
			class="so-widget-sow-editor so-widget-sow-editor-base"
			
		>
<div class="siteorigin-widget-tinymce textwidget">
	<h2><strong>ISAKMP (IKE Phase 1) Status Messages MM_WAIT_MSG</strong></h2>
<p>To establish Phase 1 of a IKE VPN, 6 messages need to be sent between the 2 peers before it can complete. Sometimes when you try to establish a VPN, you will see that the VPN gets stuck at one of these MM_WAIT_MSGs. I will break down each message below and what it may signify if the VPN is stuck at one of these messages.</p>
<p>You can see the status of Phase by looking at the 'show isakmp sa' output. If you have several tunnels then you may want to start the output at your Peer IP 'show isakmp sa | begin X.X.X.X' where X.X.X.X is the Peer IP you are trying to troubleshoot.</p>
<p>&nbsp;</p>
<pre>ASA-LAB1# show isakmp sa                                                 

IKEv1 SAs:

   Active SA: 1
    Rekey SA: 0 (A tunnel will report 1 Active and 1 Rekey SA during rekey)
Total IKE SA: 1

1   IKE Peer: 50.56.229.98
    Type    : L2L             Role    : initiator 
    Rekey   : no              State   : MM_ACTIVE</pre>
<p>&nbsp;</p>
<pre>ASA-LAB1# show isakmp sa | begin 50.56.229.98
1   IKE Peer: 50.56.229.98
    Type    : L2L             Role    : initiator 
    Rekey   : no              State   : MM_ACTIVE</pre>
<h2><strong>MM_WAIT_MSG2 (Initiator)</strong></h2>
<p>The initiating peer will send message one and will be in a MM_WAIT_MSG2 state. In the initial message, it is sending its Encryption, Hash, DH Group and Lifetime Policy details to the Remote Peer. If you see that you are stuck at this message then this means that the other side is not responding to your requests. This could be that Remote Peer is blocking UDP port 500, they are not configured to listen for IKE traffic or you are not able to reach the peer due to routing issues.</p>
<p>Checking with the Remote side to see if they are getting your message 1 is a good first step. If they state they see MM_WAIT_MSG3, then refer to MM_WAIT_MSG3 below.</p>
<pre>ASA-LAB1#   show isakmp sa

IKEv1 SAs:

   Active SA: 1
    Rekey SA: 0 (A tunnel will report 1 Active and 1 Rekey SA during rekey)
Total IKE SA: 1

1   IKE Peer: 50.56.229.98
    Type    : user            Role    : initiator 
    Rekey   : no              State   : <strong>MM_WAIT_MSG2</strong></pre>
<h2></h2>
<h2><strong>MM_WAIT_MSG3 (Responder)</strong></h2>
<p>The Responding peer has responded with message two and will be stuck in a MM_WAIT_MSG3 state. This should rarely happen because if Message 2 was sent back to the peer, then the initiating peer should be able to respond with Message 3. This can happen for a few reasons but the most common is ISP issues. This can be the route back to the initiating peer or UDP 500 could be blocked from the Responding Peer to the Initiating Peer on their edge. Have the Peer with this message check that UDP 500 is allowed from their environment and that they are not having any routing issues back to the Initiating peer.</p>
<pre>ASA-LAB2(config)# show isakmp sa

IKEv1 SAs:

   Active SA: 1
    Rekey SA: 0 (A tunnel will report 1 Active and 1 Rekey SA during rekey)
Total IKE SA: 1

1   IKE Peer: 50.57.228.150
    Type    : user            Role    : responder 
    Rekey   : no              State   : <strong>MM_WAIT_MSG3</strong></pre>
<h2></h2>
<h2><strong>MM_WAIT_MSG4 (Initiator)</strong></h2>
<p>At this point, the Initiating and Responding Peers have agreed on the IKE Policy (Encryption, Hash, DH Group) and are beginning the process of checking if they trust the Peers IP address. The initiator here has sent Message 3 which will begin the process of trusting eachothers peer IPs. There is more that goes on here but all you really need to know is that the tunnel-groups need to exist for this phase to complete. If the VPN is at this message, then the other side most likely does not have the Initiators IP configured as a tunnel-group and is dropping the request. The best thing to do here is confirm that the Remote Peer has the right Peer IP configured in the tunnel-group settings.</p>
<pre>ASA-LAB1# show isakmp sa

IKEv1 SAs:

   Active SA: 1
    Rekey SA: 0 (A tunnel will report 1 Active and 1 Rekey SA during rekey)
Total IKE SA: 1

1   IKE Peer: 50.56.229.98
    Type    : user            Role    : initiator 
    Rekey   : no              State   : <strong>MM_WAIT_MSG4</strong></pre>
<h2></h2>
<h2><strong>MM_WAIT_MSG5 (Responder)</strong></h2>
<p>At this phase, Message 4 was sent back to the Initiator and the Responder is waiting for Message 5. This means that the Ike Policies match and both Sides have their Peer IPs set correctly as tunnel-groups. If this message is present then the Pre-shared keys between the 2 peers do not match or that the Initiator does not have a pre-shared key defined at all. All settings are valid except for Pre-shared keys at this point. You will want to validate that the keys match between both peers and possibly look at special characters or spaces as these can be problematic for some termination devices.</p>
<pre>ASA-LAB2# show isakmp sa

IKEv1 SAs:

   Active SA: 1
    Rekey SA: 0 (A tunnel will report 1 Active and 1 Rekey SA during rekey)
Total IKE SA: 1

1   IKE Peer: 50.57.228.150
    Type    : L2L             Role    : responder 
    Rekey   : no              State   : <strong>MM_WAIT_MSG5</strong></pre>
<h2><strong>MM_WAIT_MSG6 (Initiator)</strong></h2>
<p>This message indicates that the Pre-shared keys do not match between the peers. The initiator has sent message 5 to the Remote Peer and the Remote peer was not able to validate the Pre-shared key and doesn't respond. The best thing to do here is work with the Remote side to confirm the Pre-shared keys. When validating the Pre-shared keys, look at special characters or spaces as these can be problematic for some termination devices.</p>
<pre>ASA-LAB1# show isakmp sa

IKEv1 SAs:

   Active SA: 1
    Rekey SA: 0 (A tunnel will report 1 Active and 1 Rekey SA during rekey)
Total IKE SA: 1

1   IKE Peer: 50.56.229.98
    Type    : user            Role    : initiator 
    Rekey   : no              State   : <strong>MM_WAIT_MSG6

</strong></pre>
<p>For more references for troubleshooting VPNs please check out my <a href="https://www.thinknetsec.com/vpn-troubleshoot-ikev1-site-to-site/">VPN Troubleshoot</a> Article or my <a href="https://www.thinknetsec.com/asa-ipsec-vpn-no-proposal-chosen/">No Proposal Chosen</a> Article.</p>
<p><span>If you would like to know more or see more articles on VPNs, please let me know. You can </span><a href="https://www.thinknetsec.com/contact/">contact</a><span> me and I will do what I can to help.</span></p>
</div>
</div></div></div></div></div><p>The post <a href="https://www.thinknetsec.com/isakmp-ike-phase-1-status-messages-mm_wait_msg/">ISAKMP (IKE Phase 1) Status Messages MM_WAIT_MSG</a> appeared first on <a href="https://www.thinknetsec.com">Think Netsec</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thinknetsec.com/isakmp-ike-phase-1-status-messages-mm_wait_msg/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">524</post-id>	</item>
		<item>
		<title>VPN Troubleshoot (IKEv1 Site to Site)</title>
		<link>https://www.thinknetsec.com/vpn-troubleshoot-ikev1-site-to-site/</link>
					<comments>https://www.thinknetsec.com/vpn-troubleshoot-ikev1-site-to-site/#respond</comments>
		
		<dc:creator><![CDATA[John Finnegan]]></dc:creator>
		<pubDate>Mon, 20 Aug 2018 20:25:26 +0000</pubDate>
				<category><![CDATA[ASA]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[IPSEC]]></category>
		<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[VPN]]></category>
		<guid isPermaLink="false">https://www.thinknetsec.com/?p=505</guid>

					<description><![CDATA[<p>VPN Troubleshoot (IKEv1 Site to Site) When troubleshooting VPNs, the easiest way to figure out what is wrong with the VPN is to have the other side send traffic. This will allow you to narrow down their settings, assuming that the remote side has their side configured correctly and has<a class="moretag" href="https://www.thinknetsec.com/vpn-troubleshoot-ikev1-site-to-site/"> Read more&#8230;</a></p>
<p>The post <a href="https://www.thinknetsec.com/vpn-troubleshoot-ikev1-site-to-site/">VPN Troubleshoot (IKEv1 Site to Site)</a> appeared first on <a href="https://www.thinknetsec.com">Think Netsec</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1><strong>VPN Troubleshoot (IKEv1 Site to Site)</strong></h1>
<p>When troubleshooting VPNs, the easiest way to figure out what is wrong with the VPN is to have the other side send traffic. This will allow you to narrow down their settings, assuming that the remote side has their side configured correctly and has routing correct.</p>
<p>What I will cover here is building a VPN strictly from debug output alone. The only thing that is not able to be learned via debugs is the pre-shared key so make sure that this is accurate. Most of this article will be assuming that no other VPNs are configured on the ASA currently. If you wish to see more about Site to Site VPN Configuration, check out my <a href="https://www.thinknetsec.com/basic-site-to-site-ikev1/">Site to Site Article</a>.</p>
<h2><strong>What is needed to begin</strong></h2>
<p>Check to see if your Firewall already has IKEv1 VPNs configured and, if not, enable IKEv1. The quickest way to verify is to run the following:</p>
<pre>show run crypto | include enable</pre>
<p>This will show you which interfaces are enabled for IKEv1 (or IKEv2).</p>
<p>If nothing is enabled, then you will need to enable IKEv1 on the appropriate interface. In this case, it is the OUTSIDE interface.</p>
<pre>crypto isakmp enable OUTSIDE (Pre 8.3)
crypto ikev1 enable OUTSIDE (Post 8.3)</pre>
<h5><strong>&#8211; Verify</strong></h5>
<pre>ASA-LAB1(config)# show run crypto | include enable
crypto ikev1 enable OUTSIDE</pre>
<p>After you have enabled IKEv1, make sure that you have the Pre-shared key noted somewhere as this will be needed to configure the VPN.</p>
<h2><strong>Using Debugs to determine the Peer IP</strong></h2>
<p>Sometimes the Remote location may provide the wrong Peer IP. In this case, we are assuming the Peer IP provided is incorrect but the Remote side states they are trying to build the VPN currently. By enabling debugs for crypto messages, you can determine the possible peer IP.</p>
<p>There are several different debug types and varying degrees on the verbosity of the debugs but for this portion, we only need debugs for ISAKMP messages.</p>
<p>To enable this, we need the following</p>
<pre>debug crypto isakmp 2 (Pre 8.3)
debug crypto ikev1 2 (Post 8.3)</pre>
<p>If the other side is trying to build the tunnel, you should see a message like the following. (Note: If you have other VPNs already configured, you will also see messages from these tunnels. Try to ignore any existing peers messages and find the IP the presents a similar message below. The one referenced is specifically showing that no map is applied to the interface at all to match against. This could state anything such as no proposal chosen or does not match an existing map)</p>
<pre>ASA-LAB1# debug cry ikev1 2
ASA-LAB1# Aug 20 15:55:14 [IKEv1]IP = 50.56.229.98, No crypto map bound to interface... dropping pkt
Aug 20 15:55:22 [IKEv1]IP = 50.56.229.98, No crypto map bound to interface... dropping pkt</pre>
<p>Assuming that this peer IP is the Clients Peer IP, we can now try to add some of the configuration for this peer. To turn off debugs, run the following command</p>
<pre>undebug all</pre>
<p>If you are not seeing any debugs then make sure there are no control plane ACLs applied to the interface. You can confirm this by performing the following. If you see something appear like there is below then you will need to make sure that UDP port 500 is permitted along with the ESP protocol in the applied ACL.</p>
<pre class="p1"><span class="s1">ASA-LAB1(config)# show run access-group | i control-plane
</span><span class="s1">access-group 100 in interface OUTSIDE control-plane</span></pre>
<h2><strong>Configure Tunnel Group and add a Crypto Map</strong></h2>
<p>By creating the Tunnel group, the ASA can try to build Phase 1 of the VPN tunnel. In this case, the Pre-shared key is Th1nkN3tSec.</p>
<pre>tunnel-group 50.56.229.98 type ipsec-l2l
tunnel-group 50.56.229.98 ipsec-attributes
    ikev1 pre-shared-key Th1nkN3tSec</pre>
<p>Verify there is not a map currently being used for the OUTSIDE interface.</p>
<pre>show run crypto | include interface OUTSIDE</pre>
<p>If nothing comes up, then create a new MAP. If one exists, then add to the existing MAP later.</p>
<p>In this case, no MAP has been created yet so we will use a new one called VPNMAP.</p>
<pre>crypto map VPNMAP interface OUTSIDE</pre>
<h2><strong>Debugging Phase 1</strong></h2>
<p>Assuming that 50.56.229.98 is our peer, the debugs now should be limited to just this peer so that all other existing VPNs do not appear in the output. The following debug command will limit all crypto debugs to just this peer.</p>
<pre>debug crypto condition peer 50.56.229.98</pre>
<p>To see the encryption, hash etc that the peer is requesting for Phase 1, the debugs will need to be set to max verbosity.</p>
<pre>debug crypto isamkp 255 (Pre 8.3)
debug crypto ikev1 255 (Post 8.3)</pre>
<p>A lot of text should be coming across the terminal so performing &#8216;undebug all&#8217; may be necessary to stop to read it. There should be some output similar to the output below.</p>
<pre>IKEv1 Recv RAW packet dump
2d 52 d8 dc 44 74 d9 e5 00 00 00 00 00 00 00 00 | -R..Dt..........
01 10 02 00 00 00 00 00 00 00 00 ac 0d 00 00 3c | ...............!
00 00 00 01 00 00 00 01 00 00 00 30 01 01 00 01 | ...........0....
00 00 00 28 01 01 00 00 80 04 00 05 80 01 00 07 | ...(............
80 0e 00 c0 80 02 00 02 80 03 00 01 80 0b 00 01 | ................
00 0c 00 04 00 01 51 80 0d 00 00 14 90 cb 80 91 | ......Q.........
3e bb 69 6e 08 63 81 b5 ec 42 7b 1f 0d 00 00 14 | !.in.c...B{.....
7d 94 19 a6 53 10 ca 6f 2c 17 9d 92 15 52 9d 56 | }...S..o,....R.V
0d 00 00 14 4a 13 1c 81 07 03 58 45 5c 57 28 f2 | ....J.....XE\W(.
0e 95 45 2f 00 00 00 18 40 48 b7 d5 6e bc e8 85 | ..E/....@H..n...
25 e7 de 7f 00 d6 c2 d3 c0 00 00 00 | %..........

RECV PACKET from 50.56.229.98
ISAKMP Header
Initiator COOKIE: 2d 52 d8 dc 44 74 d9 e5
Responder COOKIE: 00 00 00 00 00 00 00 00
Next Payload: Security Association
Version: 1.0
Exchange Type: Identity Protection (Main Mode)
Flags: (none)
MessageID: 00000000
Length: 2885681152
Payload Security Association
Next Payload: Vendor ID
Reserved: 00
Payload Length: 60
DOI: IPsec
Situation:(SIT_IDENTITY_ONLY)
Payload Proposal
Next Payload: None
Reserved: 00
Payload Length: 48
Proposal #: 1
Protocol-Id: PROTO_ISAKMP
SPI Size: 0
# of transforms: 1
Payload Transform
Next Payload: None
Reserved: 00
Payload Length: 40
Transform #: 1
Transform-Id: KEY_IKE
Reserved2: 0000
<strong><span style="color: #993366;">Group Description: Group 5</span></strong>
<strong><span style="color: #ff6600;">Encryption Algorithm: AES-CBC</span></strong>
<strong><span style="color: #ff6600;">Key Length: 192</span>
<span style="color: #99cc00;">Hash Algorithm: SHA1</span></strong>
Authentication Method: Preshared key
<strong><span style="color: #3366ff;">Life Type: seconds
Life Duration (Hex): 00 01 51 80</span></strong>
Payload Vendor ID
Next Payload: Vendor ID
Reserved: 00
Payload Length: 20
Data (In Hex):
90 cb 80 91 3e bb 69 6e 08 63 81 b5 ec 42 7b 1f
Payload Vendor ID
Next Payload: Vendor ID
Reserved: 00
Payload Length: 20
Data (In Hex):
7d 94 19 a6 53 10 ca 6f 2c 17 9d 92 15 52 9d 56
Payload Vendor ID
Next Payload: Vendor ID
Reserved: 00
Payload Length: 20
Data (In Hex):
4a 13 1c 81 07 03 58 45 5c 57 28 f2 0e 95 45 2f
Payload Vendor ID
Next Payload: None
Reserved: 00
Payload Length: 24
Data (In Hex):
40 48 b7 d5 6e bc e8 85 25 e7 de 7f 00 d6 c2 d3
c0 00 00 00
Aug 20 16:27:45 [IKEv1]IP = 50.56.229.98, IKE_DECODE RECEIVED Message (msgid=0) with payloads : HDR + SA (1) + VENDOR (13) + VENDOR (13) + VENDOR (13) + VENDOR (13) + NONE (0) total length : 172</pre>
<p>With this message, we can see what the Remote side is proposing. In this case, the following is what is being sent for Phase 1.</p>
<p><span style="color: #ff6600;"><em><strong>Encryption:</strong></em></span> AES-192<br />
<span style="color: #99cc00;"><strong><em>Hash:</em></strong></span> SHA1<br />
<span style="color: #993366;"><em><strong>DH Group:</strong> </em></span>5<br />
<span style="color: #3366ff;"><em><strong>Lifetime:</strong></em> </span>86400</p>
<h2><strong>Debug Output explained</strong></h2>
<p>To elaborate, this is how to read the debug output to determine these settings.</p>
<p><strong><span style="color: #ff6600;">Encryption</span></strong> is found by looking at <span style="color: #ff6600;">Encryption Algorithm</span> and <span style="color: #ff6600;">Key Length</span>. In this case, Encryption Algorithm is AES-CBC with a Key Length of 192. This means that peer has chosen AES-192. If Key length was 128, for example, then this would have been AES-128 or just AES on the ASA as the default AES is 128 bits.</p>
<p><strong><span style="color: #99cc00;">Hash</span></strong> is found by what is in the <span style="color: #99cc00;">Hash Algorithm</span> data. In this case was SHA1.</p>
<p><span style="color: #993366;"><strong>Diffie-Hellman (DH) group</strong></span> is found in the <span style="color: #993366;">Group Description</span> data. In this request it showed Group 5.</p>
<p><strong><span style="color: #3366ff;">Lifetime</span></strong> for Phase 1 is always seconds but this is stated in the <span style="color: #3366ff;">Life Type</span> portion for verification. The Lifetime is found in the <span style="color: #3366ff;">Life Duration</span> data which is presented in HEX. This will need to be converted into DEC (decimal) which can be done via a Programming calculator or on the web. In this case, the conversion of <span style="color: #3366ff;">00 01 51 80</span> to DEC is <span style="color: #3366ff;">86400</span></p>
<h2><strong>Configuring Phase 1</strong></h2>
<p>With this information from the Payload, we can configure Phase 1 of the VPN.</p>
<p>If IKEv1 (ISAMKP) Policies already exist then be sure to not overwrite an existing one. In this case, one does not exist so this will be configured as policy 100.</p>
<pre>crypto isakmp policy 100 (Pre 8.3)
authentication pre-share
encryption aes-192
hash sha
group 5
lifetime 86400

crypto ikev1 policy 100 (Post 8.3)
authentication pre-share
encryption aes-192
hash sha
group 5
lifetime 86400</pre>
<p>Once this is configured, Phase 1 should be able to complete. If debugs are currently disabled (undebug all was ran), then re-enable the debugs with the following to verify Phase 1 is completing</p>
<pre>debug crypto condition peer 50.56.229.98

debug crypto isamkp 2 (Pre 8.3)
debug crypto ikev1 2 (Post 8.3)</pre>
<p>A message like the following should appear:</p>
<pre>Aug 20 17:07:30 [IKEv1]Group = 50.56.229.98, IP = 50.56.229.98, PHASE 1 COMPLETED</pre>
<p>If you are not seeing this message then you may be seeing one of th MM_WAIT messages. If you see MSG6, the the Pre Shared key is incorrect so be sure to validate this again. If you are seeing any other MSG number then be sure to look at the debug messages prior and confirm you have configured them the same. Each of the Messages (1-6) correspond to a portion of Phase 1 but I go over this in more detail in my <a href="https://www.thinknetsec.com/isakmp-ike-phase-1-status-messages-mm_wait_msg/">MM_WAIT_MSG</a> article if you are having issues.</p>
<h2><strong>Debugging Phase 2</strong></h2>
<p>If debugs are currently disabled (undebug all was ran), then re-enable the debugs with the following commands:</p>
<pre>debug crypto condition peer 50.56.229.98

debug crypto isamkp 255 (Pre 8.3)
debug crypto ikev1 255 (Post 8.3)</pre>
<p>Note that this will most likely cause a lot of text to scroll by so run &#8216;undebug all&#8217; if you need to stop it and read. If you already have Phase 2 configured, and are the initiator, then you may see some No Proposal Messages. I have these explained in another article <a href="https://www.thinknetsec.com/asa-ipsec-vpn-no-proposal-chosen/">here</a> for clarification.</p>
<p>If the Client is initiating, then there should be a similar output to the following:</p>
<pre>AFTER DECRYPTION
ISAKMP Header
Initiator COOKIE: 21 5b 94 0d ad e6 69 9b
Responder COOKIE: 73 85 9d f0 23 d1 99 de
Next Payload: Hash
Version: 1.0
Exchange Type: Quick Mode
Flags: (Encryption)
MessageID: F758707B
Length: 348
Payload Hash
Next Payload: Security Association
Reserved: 00
Payload Length: 24
Data:
d5 53 1a f4 b0 1f 2d d5 14 10 12 49 f7 4b c9 d2
16 23 33 6f
Payload Security Association
Next Payload: Nonce
Reserved: 00
Payload Length: 68
DOI: IPsec
Situation:(SIT_IDENTITY_ONLY)
Payload Proposal
Next Payload: None
Reserved: 00
Payload Length: 56
Proposal #: 1
Protocol-Id: PROTO_IPSEC_ESP
SPI Size: 4
# of transforms: 1
SPI: c1 67 0a 68
Payload Transform
Next Payload: None
Reserved: 00
Payload Length: 44
Transform #: 1
<span style="color: #ff6600;"><strong>Transform-Id: ESP_AES</strong></span>
Reserved2: 0000
<span style="color: #3366ff;"><strong>Life Type: Seconds
Life Duration (Hex): 70 80
Life Type: Kilobytes
Life Duration (Hex): 00 46 50 00</strong></span>
Encapsulation Mode: Tunnel
<strong><span style="color: #99cc00;">Authentication Algorithm: MD5</span>
<span style="color: #993366;">Group Description: Group 2</span></strong>
<span style="color: #ff6600;"><strong>Key Length: 256</strong></span>
Payload Nonce
Next Payload: Key Exchange
Reserved: 00
Payload Length: 24
Data:
7c 9e 9b e0 66 f5 8d e8 72 77 ce a6 10 cc 20 42
20 35 85 d2
Payload Key Exchange
Next Payload: Identification
Reserved: 00
Payload Length: 132
Data:
e2 c4 8d ac 4b 25 25 80 ac a2 42 61 e0 51 96 75
86 cb ca c7 3c df 37 9f cf 7c fc fd 5f b8 bf 66
92 34 a4 8f 2d 57 c9 d1 2d fb 9d a9 e9 37 41 27
60 ee e1 a9 ae ba 7b 82 35 6e 3a cc 79 4a bd d2
62 65 81 fb a0 fe 6a f2 27 98 39 1d fa 0f d0 ce
a7 f6 9e a2 b8 f2 72 4d bc 89 7f a2 05 01 ec a4
69 84 fe d2 70 45 5a b5 14 b3 a6 4c 8c 7b 80 e8
86 a0 64 03 79 bb 00 f7 6f 53 02 c1 1e c6 00 77
<span style="color: #ff00ff;"><strong>Payload Identification
</strong></span>Next Payload: Identification
Reserved: 00
Payload Length: 16
<strong><span style="color: #ff00ff;">ID Type: IPv4 Subnet (4)
Protocol ID (UDP/TCP, etc...): 0
Port: 0
ID Data: 192.168.200.0/255.255.255.0</span></strong>
<span style="color: #ff0000;"><strong>Payload Identification</strong>
</span>Next Payload: Notification
Reserved: 00
Payload Length: 16
<span style="color: #ff0000;"><strong>ID Type: IPv4 Subnet (4)
Protocol ID (UDP/TCP, etc...): 0
Port: 0
ID Data: 192.168.100.0/255.255.255.0</strong></span>
Payload Notification
Next Payload: None
Reserved: 00
Payload Length: 28
DOI: IPsec
Protocol-ID: PROTO_ISAKMP
Spi Size: 16
Notify Type: STATUS_INITIAL_CONTACT
SPI:
21 5b 94 0d ad e6 69 9b 73 85 9d f0 23 d1 99 de
Aug 20 16:59:36 [IKEv1]IP = 50.56.229.98, IKE_DECODE RECEIVED Message (msgid=f758707b) with payloads : HDR + HASH (8) + SA (1) + NONCE (10) + KE (4) + ID (5) + ID (5) + NOTIFY (11) + NONE (0) total length : 336</pre>
<p>With this output, we can determine the Phase 2 settings and the Encryption domain that they are sending. The local network of the local ASA is 192.168.100.0/24 in this case but we can also confirm this with the Remotes request.</p>
<p>With this output, we can see that our settings should be the following:</p>
<p><em><strong><span style="color: #ff6600;">Encryption:</span></strong></em> AES-256<br />
<em><span style="color: #99cc00;"><strong>Hash:</strong></span></em> MD5<br />
<em><strong><span style="color: #993366;">PFS (DH Group):</span></strong></em> Is enabled as Group 2<br />
<span style="color: #3366ff;"><em><strong>Lifetime (Seconds):</strong></em></span> 28800<br />
<em><strong><span style="color: #3366ff;">Lifetime (KB):</span></strong></em> 4608000</p>
<p><span style="color: #ff00ff;"><strong>Remote Network:</strong></span> 192.168.200.0/24<br />
<span style="color: #ff0000;"><strong>Local Network:</strong> </span>192.168.100.0/24</p>
<h2><strong>Debug Output explained</strong></h2>
<p><strong><span style="color: #ff6600;">Encryption</span></strong> is found by looking at 2 different data points. First being the <span style="color: #ff6600;">Transform-Id</span> which shows as ESP-AES and the other being the <span style="color: #ff6600;">Key Length</span> of 256.</p>
<p><span style="color: #99cc00;"><strong>Hash</strong></span> is determined by looking at the <span style="color: #99cc00;">Authentication Algorithm</span> which in this case is MD5.</p>
<p>If <span style="color: #993366;"><strong>PFS</strong></span> is enabled, the data point <span style="color: #993366;">Group Description</span> will be present with a value, which in this case is Group 2. Note, group2 is the default group when PFS is enabled on the ASA with no group specified.</p>
<p><span style="color: #3366ff;"><strong>Lifetime</strong></span>, in this case, is presented twice. One type being <span style="color: #0000ff;">Seconds</span> and the other being <span style="color: #0000ff;">Kilobytes</span>. This is determined by looking the the <span style="color: #3366ff;">Life Type</span> and looking for its corresponding <span style="color: #3366ff;">Life Duration </span>that follows it. As with Phase 1, the Lifetimes are presented in HEX so these will need to be converted. The values of 28800 Seconds and 4608000 Kilobytes are actually the default values set by the ASA but we will configure these values manually so that you can see how to set them.</p>
<p>The <strong><span style="color: #ff0000;">encryption <span style="color: #ff00ff;">domain</span></span></strong> is also present in this output. These are found under the <strong>Payload Identification</strong> portions of the output. The first reference is the <strong><span style="color: #ff00ff;">Remotes Encryption</span></strong> domain and the second reference the <strong><span style="color: #ff0000;">Local Encryption</span></strong> domain. The 2 <strong>ID Types</strong> the ASA understands are Subnet and Host. In this case, the ID Type is IPv4 Subnet for both. Protocol ID is also important but this is usually 0 which means the IP type. This encompasses TCP, UDP and ICMP which is why Port is also 0 as we are not referring to a specific TCP/UDP port. The <strong>ID Data</strong> is where the network is defined. In this case, the first reference is <span style="color: #ff00ff;">192.168.200.0/24</span> and the second reference is <span style="color: #ff0000;">192.168.100.0/24</span>.</p>
<h2><strong>Configuring Phase 2</strong></h2>
<p>With this information, the VPN should be able to be completed.</p>
<p>First we need to create the Transform Set. This is where Encryption and Hash are specified. The ESP-AES256-MD5 is just the name of the transform set.</p>
<pre>crypto ipsec ikev1 transform-set ESP-AES256-MD5 esp-aes-256 esp-md5-hmac</pre>
<p>Next we need to create an ACL for the VPN to reference for the encryption domain. Since I will be creating MAP 200, assuming no other MAP exists in VPNMAP, I will create the ACL as 200 for an easier reference. We will also use object-groups so that adding networks in the future will be cleaner and allow for ease of configuration.</p>
<pre>object-group network VPN-LOCAL-200
  network-object 192.168.100.0 255.255.255.0
 
object-group network VPN-REMOTE-200
  network-object 192.168.200.0 255.255.255.0
 
access-list 200 permit ip object-group VPN-LOCAL-200 object-group VPN-REMOTE-200</pre>
<p>Next we will need to create the new MAP entry.</p>
<pre>crypto map VPNMAP 200 match address 200 &lt;- This binds ACL 200 to this MAP.
crypto map VPNMAP 200 set peer 50.56.229.98
crypto map VPNMAP 200 set pfs group2
crypto map VPNMAP 200 set ikev1 transform-set ESP-AES256-MD5
crypto map VPNMAP 200 set security-association lifetime seconds 28800
crypto map VPNMAP 200 set security-association lifetime kilobytes 4608000</pre>
<p>With all of this set, we should see both Phase 1 and Phase 2 complete.</p>
<p><strong>Phase 1</strong></p>
<pre>ASA-LAB1(config)# show isakmp sa | b 50.56.229.98
1 IKE Peer: 50.56.229.98
Type : L2L Role : responder
Rekey : no State : MM_ACTIVE</pre>
<p><strong>Phase 2</strong></p>
<pre>ASA-LAB1(config)# show ipsec sa peer 50.56.229.98
peer address: 50.56.229.98
Crypto map tag: VPNMAP, seq num: 200, local addr: 50.57.228.150

access-list 200 extended permit ip 192.168.100.0 255.255.255.0 192.168.200.0 255.255.255.0
local ident (addr/mask/prot/port): (192.168.100.0/255.255.255.0/0/0)
remote ident (addr/mask/prot/port): (192.168.200.0/255.255.255.0/0/0)
current_peer: 50.56.229.98

#pkts encaps: 1129, #pkts encrypt: 1129, #pkts digest: 1129
#pkts decaps: 1224, #pkts decrypt: 1224, #pkts verify: 1224

</pre>
<p>If you are having some issues with Phase 2, I have another article <a href="https://www.thinknetsec.com/asa-ipsec-vpn-no-proposal-chosen/">here</a> that covers some of the messages you may see when troubleshooting phase 2.</p>
<h2><strong>Configuring Identity NAT</strong></h2>
<p>In most cases, the Local Encryption Domain will have NATs associated with them on the ASA. This means they will try to NAT to their corresponding Public IPs or as an Outbound PAT and not use their Local Private IPs over the VPN. In this case, we want them to use their Private IPs so we should create an Identity NAT to ensure that NAT does not take place. I do not have any NATs on my ASA but to prevent any issues in the future, it is best to always have one in place. We can use the objects created earlier to create this NAT. This is where using the groups comes in handy for when you need to add more networks in the future, it will update both the Encryption Domain and the Identity NAT.</p>
<pre>nat (any,OUTSIDE) source static VPN-LOCAL-200 VPN-LOCAL-200 destination static VPN-REMOTE-200 VPN-REMOTE-200 no-proxy-arp route-lookup</pre>
<p>Notice I set the source interface as any. This is useful if your Encryption Domain uses multiple networks from different interfaces. This means it can all be done with one NAT and not multiple. The route-lookup at the end allows the ASA to pick the correct interface to route the Private IP internally.</p>
<p>For more references for NAT, please check out either my NAT article <a href="https://www.thinknetsec.com/different-asa-nats-8-3/">here</a> or visit my friends NAT article <a href="https://www.practicalnetworking.net/stand-alone/cisco-asa-nat/#asa-identity-nat">here</a> which covers Identity NAT in greater detail.</p>
<p><span>If you would like to know more or see more articles on VPNs, please let me know. You can </span><a href="https://www.thinknetsec.com/contact/">contact</a><span> me and I will do what I can to help.</span></p>
<p>The post <a href="https://www.thinknetsec.com/vpn-troubleshoot-ikev1-site-to-site/">VPN Troubleshoot (IKEv1 Site to Site)</a> appeared first on <a href="https://www.thinknetsec.com">Think Netsec</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thinknetsec.com/vpn-troubleshoot-ikev1-site-to-site/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">505</post-id>	</item>
	</channel>
</rss>
