<?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>Firewall Archives - Think Netsec</title>
	<atom:link href="https://www.thinknetsec.com/tag/firewall/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.thinknetsec.com/tag/firewall/</link>
	<description>Think Network Security</description>
	<lastBuildDate>Mon, 27 Aug 2018 16:28:48 +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>Firewall Archives - Think Netsec</title>
	<link>https://www.thinknetsec.com/tag/firewall/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">133674323</site>	<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>
		<item>
		<title>Basic Site to Site (IKEv1)</title>
		<link>https://www.thinknetsec.com/basic-site-to-site-ikev1/</link>
					<comments>https://www.thinknetsec.com/basic-site-to-site-ikev1/#respond</comments>
		
		<dc:creator><![CDATA[John Finnegan]]></dc:creator>
		<pubDate>Thu, 03 Aug 2017 02:02:56 +0000</pubDate>
				<category><![CDATA[ASA]]></category>
		<category><![CDATA[Firewalls]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[IPSEC]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[VPN]]></category>
		<guid isPermaLink="false">http://www.thinknetsec.com/?p=106</guid>

					<description><![CDATA[<p>&#160; In this Article, we will be breaking down the right questions to ask when configuring a VPN and how to configure a Site to Site on the ASA. ASA Version The configuration of the Site to Site will be presented in different variations at the end of this Article.<a class="moretag" href="https://www.thinknetsec.com/basic-site-to-site-ikev1/"> Read more&#8230;</a></p>
<p>The post <a href="https://www.thinknetsec.com/basic-site-to-site-ikev1/">Basic Site to Site (IKEv1)</a> appeared first on <a href="https://www.thinknetsec.com">Think Netsec</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<p>In this Article, we will be breaking down the right questions to ask when configuring a VPN and how to configure a Site to Site on the ASA.</p>
<p><img decoding="async" class="alignnone size-full wp-image-227" src="http://www.thinknetsec.com/wp-content/uploads/2017/08/VPN2.png" alt="" width="200" height="200" srcset="https://www.thinknetsec.com/wp-content/uploads/2017/08/VPN2.png 200w, https://www.thinknetsec.com/wp-content/uploads/2017/08/VPN2-150x150.png 150w" sizes="(max-width: 200px) 100vw, 200px" /></p>
<h1><strong>ASA Version</strong></h1>
<p>The configuration of the Site to Site will be presented in different variations at the end of this Article. This is for those using either 7.x through 9.x code of the ASA as things are different between the code versions. I will start with 9 (8.3+) code since this should be the version most are running today and I will follow that up with 7.x-8.2. The Site to Site configuration between these code versions vary so I will present the same configuration in all variations between the code versions.</p>
<p>With all VPNs, we need to gather some information before we get started. Always ask the following as they are crucial to getting the VPNs configured correctly the first time. To jump straight to configuration, click <a href="#Config">here</a>.</p>
<h4><strong>Is the remote side requesting Route Based or Policy Based VPNs?</strong></h4>
<p>This is helpful to understand first and foremost your limitations. Until 9.7+, the ASA was not capable of performing a true Route Based VPN. The ASA was only capable of performing Policy Based VPNs but there is always ways to kind of get around those limitations but we will cover that in another Article. For now, if the answer is Policy Based, move on to the next question.</p>
<h4><strong>What is the Peer IP?</strong></h4>
<p>We need to know the IP of the other VPN Concentrator at the other end. It is also helpful to know if this device is behind a NAT device. That means the devices IP address would actually be a Private IP and would have to be NAT&#8217;d to reach your ASA. If this is the case, issues could arise based on the Router settings in front of the device and how the device sends its Identity to your ASA. In most cases, you will be creating the Tunnel Group based on their Public IP so it is good to make sure that this is the Identity (IP) coming from their device to build the tunnel. You should also ask that the other side has NAT-Traversal and IPsec passthrough configured on their edge Router in this particular case as well.</p>
<h4><strong>What is the Authentication Method?</strong></h4>
<p>Authentication Method is usually a pre-shared-key (password) that the Remote side will share with you. You need to make sure that you have the same password so that you both have the same key on both ends. Sometimes, a Remote client will ask for RSA Certificates instead of pre-shared-keys but that is for another discussion.</p>
<p>If the answer to this question is pre-shared-key then you will need to find the best way to share this key with each other so that you can configure this on your ASA for their Peer IP.</p>
<h4><strong>What are the Phase 1 Settings?</strong></h4>
<p>With these settings, it is not necessary to understand each one in detail. All we need to do is make sure that our values match on both sides. I will do my best to provide a little bit of detail if you wish to pick the best for your needs but, in the end, your goal should be to match these values. All values in <strong><span style="color: #ff0000;">red</span></strong> are the default values that will be used when you create a policy.</p>
<p><strong>Encryption:</strong> des | <strong><span style="color: #ff0000;">3des</span></strong> | aes-128 | aes-192 | aes-256</p>
<p>The encryption is the way you plan on locking your data. The longer the bits, the harder it is to break the key. That is really oversimplifying encryption but in the end, it is easier to remember that the higher the bits, generally the safer/stronger it is. (The above is not in bit order, just encryption type then bit order. des is 64 bit and 3des is 192 bits)</p>
<p><strong>Hash: md5 | <span style="color: #ff0000;">sha-1</span></strong></p>
<p>These are used for authenticating the source of an IP packet and verifying the integrity of its content. The VPN device will generate a hash and send it to the remote VPN device. It will use this to compare the hashes to check for packet integrity along with authenticating the remote device. If this value changes, then it can assume the segment was altered. As for which to choose for yourself, md5 has been broken before so I would recommend using sha-1. Now, md5 is faster to compute then sha-1 but usually this is negligible in network performance. Again, in the end, your goal should be to match the other sides settings.</p>
<p><strong>Diffie-Helman (DH): </strong> 1 | <strong><span style="color: #ff0000;">2</span></strong> | 5 | 7</p>
<p>DH is used for the key exchange between your ASA and the Remote device. The larger the number, the more bits that are used, which in turn makes it that much more secure. Now, with that in mind, the larger the number, the longer the processing to use the keys. As always, we are just trying to match the other sides configuration for the most part so do not think too much into these values.</p>
<p><strong>Lifetime(Seconds): </strong>120 &#8211; 2147483647 (<strong><span style="color: #ff0000;">86400</span></strong>)</p>
<p>Lifetime is the amount of time Phase 1 will stay active until it needs to re-key the tunnel. You always want this value greater then the lifetime that you will use in Phase 2.</p>
<hr />
<h4></h4>
<h4><strong>What are the Phase 2 Settings?</strong></h4>
<p>Phase 2 is the Second tunnel that will be built within the Phase 1 tunnel. If you have multiple networks that will be communicating with the remote side, each will get their own Phase 2. In most cases, every network combination will use the exact same Phase 2 settings. You will notice that the questions we need for Phase 2 are very similar to that of Phase 1 but do have some slight additions and options.</p>
<p><strong>Encryption:</strong> esp-des | esp-3des | esp-aes | esp-aes-192 | esp-aes-256 | esp-null</p>
<p>You will see your options above are the same as they were in Phase 1, except for the esp keyword and null. The esp keyword is just letting you know that this being used on a ESP packet, which is what IPSec sends once traffic is encrypted. Encapsulating Security Payload (ESP) is its own protocol so it is not TCP or UDP so make sure the other side is allowing this protocol to their device. As for null, this means you can actually apply no Encryption on Phase 2 if you wish to do so but most never use this option.</p>
<p><strong>Hash: </strong>esp-md5-hmac  | esp-sha-hmac | esp-none</p>
<p>Again, we see that esp keyword but this just means this is being used on a ESP packet. As for hmac, this stands for &#8216;hash message authentication code&#8217; but this just means it is using this a hashing authentication mechanism. You will notice that there is a none option now. This is if you wish to not add a HMAC to the Phase 2 Tunnels which could hinder security a little but would allow for faster processing. In the end, we just need to match this setting to what the remote location is using.</p>
<p><strong>Diffie-Helman (DH): </strong> 1 | 2 | 5 | Not Available</p>
<p>DH is not required in Phase 2 and is allowed to be omitted. This is an optional addition and gets referenced as Perfect Forward Secrecy (PFS) in most cases. This will allow for each Phase 2 Tunnel to generate their own keys. This does mean more security but also adds more computing cycles that your ASA will have to go through per packet.</p>
<p><strong>Lifetime(Seconds): </strong>120 &#8211; 2147483647 (<strong><span style="color: #ff0000;">28800</span></strong>)</p>
<p>Amount of time that Phase 2 can stay active before it needs to re-key the Phase 2 tunnel. This value should be lower then your Lifetime in Phase 1.</p>
<p><strong>Lifetime(Kilobytes): </strong>10 &#8211; 2147483647 | Unlimited (<strong><span style="color: #ff0000;">4608000</span></strong>)</p>
<p>Kilobyte Lifetime is a lifetime value that was not available in Phase 1. Just as the Lifetime(Seconds), this will tell the ASA how much data can go over the Phase 2 Tunnel before the Phase 2 Tunnel needs to perform a re-key. In this case, which ever Lifetime (Seconds or Kilobytes) is met first, the Tunnel will re-key. You can also set this value to Unlimited which will, in essence, turn this feature off. This comes in handy since some remote devices do not Support Kilobyte Lifetimes.</p>
<hr />
<p>&nbsp;</p>
<h4><strong>What is the Encryption Domain?</strong></h4>
<p>Lastly, we need to know the interesting traffic that will be traversing this VPN Tunnel. We need to match these exactly on both sides or issues will arise. Each Source and Destination Network combination will build their own Phase 2 Tunnel. All we need to know on the ASA is to configure an ACL of our Local Source Networks to the Remote Destination Networks. Note, that if your Netmasks are off, that the tunnel may sometimes build but not in all scenarios.</p>
<p>For example, if we have a 192.168.100.0/24 configured as our Local Network.<span id="Config" class="sta-anchor " aria-hidden="true"></span>If the Remote side configures our Network as 192.168.100.0/22 on their side of the VPN, only our Local ASA will be able to build the Phase 2 VPN Tunnel for that network. This is because our /24 range fits inside of their /22 IP range. Their device will accept our proposal and build with our /24, even though they have /22 configure. The reverse, however, would not work since their /22 is larger the our configured /24.</p>
<hr />
<h2></h2>
<h2><strong>Building the Site to Site VPN</strong></h2>
<p>Now that we have gotten most of our questions out of the way, we can begin configuring the ASA for the new Site to Site.</p>
<p>We will use the following as an example configuration with the following answers.</p>
<pre>Policy Based VPN

Peer IP: 50.56.228.50
Pre-shared-key: Th1nkN3t$ec
Phase 1-
   Encryption: aes-128
   Hash: sha-1
   DH Group: 2
   Lifetime: 86400

Phase 2-
   Encryption: esp-aes-256
   Hash: esp-sha-hmac
   PFS (DH): NA
   Lifetime (s): 28800
   Lifetime (k): 4608000

Encryption Domain:
   Local: 192.168.100.0/22
   Remote: 172.16.240.0/24

Our Public IP for this tunnel (their peer IP) will be 50.57.228.150
</pre>
<h2> <strong>ASA Code 9.x (8.3+)</strong></h2>
<p>I will be using a Crypto map called MyVPNMap but use the crypto map already configured on your device. If you do not have one, then please pick which ever map name works best for you. I will also be referencing my Internal Network name as INSIDE and my Outbound interface as OUTSIDE but please change these to match your device.</p>
<p>I like to first create my ACL that will be used as our Encryption Domain. We will also be creating object-groups for our Local and Remote Networks which will be useful for making changes later to the VPN and NAT.</p>
<pre>object-group network MyVPN-LOCAL
 network-object 192.168.100.0 255.255.255.0

object-group network MyVPN-REMOTE
 network-object 172.16.240.0 255.255.255.0

access-list MyVPN extended permit ip object-group MyVPN-LOCAL object-group MyVPN-REMOTE</pre>
<p>Now that we have created our object-groups and ACL, we should create our Identity NAT for our Encryption Domain. This is to ensure that communication does not try to use any NATs that may prevent this traffic from traversing the tunnel. (Default PAT Outbound for example). If you do not understand the NAT below, do not worry too much. I do have a Article that breaks down NAT if you wish to understand more but for now, I would recommend using the NAT below in most cases.</p>
<pre>nat (INSIDE,OUTSIDE) source static MyVPN-LOCAL MyVPN-LOCAL destination static MyVPN-REMOTE MyVPN-REMOTE no-proxy-arp route-lookup</pre>
<p>With our NAT and ACL now configured, we will add our Phase 1 configuration for the VPN. Notice I set my policy as 100 but any value here will work so long as you are not overriding an existing policy.</p>
<pre>crypto ikev1 policy 100
 authentication pre-share
 encryption aes
 hash sha
 group 2
 lifetime 86400</pre>
<p>To complete the Phase 1 configuration, we will create our Tunnel-group so that we can bind our pre-shared-key with our Peer IP.</p>
<pre>tunnel-group 50.56.228.50 type ipsec-l2l
tunnel-group 50.56.228.50 ipsec-attributes
 ikev1 pre-shared-key Th1nkN3t$ec</pre>
<p>With all of Phase 1 completed on your ASA, we will create our Transform Set (Phase 2 Encryption and Hash) for the VPN.</p>
<pre>crypto ipsec ikev1 transform-set AES256-SHA esp-aes-256 esp-sha-hmac</pre>
<p>Next, we will complete the VPN by configuring our Crypto map. Our Crypto map will bind our ACL and Phase 2 settings together with the Peer IP.</p>
<pre>crypto map MyVPNMap 100 match address MyVPN
crypto map MyVPNMap 100 set peer 50.56.228.50
crypto map MyVPNMap 100 set ikev1 transform-set AES256-SHA</pre>
<p>If this is your first VPN on your ASA, you will need to enable IKEv1, set you Identity to your ASAs IP address and bind your new Crypto Map to your Outside interface.</p>
<pre>crypto map MyVPNMap interface OUTSIDE
crypto isakmp identity address
crypto ikev1 enable OUTSIDE</pre>
<p>When the Remote side has completed their end of the VPN, you should be able to bring the Tunnel up and pass traffic if al routing etc is already accurate.</p>
<p>Here is all of the configuration for 8.3+ below in one snippet.</p>
<pre>object-group network MyVPN-LOCAL
 network-object 192.168.100.0 255.255.255.0

object-group network MyVPN-REMOTE
 network-object 172.16.240.0 255.255.255.0

access-list MyVPN extended permit ip object-group MyVPN-LOCAL object-group MyVPN-REMOTE

nat (INSIDE,OUTSIDE) source static MyVPN-LOCAL MyVPN-LOCAL destination static MyVPN-REMOTE MyVPN-REMOTE no-proxy-arp route-lookup

crypto ikev1 policy 100
 authentication pre-share
 encryption aes
 hash sha
 group 2
 lifetime 86400

tunnel-group 50.56.228.50 type ipsec-l2l
tunnel-group 50.56.228.50 ipsec-attributes
 ikev1 pre-shared-key Th1nkN3t$ec

crypto ipsec ikev1 transform-set AES256-SHA esp-aes-256 esp-sha-hmac

crypto map MyVPNMap 100 match address MyVPN
crypto map MyVPNMap 100 set peer 50.56.228.50
crypto map MyVPNMap 100 set ikev1 transform-set AES256-SHA

! Only do the following if this is your first VPN

crypto map MyVPNMap interface OUTSIDE
crypto isakmp identity address
crypto ikev1 enable OUTSIDE</pre>
<h3><strong>ASA 8.0-8.2 Code</strong></h3>
<pre>object-group network MyVPN-LOCAL
 network-object 192.168.100.0 255.255.255.0

object-group network MyVPN-REMOTE
 network-object 172.16.240.0 255.255.255.0

access-list MyVPN extended permit ip object-group MyVPN-LOCAL object-group MyVPN-REMOTE

! This is an ACL used to prevent NAT from occurring.
access-list nonat extended permit ip object-group MyVPN-LOCAL object-group MyVPN-REMOTE

! This is where we bind the above 'nonat' ACL to state that this traffic is to be excluded from NAT
nat (INSIDE) 0 access-list nonat

crypto isakmp policy 100
 authentication pre-share
 encryption aes
 hash sha
 group 2
 lifetime 86400

tunnel-group 50.56.228.50 type ipsec-l2l
tunnel-group 50.56.228.50 ipsec-attributes
 pre-shared-key Th1nkN3t$ec

crypto ipsec transform-set AES256-SHA esp-aes-256 esp-sha-hmac

crypto map MyVPNMap 100 match address MyVPN
crypto map MyVPNMap 100 set peer 50.56.228.50
crypto map MyVPNMap 100 set transform-set AES256-SHA

! Only do the following if this is your first VPN

crypto map MyVPNMap interface OUTSIDE
crypto isakmp identity address
crypto enable OUTSIDE</pre>
<h3><strong>ASA 7.x Code</strong></h3>
<pre>object-group network MyVPN-LOCAL network-object 192.168.100.0 255.255.255.0 
object-group network MyVPN-REMOTE network-object 172.16.240.0 255.255.255.0 
access-list MyVPN extended permit ip object-group MyVPN-LOCAL object-group MyVPN-REMOTE

! This is an ACL used to prevent NAT from occurring. 
access-list nonat extended permit ip object-group MyVPN-LOCAL object-group MyVPN-REMOTE

! This is where we bind the above 'nonat' ACL to state that this traffic is to be excluded from NAT 
nat (INSIDE) 0 access-list nonat

crypto isakmp policy 100 
authentication pre-share 
ncryption aes 
hash sha 
group 2 
lifetime 86400

! This is the same as the tunnel-group command in the other code versions
isakmp key Th1nkN3t$ec address 50.56.228.50 netmask 255.255.255.255 no-xauth
 
crypto ipsec transform-set AES256-SHA esp-aes-256 esp-sha-hmac 
crypto map MyVPNMap 100 ipsec-isakmp
crypto map MyVPNMap 100 match address MyVPN 
crypto map MyVPNMap 100 set peer 50.56.228.50 
crypto map MyVPNMap 100 set transform-set AES256-SHA

! Only do the following if this is your first VPN 
crypto map MyVPNMap interface OUTSIDE 
crypto isakmp identity address 
isakmp enable OUTSIDE</pre>
<p>The post <a href="https://www.thinknetsec.com/basic-site-to-site-ikev1/">Basic Site to Site (IKEv1)</a> appeared first on <a href="https://www.thinknetsec.com">Think Netsec</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thinknetsec.com/basic-site-to-site-ikev1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">106</post-id>	</item>
	</channel>
</rss>
