<?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/"
	>

<channel>
	<title>nat0 &#187; Cisco IOS</title>
	<atom:link href="http://nat0.net/category/english/security/cisco-ios/feed/" rel="self" type="application/rss+xml" />
	<link>http://nat0.net</link>
	<description>a blog about networking, Cisco-solutions and security</description>
	<lastBuildDate>Mon, 30 Jan 2012 11:48:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Stuck with an auth-proxy task</title>
		<link>http://nat0.net/stuck-with-an-auth-proxy-task/</link>
		<comments>http://nat0.net/stuck-with-an-auth-proxy-task/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 09:34:12 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco IOS]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[auth-proxy]]></category>
		<category><![CDATA[CCIE]]></category>
		<category><![CDATA[INE]]></category>
		<category><![CDATA[router]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=1391</guid>
		<description><![CDATA[Hello I am currently working on a task (INE CCIE Security WB 1 Task 2.9) where I am supposed to configured an radius-based IOS auth-proxy. The task is this: &#160; Configure Authentication PRoxy settings on R3 per the following requirements. US the radius server at 10.0.0.100 with the authentication key CISCO. The authentication proxy should [...]]]></description>
			<content:encoded><![CDATA[<p></p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Hello</p>
<p>I am currently working on a task (INE CCIE Security WB 1 Task 2.9) where I am supposed to configured an radius-based IOS auth-proxy. The task is this:</p>
<p>&nbsp;</p>
<p><em>Configure Authentication PRoxy settings on R3 per the following requirements.</em></p>
<ul>
<li><em>US the radius server at 10.0.0.100 with the authentication key CISCO.</em></li>
<li><em>The authentication proxy should apply to the users sessions initiated from VLAN23 towards VLAN13.</em></li>
<li><em>Authentication users should be allowed to send ICMP packets and initate TCP sessions.</em></li>
<li><em>Configure the ACS server with the user named PROXY and the password of CISCO1234.</em></li>
</ul>
<p>&nbsp;</p>
<p>In ACS I have added the R3 as AAA client (Cisco IOS Radius). I have also added the user PROXY with the following cisco av pair´s:</p>
<p><code><br />
auth-proxy:priv-lvl=15<br />
auth-proxy:proxyacl#1=permit icmp any any<br />
auth-proxy:proxyacl#1=permit tcp any any<br />
</code><br />
&nbsp;<br />
In R3 I have added the following config:</p>
<p><code><br />
aaa new-model<br />
aaa authen login CON none<br />
line con 0<br />
  login authen CON<br />
aaa authen login default group radius<br />
aaa author auth-proxy default group radius<br />
!<br />
ip http server<br />
ip http authen aaa<br />
ip auth-proxy name AUTHPROXY http<br />
!<br />
ip access-l ext INBOUND<br />
  permit udp any any eq rip<br />
  permit tcp any host 136.1.23.3 eq www<br />
  deny ip any any log<br />
!<br />
int fa0/1.23<br />
  ip access-group INBOUND in<br />
  ip auth-proxy AUTHPROXY<br />
</code><br />
&nbsp;<br />
This is what happens when I fire up a browser and http´s to the R3 interface:<br />
&nbsp;<br />
(debug aaa authen, aaa author, auth-proxy and radius is on)<br />
&nbsp;<br />
<code><br />
Rack1R3#<br />
*Jan  3 01:15:40.229: AUTH-PROXY:proto_flag=4, dstport_index=4<br />
*Jan  3 01:15:40.229:  SYN SEQ 984706124 LEN 0<br />
*Jan  3 01:15:40.229: dst_addr 136.1.23.3 src_addr 136.1.23.123 dst_port 80 src_port 1103<br />
*Jan  3 01:15:40.237: AUTH-PROXY:proto_flag=4, dstport_index=4<br />
*Jan  3 01:15:40.237:  ACK 4057202766 SEQ 984706125 LEN 0<br />
*Jan  3 01:15:40.237: dst_addr 136.1.23.3 src_addr 136.1.23.123 dst_port 80 src_port 1103<br />
*Jan  3 01:15:40.241: AUTH-PROXY:proto_flag=4, dstport_index=4<br />
*Jan  3 01:15:40.241:  PSH ACK 4057202766 SEQ 984706125 LEN 282<br />
*Jan  3 01:15:40.241: dst_addr 136.1.23.3 src_addr 136.1.23.123 dst_port 80 src_port 1103<br />
Rack1R3#<br />
*Jan  3 01:15:40.245: Router interested packet returning src 136.1.23.123, dst 136.1.23.3<br />
*Jan  3 01:15:40.257: AUTH-PROXY:proto_flag=4, dstport_index=4<br />
*Jan  3 01:15:40.261:  ACK 4057202967 SEQ 984706407 LEN 0<br />
*Jan  3 01:15:40.261: dst_addr 136.1.23.3 src_addr 136.1.23.123 dst_port 80 src_port 1103<br />
Rack1R3#<br />
Rack1R3#<strong>! I fired up IE, entered the url and it is now showing a login prmpt "level_15 or view_access"</strong><br />
Rack1R3#<br />
Rack1R3#<strong>! I enter the credentials PROXY/CISCO1234 and hit enter...</strong><br />
Rack1R3#<br />
Rack1R3#<br />
*Jan  3 01:16:52.743: AUTH-PROXY:proto_flag=4, dstport_index=4<br />
*Jan  3 01:16:52.743:  FIN ACK 4057202967 SEQ 984706407 LEN 0<br />
*Jan  3 01:16:52.743: dst_addr 136.1.23.3 src_addr 136.1.23.123 dst_port 80 src_port 1103<br />
*Jan  3 01:16:52.748: AUTH-PROXY:proto_flag=4, dstport_index=4<br />
*Jan  3 01:16:52.748:  SYN SEQ 1525595421 LEN 0<br />
*Jan  3 01:16:52.748: dst_addr 136.1.23.3 src_addr 136.1.23.123 dst_port 80 src_port 1104<br />
*Jan  3 01:16:52.756: AUTH-PROXY:proto_flag=4, dstport_index=4<br />
*Jan  3 01:16:52.756:  ACK 2275096303 SEQ 1525595422 LEN 0<br />
*Jan  3 01:16:52.756: dst_addr 136.1.23.3 src_addr 136.1.23.123 dst_port 80 src_port 1104<br />
*Jan  3 01:16:52.756: AUTH-PROXY:proto_flag=4, dstport_index=4<br />
*Jan  3 01:16:52.760:  PSH ACK 2275096303 SEQ 1525595422 LEN 325<br />
*Jan  3 01:16:52.760: dst_addr 136.1.23.3 src_addr 136.1.23.123 dst_port 80 src_port 1104<br />
*Jan  3 01:16:52.764: Router interested packet returning src 136.1.23.123, dst 136.1.23.3<br />
*Jan  3 01:16:52.772: AAA/BIND(00000006): Bind i/f<br />
*Jan  3 01:16:52.772: AAA/AUTHEN/LOGIN (00000006): Pick method list 'default'<br />
*Jan  3 01:16:52.776: RADIUS/ENCODE(00000006):Orig. component type = HTTP<br />
<strong>*Jan  3 01:16:52.776: RADIUS/ENCODE(00000006): dropping service type, "radius-server attribute 6 on-for-login-auth" is off</strong><br />
*Jan  3 01:16:52.776: RADIUS(00000006): Config NAS IP: 0.0.0.0<br />
*Jan  3 01:16:52.776: RADIUS/ENCODE(00000006): acct_session_id: 4<br />
*Jan  3 01:16:52.776: RADIUS(00000006): sending<br />
*Jan  3 01:16:52.776: RADIUS/ENCODE: Best Local IP-Address 10.0.0.3 for Radius-Server 10.0.0.100<br />
*Jan  3 01:16:52.780: RADIUS(00000006): Send Access-Request to 10.0.0.100:1645 id 1645/4, len 71<br />
*Jan  3 01:16:52.780: RADIUS:  authenticator 63 22 AD D4 03 CA 91 6C - 71 F8 27 E9 70 12 2A 18<br />
*Jan  3 01:16:52.780: RADIUS:  User-Name           [1]   7   "PROXY"<br />
*Jan  3 01:16:52.784: RADIUS:  User-Password       [2]   18  *<br />
*Jan  3 01:16:52.784: RADIUS:  NAS-Port-Type       [61]  6   Virtual                   [5]<br />
*Jan  3 01:16:52.784: RADIUS:  Calling-Station-Id  [31]  14  "136.1.23.123"<br />
*Jan  3 01:16:52.784: RADIUS:  NAS-IP-Address      [4]   6   10.0.0.3<br />
*Jan  3 01:16:52.796: RADIUS: Received from id 1645/4 10.0.0.100:1645, Access-Accept, len 181<br />
*Jan  3 01:16:52.796: RADIUS:  authenticator 4E 80 7B 47 1A 03 96 83 - BA 01 FE 83 9E A6 BB A6<br />
*Jan  3 01:16:52.800: RADIUS:  Framed-IP-Address   [8]   6   255.255.255.255<br />
*Jan  3 01:16:52.800: RADIUS:  Vendor, Cisco       [26]  30<br />
*Jan  3 01:16:52.800: RADIUS:   Cisco AVpair       [1]   24  "auth-proxy:priv-lvl=15"<br />
*Jan  3 01:16:52.800: RADIUS:  Vendor, Cisco       [26]  49<br />
*Jan  3 01:16:52.800: RADIUS:   Cisco AVpair       [1]   43  "auth-proxy:proxyacl#1=permit icmp any any"<br />
*Jan  3 01:16:52.800: RADIUS:  Vendor, Cisco       [26]  48<br />
*Jan  3 01:16:52.804: RADIUS:   Cisco AVpair       [1]   42  "auth-proxy:proxyacl#2=permit tcp any any"<br />
*Jan  3 01:16:52.804: RADIUS:  Class               [25]  28<br />
*Jan  3 01:16:52.804: RADIUS:   43 41 43 53 3A 30 2F 31 37 34 39 66 2F 61 30 30  [CACS:0/1749f/a00]<br />
*Jan  3 01:16:52.804: RADIUS:   30 30 30 33 2F 50 52 4F 58 59                    [0003/PROXY]<br />
*Jan  3 01:16:52.808: RADIUS(00000006): Received from id 1645/4<br />
<strong>*Jan  3 01:16:52.812: AAA/AUTHOR (00000006): Method list id=0 not configured. Skip author</strong><br />
*Jan  3 01:16:54.815: AUTH-PROXY:proto_flag=4, dstport_index=4<br />
*Jan  3 01:16:54.815:  ACK 2275096504 SEQ 1525595747 LEN 0<br />
*Jan  3 01:16:54.815: dst_addr 136.1.23.3 src_addr 136.1.23.123 dst_port 80 src_port 1104<br />
Rack1R3#<br />
<strong>Rack1R3#! ... and the browser give me another login prompt...</strong><br />
Rack1R3#<br />
Rack1R3#<br />
</code><br />
&nbsp;</p>
<p>See those lines in bold? What is happening here? They are not in the output from the solution guide. The &#8220;radius-server attribute 6 on for login-auth&#8221;-message can be tweaked away with a specific command but why should that be neccesary? And what about &#8220;AAA/AUTHOR Metod list id=0 not configured. Skip author&#8221;, that feels like a fatal error. But I do have &#8220;aaa authorization auth-proxy default group radius&#8221;-command.<br />
&nbsp;<br />
Anyone?</p>
<p>&nbsp;</p>
<p>&nbsp;  </p>
<div class="shr-publisher-1391"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://nat0.net/stuck-with-an-auth-proxy-task/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EzVPN Server on IOS in three different flavous</title>
		<link>http://nat0.net/ezvpn-server-on-ios-in-three-different-flavous/</link>
		<comments>http://nat0.net/ezvpn-server-on-ios-in-three-different-flavous/#comments</comments>
		<pubDate>Thu, 13 May 2010 20:06:16 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco IOS]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[VPN]]></category>
		<category><![CDATA[EzVPN]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[router]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=1099</guid>
		<description><![CDATA[Comparizon between 3 different ways to configure EzVPN on IOS. Example 1: EzVPN-server vanilla-style aaa new-model ! ! aaa authentication login default none aaa authentication login AAA-AUTHEN local aaa authorization network default none aaa authorization network AAA-AUTHOR local ! ! username cisco password 0 cisco ! ! crypto isakmp policy 10 encr aes authentication pre-share [...]]]></description>
			<content:encoded><![CDATA[<p></p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Comparizon between 3 different ways to configure EzVPN on IOS.</p>
<p><b>Example 1: EzVPN-server vanilla-style</b></p>
<p><code><br />
aaa new-model<br />
!<br />
!<br />
aaa authentication login default none<br />
aaa authentication login AAA-AUTHEN local<br />
aaa authorization network default none<br />
aaa authorization network AAA-AUTHOR local<br />
!<br />
!<br />
username cisco password 0 cisco<br />
!<br />
!<br />
crypto isakmp policy 10<br />
 encr aes<br />
 authentication pre-share<br />
 group 2<br />
!<br />
crypto isakmp client configuration group MYGROUP<br />
 key cisco<br />
 dns 8.8.8.8<br />
 pool LOCALPOOL<br />
 acl SPLITTUNNEL<br />
 save-password<br />
!<br />
!<br />
crypto ipsec transform-set TSET esp-aes esp-sha-hmac<br />
!<br />
crypto dynamic-map DYNMAP 10<br />
 set transform-set TSET<br />
 reverse-route<br />
!<br />
!<br />
crypto map CMAP client authentication list AAA-AUTHEN<br />
crypto map CMAP isakmp authorization list AAA-AUTHOR<br />
crypto map CMAP client configuration address respond<br />
crypto map CMAP 1 ipsec-isakmp dynamic DYNMAP<br />
!<br />
interface GigabitEthernet0/1<br />
 crypto map CMAP<br />
!<br />
!<br />
ip access-list extended SPLITTUNNEL<br />
 permit ip 8.9.5.0 0.0.0.255 any<br />
 permit ip 8.9.6.0 0.0.0.255 any<br />
!<br />
!<br />
</code></p>
<p><b>Example 2: Vanilla-style with ISAKMP profile on top</b></p>
<p><code><br />
aaa new-model<br />
!<br />
!<br />
aaa authentication login default none<br />
aaa authentication login AAA-AUTHEN local<br />
aaa authorization network default none<br />
aaa authorization network AAA-AUTHOR local<br />
!<br />
!<br />
crypto keyring EZVPN-KEYRING<br />
  pre-shared-key address 0.0.0.0 0.0.0.0 key cisco<br />
!<br />
crypto isakmp policy 10<br />
 encr aes<br />
 authentication pre-share<br />
 group 2<br />
!<br />
crypto isakmp client configuration group MYGROUP<br />
 key cisco<br />
 dns 8.8.8.8<br />
 pool LOCALPOOL<br />
 acl SPLITTUNNEL<br />
 save-password<br />
!<br />
crypto isakmp profile ISAKMP-PROFILE<br />
   keyring EZVPN-KEYRING<br />
   match identity group MYGROUP<br />
   client authentication list AAA-AUTHEN<br />
   isakmp authorization list AAA-AUTHOR<br />
   client configuration address respond<br />
!<br />
!<br />
crypto ipsec transform-set TSET esp-aes esp-sha-hmac<br />
!<br />
crypto dynamic-map DYNMAP 10<br />
 set transform-set TSET<br />
 set isakmp-profile ISAKMP-PROFILE<br />
 reverse-route<br />
!<br />
!<br />
crypto map CMAP 1 ipsec-isakmp dynamic DYNMAP<br />
!<br />
!<br />
interface GigabitEthernet0/1<br />
 crypto map CMAP<br />
!<br />
ip local pool LOCALPOOL 8.9.24.201 8.9.24.254<br />
!<br />
!<br />
!<br />
ip access-list extended SPLITTUNNEL<br />
 permit ip 8.9.5.0 0.0.0.255 any<br />
 permit ip 8.9.6.0 0.0.0.255 any<br />
!<br />
!<br />
</code></p>
<p><b>Differences between Example 1 and Example 2:</b><br />
<code><br />
crypto keyring EZVPN-KEYRING<br />
  pre-shared-key address 0.0.0.0 0.0.0.0 key cisco<br />
!<br />
crypto isakmp profile ISAKMP-PROFILE<br />
   keyring EZVPN-KEYRING<br />
   match identity group MYGROUP<br />
   client authentication list AAA-AUTHEN<br />
   isakmp authorization list AAA-AUTHOR<br />
   client configuration address respond<br />
!<br />
crypto dynamic-map DYNMAP 10<br />
 set isakmp-profile ISAKMP-PROFILE<br />
!<br />
<strike>crypto map CMAP client authentication list AAA-AUTHEN</strike><br />
<strike>crypto map CMAP isakmp authorization list AAA-AUTHOR</strike><br />
<strike>crypto map CMAP client configuration address respond</strike><br />
</code></p>
<p><b>Example 3: DVTI</b><br />
<code><br />
aaa new-model<br />
!<br />
!<br />
aaa authentication login default none<br />
aaa authentication login AAA-AUTHEN local<br />
aaa authorization network default none<br />
aaa authorization network AAA-AUTHOR local<br />
!<br />
!<br />
username cisco password 0 cisco<br />
!<br />
crypto keyring EZVPN-KEYRING<br />
  pre-shared-key address 0.0.0.0 0.0.0.0 key cisco<br />
!<br />
crypto isakmp policy 10<br />
 encr aes<br />
 authentication pre-share<br />
 group 2<br />
!<br />
crypto isakmp client configuration group MYGROUP<br />
 key cisco<br />
 dns 8.8.8.8<br />
 pool LOCALPOOL<br />
 acl SPLITTUNNEL<br />
 save-password<br />
!<br />
crypto isakmp profile ISAKMP-PROFILE<br />
   keyring EZVPN-KEYRING<br />
   match identity group MYGROUP<br />
   client authentication list AAA-AUTHEN<br />
   isakmp authorization list AAA-AUTHOR<br />
   client configuration address respond<br />
   virtual-template 1<br />
!<br />
!<br />
crypto ipsec transform-set TSET esp-aes esp-sha-hmac<br />
!<br />
crypto ipsec profile IPSEC-PROFILE<br />
 set transform-set TSET<br />
 set isakmp-profile ISAKMP-PROFILE<br />
!<br />
interface Virtual-Template1 type tunnel<br />
 ip unnumbered GigabitEthernet0/1<br />
 tunnel source GigabitEthernet0/1<br />
 tunnel mode ipsec ipv4<br />
 tunnel protection ipsec profile IPSEC-PROFILE<br />
!<br />
ip local pool LOCALPOOL 8.9.24.201 8.9.24.254<br />
!<br />
!<br />
ip access-list extended SPLITTUNNEL<br />
 permit ip 8.9.5.0 0.0.0.255 any<br />
 permit ip 8.9.6.0 0.0.0.255 any<br />
</code></p>
<p><b>Differences between Example 2 and Example 3</b><br />
<code><br />
crypto isakmp profile ISAKMP-PROFILE<br />
   virtual-template 1<br />
!<br />
crypto ipsec profile IPSEC-PROFILE<br />
 set transform-set TSET<br />
 set isakmp-profile ISAKMP-PROFILE<br />
!<br />
<strike>crypto dynamic-map DYNMAP 10</strike><br />
<strike> set transform-set TSET </strike><br />
<strike> set isakmp-profile ISAKMP-PROFILE</strike><br />
<strike> reverse-route</strike><br />
!<br />
!<br />
<strike>crypto map CMAP 1 ipsec-isakmp dynamic DYNMAP </strike><br />
!<br />
interface GigabitEthernet0/0<br />
<strike> crypto map CMAP</strike><br />
!<br />
interface Virtual-Template1 type tunnel<br />
 ip unnumbered GigabitEthernet0/1<br />
 tunnel source GigabitEthernet0/1<br />
 tunnel mode ipsec ipv4<br />
 tunnel protection ipsec profile IPSEC-PROFILE<br />
!</p>
<p></code></p>
<div class="shr-publisher-1099"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://nat0.net/ezvpn-server-on-ios-in-three-different-flavous/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Config example: Vanilla static ipsec vpn with crypto map</title>
		<link>http://nat0.net/config-example-vanilla-static-ipsec-vpn-with-crypto-map/</link>
		<comments>http://nat0.net/config-example-vanilla-static-ipsec-vpn-with-crypto-map/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 13:37:16 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco IOS]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[VPN]]></category>
		<category><![CDATA[ipsec]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=848</guid>
		<description><![CDATA[(Topology here) This is the far most common implementation of IPSEC Lan2Lan (at least in my world). It uses static crypto-maps applied to outbound interface of each router. A proxy-acl defines interresting traffic, authentication is done with a pre-shared key and it uses isakmp main-mode for setting up the tunnel. Ok. First thing first. Make [...]]]></description>
			<content:encoded><![CDATA[<p></p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>(Topology <a href="http://blogg.kvistofta.nu/configuration-examples-for-vpn-solutions/">here</a>)</p>
<p>This is the far most common implementation of IPSEC Lan2Lan (at least in my world). It uses static crypto-maps applied to outbound interface of each router. A proxy-acl defines interresting traffic, authentication is done with a pre-shared key and it uses isakmp main-mode for setting up the tunnel.</p>
<p>Ok. First thing first. Make sure that the peer router is reachable before doing anything else:</p>
<p><code><br />
r1#ping 10.10.30.3</p>
<p>Type escape sequence to abort.<br />
Sending 5, 100-byte ICMP Echos to 10.10.30.3, timeout is 2 seconds:<br />
!!!!!<br />
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms<br />
</code></p>
<p>Great. Now for the config. Start with r1. What traffic need to be protected? Create the crypto acl.<br />
<code><br />
ip access-list extended acl_vpn<br />
 permit ip host 192.168.1.50 host 10.3.3.3<br />
</code></p>
<p>Next. Create an isakmp policy defining the parameters for phase 1.<br />
<code><br />
crypto isakmp policy 10<br />
 encr aes<br />
 authentication pre-share<br />
 group 5<br />
</code></p>
<p>For phase 1 we also need to set the pre-shared key.<br />
<code><br />
crypto isakmp key cisco address 10.10.30.3<br />
</code></p>
<p>For phase 2 we need to create an ipsec transform-set.<br />
<code><br />
crypto ipsec transform-set TSET esp-aes esp-sha-hmac<br />
</code></p>
<p>Now this needs to be put together in a crypto map.<br />
<code><br />
crypto map CMAP 10 ipsec-isakmp<br />
 set peer 10.10.30.3<br />
 set transform-set TSET<br />
 match address acl_vpn<br />
</code></p>
<p>Last step is to assign this crypto-map to the outside interface.<br />
<code><br />
interface FastEthernet0.11<br />
 crypto map CMAP<br />
</code></p>
<p>On the other router the exact thing needs to be defined, except for the crypto access-list that of course must be mirrored because of the reverse point of view. Also the peer ip must be the correct one. Here is the config for r3 with modifications from above highlighted.<br />
<code><br />
ip access-list extended acl_vpn<br />
 permit ip <FONT style="BACKGROUND-COLOR: yellow">host 10.3.3.3 host 192.168.1.50</font><br />
crypto isakmp policy 10<br />
 encr aes<br />
 authentication pre-share<br />
 group 5<br />
crypto isakmp key cisco address <FONT style="BACKGROUND-COLOR: yellow">10.10.11.1</font><br />
crypto ipsec transform-set TSET esp-aes esp-sha-hmac<br />
crypto map CMAP 10 ipsec-isakmp<br />
 set peer <FONT style="BACKGROUND-COLOR: yellow">10.10.11.1</font><br />
 match address acl_vpn<br />
 reverse-route static<br />
 crypto map CMAP<br />
interface FastEthernet0.30<br />
 crypto map CMAP<br />
</code></p>
<p>In this example there is only one thing left to do: make sure that there are routes for the remote-end network. In my daily work I´ve setup lots of tunnels like this. It´s almost always the same: the router (or firewall) is connected to internet on outside with a default-route to the isp. But what if there is no default route? In my XXXXXXXXXXXXXXXXXXXXXXtopology the isn´t.  Look: </p>
<p><code><br />
r1#sh ip route<br />
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP<br />
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area<br />
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2<br />
       E1 - OSPF external type 1, E2 - OSPF external type 2<br />
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2<br />
       ia - IS-IS inter area, * - candidate default, U - per-user static route<br />
       o - ODR, P - periodic downloaded static route</p>
<p>Gateway of last resort is 10.10.10.1 to network 0.0.0.0</p>
<p>     10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks<br />
D EX    10.2.2.2/32 [170/1285120] via 10.10.10.1, 17:32:22, FastEthernet0.10<br />
C       10.10.10.0/24 is directly connected, FastEthernet0.10<br />
C       10.10.11.0/24 is directly connected, FastEthernet0.11<br />
C       10.1.1.1/32 is directly connected, Loopback0<br />
S       10.10.30.3/32 [1/0] via 10.10.11.2<br />
D EX 192.168.1.0/24 [170/1285120] via 10.10.10.1, 17:32:22, FastEthernet0.10<br />
D*EX 0.0.0.0/0 [170/1285120] via 10.10.10.1, 17:32:23, FastEthernet0.10</p>
<p>r3#sh ip route<br />
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP<br />
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area<br />
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2<br />
       E1 - OSPF external type 1, E2 - OSPF external type 2<br />
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2<br />
       ia - IS-IS inter area, * - candidate default, U - per-user static route<br />
       o - ODR, P - periodic downloaded static route</p>
<p>Gateway of last resort is not set</p>
<p>     10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks<br />
C       10.3.3.3/32 is directly connected, Loopback0<br />
S       10.10.11.1/32 [1/0] via 10.10.30.1<br />
C       10.10.30.0/24 is directly connected, FastEthernet0.30<br />
r3#<br />
</code></p>
<p>As you can see r1 has no route for 10.3.3.3 but only a default-route pointing in the wrong direction. R3 has no default-route at all, and certanly not a route for 192.168.1.50.</p>
<p>That means that even thou the vpn-peers have connectivity to establish a VPN-tunnel AND there is a definition of crypto traffic in the acl bound to the crypto map on outside interface the router is not clever enough to understand to send it that way. The route is not in the routing table. So, we need to add that. The cheapest way to do it is with static routes:</p>
<p>r1:<br />
<code><br />
ip route 10.10.30.3 255.255.255.255 10.10.11.2<br />
</code></p>
<p>r3:<br />
<code><br />
ip route 10.10.11.1 255.255.255.255 10.10.30.1<br />
</code></p>
<p>Now we are good to go. Lets ping 10.3.3.3 from our 192.168.1.50-host:</p>
<p><code><br />
C:>ping 10.3.3.3</p>
<p>Skickar ping-signal till 10.3.3.3 med 32 byte data:<br />
Svar från 10.3.3.3: byte=32 tid=2ms TTL=254<br />
Svar från 10.3.3.3: byte=32 tid=2ms TTL=254<br />
Svar från 10.3.3.3: byte=32 tid=2ms TTL=254<br />
Svar från 10.3.3.3: byte=32 tid=2ms TTL=254</p>
<p>Ping-statistik för 10.3.3.3:<br />
    Paket: Skickade = 4, Mottagna = 4, Förlorade = 0 (0 %),<br />
Ungefärlig överföringstid i millisekunder:<br />
    Lägsta = 2 ms, Högsta = 2 ms, Medel = 2 ms</p>
<p>C:><br />
</code><br />
(I apologize for the swedish OS <img src='http://nat0.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>But what if we are not allowed to use static routes. In real world noone would ever care but remember that in CCIE lab they will often throw a &#8220;and besides, you are not allowed to do it the easy way!&#8221; at you. </p>
<p>One solution could be to make the crypto map to insert a route for the remote networks into the local routing table. By doing that we can later on modify our crypto access-list without the need to care about static routes. Let´s do it!</p>
<p><code><br />
r1#conf t<br />
Enter configuration commands, one per line.  End with CNTL/Z.<br />
r1(config)#no ip route 10.3.3.3 255.255.255.255 10.10.11.2<br />
r1(config)#crypto map CMAP 10 ipsec-isakmp<br />
r1(config-crypto-map)#reverse-route static<br />
This will remove previously installed VPN routes and SAs<br />
r1(config-crypto-map)#<br />
r1#<br />
r3#conf t<br />
Enter configuration commands, one per line.  End with CNTL/Z.<br />
r3(config)#no ip route 192.168.1.50 255.255.255.255 10.10.30.1<br />
r3(config)#crypto map CMAP 10 ipsec-isakmp<br />
r3(config-crypto-map)#reverse-route static<br />
r3#<br />
</code></p>
<p>The magic is that, in each router, a static route has appeared in the routing-table without a corresponding static route in the config:</p>
<p><code><br />
r1#sh ip route 10.3.3.3<br />
Routing entry for 10.3.3.3/32<br />
  Known via "static", distance 1, metric 0<br />
  Routing Descriptor Blocks:<br />
  * 10.10.30.3<br />
      Route metric is 0, traffic share count is 1</p>
<p>r1#sh run | incl ip route<br />
ip route 10.10.30.3 255.255.255.255 10.10.11.2<br />
r1#<br />
</code></p>
<p>So. What is happening on the wire? First we see the ISAKMP-negotiation and then the encrypted ESP-traffic. Here, the output from wireshark placed in-transit between r1 and r3:</p>
<p><code><br />
No.     Time                       Source                Destination           Protocol Info<br />
      1 2010-03-19 07:44:28.799137 10.10.11.1            10.10.30.3            ISAKMP   Identity Protection (Main Mode)<br />
      2 2010-03-19 07:44:28.805942 10.10.30.3            10.10.11.1            ISAKMP   Identity Protection (Main Mode)<br />
      3 2010-03-19 07:44:28.810611 10.10.11.1            10.10.30.3            ISAKMP   Identity Protection (Main Mode)<br />
      4 2010-03-19 07:44:28.911985 10.10.30.3            10.10.11.1            ISAKMP   Identity Protection (Main Mode)<br />
      5 2010-03-19 07:44:29.022719 10.10.11.1            10.10.30.3            ISAKMP   Identity Protection (Main Mode)<br />
      6 2010-03-19 07:44:29.027372 10.10.30.3            10.10.11.1            ISAKMP   Identity Protection (Main Mode)<br />
      7 2010-03-19 07:44:29.032072 10.10.11.1            10.10.30.3            ISAKMP   Quick Mode<br />
      8 2010-03-19 07:44:29.037702 10.10.30.3            10.10.11.1            ISAKMP   Quick Mode<br />
      9 2010-03-19 07:44:29.042142 10.10.11.1            10.10.30.3            ISAKMP   Quick Mode<br />
     10 2010-03-19 07:44:33.532046 10.10.11.1            10.10.30.3            ESP      ESP (SPI=0x9793dfcd)<br />
     11 2010-03-19 07:44:33.533282 10.10.30.3            10.10.11.1            ESP      ESP (SPI=0x43fe1aba)<br />
     12 2010-03-19 07:44:34.533694 10.10.11.1            10.10.30.3            ESP      ESP (SPI=0x9793dfcd)<br />
     ..<br />
     ..<br />
</code></p>
<p>A key to success in configuring VPN is to interprete the debug output. The most common debug-commands are &#8220;debug crypto isakmp&#8221; and &#8220;deb crypto ipsec&#8221;. But the output is massive and it takes some exercise to learn to read it. Here is the output from r1 in our example above when establishing the VPN. Let´s see what happens:</p>
<p><code>r1#clear crypto session<br />
r1#deb crypto isakmp<br />
Crypto ISAKMP debugging is on<br />
r1#deb crypto ipsec<br />
Crypto IPSEC debugging is on<br />
r1#<br />
r1#<br />
*Mar 19 08:50:47.623: IPSEC(sa_request): ,<br />
  (key eng. msg.) OUTBOUND local= 10.10.11.1, remote= 10.10.30.3,<br />
    local_proxy= <FONT style="BACKGROUND-COLOR: yellow">192.168.1.50/255.255.255.255</font>/0/0 (type=1),<br />
    remote_proxy= <FONT style="BACKGROUND-COLOR: yellow">10.3.3.3/255.255.255.255</font>/0/0 (type=1),<br />
    protocol= ESP, transform= esp-aes esp-sha-hmac  (Tunnel),<br />
    lifedur= 3600s and 4608000kb,<br />
    spi= 0x0(0), conn_id= 0, keysize= 128, flags= 0x0<br />
</code><br />
Above we see that our ping triggered a request to setup a VPN (<br />
<code><br />
*Mar 19 08:50:47.623: ISAKMP:(0): SA request profile is (NULL)<br />
*Mar 19 08:50:47.623: ISAKMP: Created a peer struct for 10.10.30.3, peer port 500<br />
*Mar 19 08:50:47.623: ISAKMP: New peer created peer = 0x840A5978 peer_handle = 0x80000008<br />
*Mar 19 08:50:47.623: ISAKMP: Locking peer struct 0x840A5978, refcount 1 for isakmp_initiator<br />
*Mar 19 08:50:47.623: ISAKMP: local port 500, remote port 500<br />
*Mar 19 08:50:47.623: ISAKMP: set new node 0 to QM_IDLE<br />
*Mar 19 08:50:47.623: ISAKMP: Find a dup sa in the avl tree during calling isadb_insert sa = 8515F140<br />
*Mar 19 08:50:47.623: ISAKMP:(0):Can not start Aggressive mode, trying Main mode.<br />
*Mar 19 08:50:47.623: ISAKMP:(0):found peer pre-shared key matching 10.10.30.3<br />
*Mar 19 08:50:47.623: ISAKMP:(0): constructed NAT-T vendor-rfc3947 ID<br />
*Mar 19 08:50:47.623: ISAKMP:(0): constructed NAT-T vendor-07 ID<br />
*Mar 19 08:50:47.623: ISAKMP:(0): constructed NAT-T vendor-03 ID<br />
*Mar 19 08:50:47.623: ISAKMP:(0): constructed NAT-T vendor-02 ID<br />
*Mar 19 08:50:47.623: ISAKMP:(0):Input = IKE_MESG_FROM_IPSEC, IKE_SA_REQ_MM<br />
<FONT style="BACKGROUND-COLOR: yellow">*Mar 19 08:50:47.623: ISAKMP:(0):Old State = IKE_READY  New State = IKE_I_MM1 </font><br />
</code>Going into the next state&#8230;IKE_I_MM1 is &#8220;we are sending main mode msg 1&#8243;<code><br />
*Mar 19 08:50:47.623: ISAKMP:(0): beginning Main Mode exchange<br />
*Mar 19 08:50:47.623: ISAKMP:(0): sending packet to 10.10.30.3 my_port 500 peer_port 500 (I) MM_NO_STATE<br />
*Mar 19 08:50:47.623: ISAKMP:(0):Sending an IKE IPv4 Packet.<br />
*Mar 19 08:50:47.627: ISAKMP (0): received packet from 10.10.30.3 dport 500 sport 500 Global (I) MM_NO_STATE<br />
*Mar 19 08:50:47.627: ISAKMP:(0):Input = IKE_MESG_FROM_PEER, IKE_MM_EXCH<br />
<FONT style="BACKGROUND-COLOR: yellow">*Mar 19 08:50:47.627: ISAKMP:(0):Old State = IKE_I_MM1  New State = IKE_I_MM2 </font><br />
</code>Going into the next state&#8230;IKE_I_MM2 means &#8220;we got a reply on our first message&#8221;<code><br />
*Mar 19 08:50:47.627: ISAKMP:(0): processing SA payload. message ID = 0<br />
*Mar 19 08:50:47.627: ISAKMP:(0): processing vendor id payload<br />
*Mar 19 08:50:47.627: ISAKMP:(0): vendor ID seems Unity/DPD but major 69 mismatch<br />
*Mar 19 08:50:47.627: ISAKMP (0): vendor ID is NAT-T RFC 3947<br />
*Mar 19 08:50:47.627: ISAKMP:(0):found peer pre-shared key matching 10.10.30.3<br />
</code>We have a pre-shared key configured for remote peer. That´s good&#8230;<code><br />
*Mar 19 08:50:47.627: ISAKMP:(0): local preshared key found<br />
*Mar 19 08:50:47.627: ISAKMP : Scanning profiles for xauth ...<br />
*Mar 19 08:50:47.627: ISAKMP:(0):Checking ISAKMP transform 1 against priority 10 policy<br />
*Mar 19 08:50:47.627: ISAKMP:      encryption AES-CBC<br />
*Mar 19 08:50:47.627: ISAKMP:      keylength of 128<br />
*Mar 19 08:50:47.627: ISAKMP:      hash SHA<br />
*Mar 19 08:50:47.631: ISAKMP:      default group 5<br />
*Mar 19 08:50:47.631: ISAKMP:      auth pre-share<br />
*Mar 19 08:50:47.631: ISAKMP:      life type in seconds<br />
*Mar 19 08:50:47.631: ISAKMP:      life duration (VPI) of  0x0 0x1 0x51 0x80<br />
*Mar 19 08:50:47.631: ISAKMP:(0):<FONT style="BACKGROUND-COLOR: yellow">atts are acceptable.</font> Next payload is 0<br />
</code>We have match on ISAKMP policies. This example is simple since both peers has only one isakmp policy defined so the first try is a match. Remember, both peers try to find a match among all their localy configured isakmp policies and their buddies. In more complex configurations or when dealing with vpn-clients it´s not uncommon to see tenths of policies from each end. Then the previous lines will be repeated for all attempts.<code><br />
*Mar 19 08:50:47.631: ISAKMP:(0):Acceptable atts:actual life: 0<br />
*Mar 19 08:50:47.631: ISAKMP:(0):Acceptable atts:life: 0<br />
*Mar 19 08:50:47.631: ISAKMP:(0):Fill atts in sa vpi_length:4<br />
*Mar 19 08:50:47.631: ISAKMP:(0):Fill atts in sa life_in_seconds:86400<br />
*Mar 19 08:50:47.631: ISAKMP:(0):Returning Actual lifetime: 86400<br />
*Mar 19 08:50:47.631: ISAKMP:(0)::Started lifetime timer: 86400.<br />
*Mar 19 08:50:47.631: ISAKMP:(0): processing vendor id payload<br />
*Mar 19 08:50:47.631: ISAKMP:(0): vendor ID seems Unity/DPD but major 69 mismatch<br />
*Mar 19 08:50:47.631: ISAKMP (0): vendor ID is NAT-T RFC 3947<br />
*Mar 19 08:50:47.631: ISAKMP:(0):Input = IKE_MESG_INTERNAL, IKE_PROCESS_MAIN_MODE<br />
*Mar 19 08:50:47.631: ISAKMP:(0):Old State = IKE_I_MM2  New State = IKE_I_MM2<br />
*Mar 19 08:50:47.631: ISAKMP:(0): sending packet to 10.10.30.3 my_port 500 peer_port 500 (I) MM_SA_SETUP<br />
*Mar 19 08:50:47.631: ISAKMP:(0):Sending an IKE IPv4 Packet.<br />
*Mar 19 08:50:47.631: ISAKMP:(0):Input = IKE_MESG_INTERNAL, IKE_PROCESS_COMPLETE<br />
<FONT style="BACKGROUND-COLOR: yellow">*Mar 19 08:50:47.631: ISAKMP:(0):Old State = IKE_I_MM2  New State = IKE_I_MM3 </font><br />
</code>Ok. IKE_I_MM3 means that we send the third packet (our second as a sender)<code></p>
<p>*Mar 19 08:50:47.731: ISAKMP (0): received packet from 10.10.30.3 dport 500 sport 500 Global (I) MM_SA_SETUP<br />
*Mar 19 08:50:47.731: ISAKMP:(0):Input = IKE_MESG_FROM_PEER, IKE_MM_EXCH<br />
<FONT style="BACKGROUND-COLOR: yellow">*Mar 19 08:50:47.731: ISAKMP:(0):Old State = IKE_I_MM3  New State = IKE_I_MM4 </font><br />
</code>And we got a reply. The fourth packet in the 6-packet main-mode flow<code></p>
<p>*Mar 19 08:50:47.731: ISAKMP:(0): processing KE payload. message ID = 0<br />
*Mar 19 08:50:47.827: ISAKMP:(0): processing NONCE payload. message ID = 0<br />
*Mar 19 08:50:47.827: ISAKMP:(0):found peer pre-shared key matching 10.10.30.3<br />
*Mar 19 08:50:47.827: ISAKMP:(2007): processing vendor id payload<br />
*Mar 19 08:50:47.827: ISAKMP:(2007): vendor ID is Unity<br />
*Mar 19 08:50:47.827: ISAKMP:(2007): processing vendor id payload<br />
*Mar 19 08:50:47.827: ISAKMP:(2007): vendor ID is DPD<br />
*Mar 19 08:50:47.827: ISAKMP:(2007): processing vendor id payload<br />
*Mar 19 08:50:47.827: ISAKMP:(2007): speaking to another IOS box!<br />
*Mar 19 08:50:47.827: ISAKMP:received payload type 20<br />
*Mar 19 08:50:47.827: ISAKMP (2007): His hash no match - this node outside NAT<br />
*Mar 19 08:50:47.827: ISAKMP:received payload type 20<br />
*Mar 19 08:50:47.827: ISAKMP (2007): No NAT Found for self or peer<br />
*Mar 19 08:50:47.827: ISAKMP:(2007):Input = IKE_MESG_INTERNAL, IKE_PROCESS_MAIN_MODE<br />
*Mar 19 08:50:47.827: ISAKMP:(2007):Old State = IKE_I_MM4  New State = IKE_I_MM4 </p>
<p>*Mar 19 08:50:47.827: ISAKMP:(2007):Send initial contact<br />
*Mar 19 08:50:47.827: ISAKMP:(2007):SA is doing pre-shared key authentication using id type ID_IPV4_ADDR<br />
*Mar 19 08:50:47.827: ISAKMP (2007): ID payload<br />
        next-payload : 8<br />
        type         : 1<br />
        address      : 10.10.11.1<br />
        protocol     : 17<br />
        port         : 500<br />
        length       : 12<br />
*Mar 19 08:50:47.827: ISAKMP:(2007):Total payload length: 12<br />
*Mar 19 08:50:47.827: ISAKMP:(2007): <FONT style="BACKGROUND-COLOR: yellow">sending packet to 10.10.30.3 my_port 500 peer_port 500 (I) MM_KEY_EXCH</font><br />
*Mar 19 08:50:47.827: ISAKMP:(2007):Sending an IKE IPv4 Packet.<br />
*Mar 19 08:50:47.827: ISAKMP:(2007):Input = IKE_MESG_INTERNAL, IKE_PROCESS_COMPLETE<br />
<FONT style="BACKGROUND-COLOR: yellow">*Mar 19 08:50:47.827: ISAKMP:(2007):Old State = IKE_I_MM4  New State = IKE_I_MM5 </font><br />
</code>So. the fifth packet is where we send our pre-shared key<code><br />
*Mar 19 08:50:47.831: ISAKMP (2007): <FONT style="BACKGROUND-COLOR: yellow">received packet from 10.10.30.3 dport 500 sport 500 Global (I) MM_KEY_EXCH</font><br />
*Mar 19 08:50:47.831: ISAKMP:(2007): processing ID payload. message ID = 0<br />
*Mar 19 08:50:47.831: ISAKMP (2007): ID payload<br />
        next-payload : 8<br />
        type         : 1<br />
        address      : 10.10.30.3<br />
        protocol     : 17<br />
        port         : 500<br />
        length       : 12<br />
*Mar 19 08:50:47.831: ISAKMP:(0):: peer matches *none* of the profiles<br />
*Mar 19 08:50:47.831: ISAKMP:(2007): processing HASH payload. message ID = 0<br />
*Mar 19 08:50:47.831: ISAKMP:(2007):SA authentication status:<br />
        authenticated<br />
*Mar 19 08:50:47.831: ISAKMP:(2007):SA has been authenticated with 10.10.30.3<br />
*Mar 19 08:50:47.831: ISAKMP: Trying to insert a peer 10.10.11.1/10.10.30.3/500/,  and inserted successfully 840A5978.<br />
*Mar 19 08:50:47.831: ISAKMP:(2007):Input = IKE_MESG_FROM_PEER, IKE_MM_EXCH<br />
<FONT style="BACKGROUND-COLOR: yellow">*Mar 19 08:50:47.831: ISAKMP:(2007):Old State = IKE_I_MM5  New State = IKE_I_MM6 </font><br />
</code>We got a reply, the sixth (and last) packet of Main mode phase 1<code></p>
<p>*Mar 19 08:50:47.835: ISAKMP:(2007):Input = IKE_MESG_INTERNAL, IKE_PROCESS_MAIN_MODE<br />
*Mar 19 08:50:47.835: ISAKMP:(2007):Old State = IKE_I_MM6  New State = IKE_I_MM6<br />
*Mar 19 08:50:47.835: ISAKMP:(2007):Input = IKE_MESG_INTERNAL, IKE_PROCESS_COMPLETE<br />
<FONT style="BACKGROUND-COLOR: yellow">*Mar 19 08:50:47.835: ISAKMP:(2007):Old State = IKE_I_MM6  New State = IKE_P1_COMPLETE </font><br />
</code>So. Phase 1 is completed. <code><br />
*Mar 19 08:50:47.835: ISAKMP:(2007):<FONT style="BACKGROUND-COLOR: yellow">beginning Quick Mode exchange, M-ID of -1445410418</font><br />
<code>Quick mode = Phase 1</code><br />
*Mar 19 08:50:47.835: ISAKMP:(2007):QM Initiator gets spi<br />
*Mar 19 08:50:47.835: ISAKMP:(2007): sending packet to 10.10.30.3 my_port 500 peer_port 500 (I) QM_IDLE<br />
*Mar 19 08:50:47.835: ISAKMP:(2007):Sending an IKE IPv4 Packet.<br />
*Mar 19 08:50:47.835: ISAKMP:(2007):Node -1445410418, Input = IKE_MESG_INTERNAL, IKE_INIT_QM<br />
<FONT style="BACKGROUND-COLOR: yellow">*Mar 19 08:50:47.835: ISAKMP:(2007):Old State = IKE_QM_READY  New State = IKE_QM_I_QM1</font><br />
</code>IKE_QM_I_QM1 means that we´ve sent our first phase 2 packet<code><br />
*Mar 19 08:50:47.835: ISAKMP:(2007):Input = IKE_MESG_INTERNAL, IKE_PHASE1_COMPLETE<br />
*Mar 19 08:50:47.835: ISAKMP:(2007):Old State = IKE_P1_COMPLETE  New State = IKE_P1_COMPLETE </p>
<p>*Mar 19 08:50:47.843: ISAKMP (2007): <FONT style="BACKGROUND-COLOR: yellow">received packet from 10.10.30.3</font> dport 500 sport 500 Global (I) QM_IDLE<br />
</code>We got an answer. The reply is the second of three packets in phase 2. The content of this received packet is SA-data for ipsec SA:s. Which traffic to protect (proxies), encryption parameters and so on. What happens next is that this information is compared to our local configuration to make sure that it matches. Then the SA:s are being setup&#8230;<br />
<code><br />
*Mar 19 08:50:47.843: ISAKMP:(2007): processing HASH payload. message ID = -1445410418<br />
*Mar 19 08:50:47.843: ISAKMP:(2007): processing SA payload. message ID = -1445410418<br />
*Mar 19 08:50:47.843: ISAKMP:(2007):<FONT style="BACKGROUND-COLOR: yellow">Checking IPSec proposal 1</font><br />
*Mar 19 08:50:47.843: ISAKMP: transform 1, ESP_AES<br />
*Mar 19 08:50:47.843: ISAKMP:   attributes in transform:<br />
*Mar 19 08:50:47.843: ISAKMP:      encaps is 1 (Tunnel)<br />
*Mar 19 08:50:47.843: ISAKMP:      SA life type in seconds<br />
*Mar 19 08:50:47.843: ISAKMP:      SA life duration (basic) of 3600<br />
*Mar 19 08:50:47.843: ISAKMP:      SA life type in kilobytes<br />
*Mar 19 08:50:47.843: ISAKMP:      SA life duration (VPI) of  0x0 0x46 0x50 0x0<br />
*Mar 19 08:50:47.843: ISAKMP:      authenticator is HMAC-SHA<br />
*Mar 19 08:50:47.843: ISAKMP:      key length is 128<br />
*Mar 19 08:50:47.843: ISAKMP:(2007):<FONT style="BACKGROUND-COLOR: yellow">atts are acceptable.</font><br />
*Mar 19 08:50:47.843: IPSEC(validate_proposal_request): proposal part #1<br />
*Mar 19 08:50:47.843: IPSEC(validate_proposal_request): proposal part #1,<br />
  (key eng. msg.) INBOUND local= 10.10.11.1, remote= 10.10.30.3,<br />
<FONT style="BACKGROUND-COLOR: yellow">    local_proxy= 192.168.1.50/255.255.255.255/0/0 (type=1),<br />
    remote_proxy= 10.3.3.3/255.255.255.255/0/0 (type=1),<br />
    protocol= ESP, transform= NONE  (Tunnel),<br />
    lifedur= 0s and 0kb,<br />
</font>    spi= 0x0(0), conn_id= 0, keysize= 128, flags= 0x0<br />
*Mar 19 08:50:47.843: Crypto mapdb : proxy_match<br />
        src addr     : 192.168.1.50<br />
        dst addr     : 10.3.3.3<br />
        protocol     : 0<br />
        src port     : 0<br />
        dst port     : 0<br />
*Mar 19 08:50:47.843: ISAKMP:(2007): processing NONCE payload. message ID = -1445410418<br />
*Mar 19 08:50:47.843: ISAKMP:(2007): processing ID payload. message ID = -1445410418<br />
*Mar 19 08:50:47.843: ISAKMP:(2007): processing ID payload. message ID = -1445410418<br />
*Mar 19 08:50:47.843: ISAKMP:(2007): Creating IPSec SAs<br />
*Mar 19 08:50:47.843:         inbound SA from 10.10.30.3 to 10.10.11.1 (f/i)  0/ 0<br />
        (proxy 10.3.3.3 to 192.168.1.50)<br />
*Mar 19 08:50:47.843:         has spi 0xCB15AC0E and conn_id 0<br />
*Mar 19 08:50:47.843:         lifetime of 3600 seconds<br />
*Mar 19 08:50:47.843:         lifetime of 4608000 kilobytes<br />
*Mar 19 08:50:47.843:         outbound SA from 10.10.11.1 to 10.10.30.3 (f/i) 0/0<br />
        (proxy 192.168.1.50 to 10.3.3.3)<br />
*Mar 19 08:50:47.843:         has spi  0xBA3D8C69 and conn_id 0<br />
*Mar 19 08:50:47.843:         lifetime of 3600 seconds<br />
*Mar 19 08:50:47.847:         lifetime of 4608000 kilobytes<br />
<FONT style="BACKGROUND-COLOR: yellow">*Mar 19 08:50:47.847: ISAKMP:(2007): sending packet to 10.10.30.3 my_port 500 peer_port 500 (I) QM_IDLE      </font><br />
</code>We send our third and last packet in phase 2 packet exchange&#8230;<code><br />
*Mar 19 08:50:47.847: ISAKMP:(2007):Sending an IKE IPv4 Packet.<br />
*Mar 19 08:50:47.847: ISAKMP:(2007):deleting node -1445410418 error FALSE reason "No Error"<br />
*Mar 19 08:50:47.847: ISAKMP:(2007):Node -1445410418, Input = IKE_MESG_FROM_PEER, IKE_QM_EXCH<br />
<FONT style="BACKGROUND-COLOR: yellow">*Mar 19 08:50:47.847: ISAKMP:(2007):Old State = IKE_QM_I_QM1  New State = IKE_QM_PHASE2_COMPLETE</font><br />
*Mar 19 08:50:47.847: IPSEC(key_engine): got a queue event with 1 KMI message(s)<br />
*Mar 19 08:50:47.847: Crypto mapdb : proxy_match<br />
        src addr     : 192.168.1.50<br />
        dst addr     : 10.3.3.3<br />
        protocol     : 0<br />
        src port     : 0<br />
        dst port     : 0<br />
*Mar 19 08:50:47.847: IPSEC(crypto_ipsec_sa_find_ident_head): reconnecting with the same proxies and peer 10.10.30.3<br />
*Mar 19 08:50:47.847: IPSEC(rte_mgr): VPN Route Event static keyword or dynamic SA create for 10.10.30.3<br />
*Mar 19 08:50:47.847: IPSEC(policy_db_add_ident): src 192.168.1.50, dest 10.3.3.3, dest_port 0</p>
<p>*Mar 19 08:50:47.847: IPSEC(create_sa): sa created,<br />
  (sa) sa_dest= 10.10.11.1, sa_proto= 50,<br />
    sa_spi= 0xCB15AC0E(3407195150),<br />
    sa_trans= esp-aes esp-sha-hmac , sa_conn_id= 59<br />
    sa_lifetime(k/sec)= (4453107/3600)<br />
*Mar 19 08:50:47.847: IPSEC(create_sa): sa created,<br />
  (sa) sa_dest= 10.10.30.3, sa_proto= 50,<br />
    sa_spi= 0xBA3D8C69(3124595817),<br />
    sa_trans= esp-aes esp-sha-hmac , sa_conn_id= 60<br />
    sa_lifetime(k/sec)= (4453107/3600)<br />
*Mar 19 08:50:47.847: IPSEC(update_current_outbound_sa): updated peer 10.10.30.3 current outbound sa to SPI BA3D8C69<br />
*Mar 19 08:50:48.027: ISAKMP:(2006):purging SA., sa=8515E77C, delme=8515E77C<br />
r1#<br />
</code></p>
<p>Voila!</p>
<p>And just to make sure all looks good let´s check our SA:s:</p>
<p><code><br />
r1#sh crypto isakmp sa<br />
IPv4 Crypto ISAKMP SA<br />
dst             src             state          conn-id status<br />
10.10.30.3      10.10.11.1      QM_IDLE           2007 ACTIVE<br />
r1#<br />
</code>As you can see there is one isakmp SA created. State QM_IDLE is good, it means that all is fine in isakmp/phase 1<code><br />
r1#sh crypto ipsec sa</p>
<p>interface: FastEthernet0.11<br />
    Crypto map tag: CMAP, local addr 10.10.11.1</p>
<p>   protected vrf: (none)<br />
   local  ident (addr/mask/prot/port): (192.168.1.50/255.255.255.255/0/0)<br />
   remote ident (addr/mask/prot/port): (10.3.3.3/255.255.255.255/0/0)<br />
   current_peer 10.10.30.3 port 500<br />
     PERMIT, flags={origin_is_acl,}<br />
    <FONT style="BACKGROUND-COLOR: yellow">#pkts encaps: 7</font>, #pkts encrypt: 7, #pkts digest: 7<br />
    <FONT style="BACKGROUND-COLOR: yellow">#pkts decaps: 7</font>, #pkts decrypt: 7, #pkts verify: 7<br />
    #pkts compressed: 0, #pkts decompressed: 0<br />
    #pkts not compressed: 0, #pkts compr. failed: 0<br />
    #pkts not decompressed: 0, #pkts decompress failed: 0<br />
    #send errors 1, #recv errors 0</p>
<p>     local crypto endpt.: 10.10.11.1, remote crypto endpt.: 10.10.30.3<br />
     path mtu 1500, ip mtu 1500, ip mtu idb FastEthernet0.11<br />
     current outbound spi: 0xBA3D8C69(3124595817)<br />
     PFS (Y/N): N, DH group: none</p>
<p>     inbound esp sas:<br />
<FONT style="BACKGROUND-COLOR: yellow">      spi: 0xCB15AC0E(3407195150)</font><br />
        transform: esp-aes esp-sha-hmac ,<br />
        in use settings ={Tunnel, }<br />
        conn id: 59, flow_id: Onboard VPN:59, sibling_flags 80000046, crypto map: CMAP<br />
        sa timing: remaining key lifetime (k/sec): (4453106/1047)<br />
        IV size: 16 bytes<br />
        replay detection support: Y<br />
        Status: ACTIVE</p>
<p>     inbound ah sas:</p>
<p>     inbound pcp sas:</p>
<p>     outbound esp sas:<br />
 <FONT style="BACKGROUND-COLOR: yellow">     spi: 0xBA3D8C69(3124595817)</font><br />
        transform: esp-aes esp-sha-hmac ,<br />
        in use settings ={Tunnel, }<br />
        conn id: 60, flow_id: Onboard VPN:60, sibling_flags 80000046, crypto map: CMAP<br />
        sa timing: remaining key lifetime (k/sec): (4453106/1047)<br />
        IV size: 16 bytes<br />
        replay detection support: Y<br />
        Status: ACTIVE</p>
<p>     outbound ah sas:</p>
<p>     outbound pcp sas:<br />
r1#<br />
</code> There are 2 ipsec SA:s established. One in each direction. That´s just the way it is. Looking at the number of encaps/decaps packets gives us a hint that we are both sending traffic and receiving traffic thru the tunnel.</p>
<p>That´s all for now. This was a massive post. I will use this exampel as a template for the next VPN configurations so hopefully they will not be as massive as this. <img src='http://nat0.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Please feel free to comment if there is anything I´ve missed or if I got something the wrong way&#8230;</p>
<p>Configs for <a href="http://blogg.kvistofta.nu/upload/2010/03/r1_vanilla.txt">r1 </a>and r3 here&#8230;</p>
<div class="shr-publisher-848"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://nat0.net/config-example-vanilla-static-ipsec-vpn-with-crypto-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuration examples for VPN solutions</title>
		<link>http://nat0.net/configuration-examples-for-vpn-solutions/</link>
		<comments>http://nat0.net/configuration-examples-for-vpn-solutions/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 11:37:19 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco IOS]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=852</guid>
		<description><![CDATA[IPsec. Gre. Ipsec/Gre. Crypto maps. Isakmp profiles. Ipsec profiles. Dynamic crypto maps. DMVPN Phase 1, phase 2, phase 3. GET VPN. Easy VPN. NHRP. X-auth. PKI. AnyConnect. Portal. RRI. I could continue forever. In my journey of investigating all weird flavours of VPN I´ve decided to try each of them in my home-lab and make [...]]]></description>
			<content:encoded><![CDATA[<p></p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>IPsec. Gre. Ipsec/Gre. Crypto maps. Isakmp profiles. Ipsec profiles. Dynamic crypto maps. DMVPN Phase 1, phase 2, phase 3. GET VPN. Easy VPN. NHRP. X-auth. PKI. AnyConnect. Portal. RRI. I could continue forever. </p>
<p>In my journey of investigating all weird flavours of VPN I´ve decided to try each of them in my home-lab and make a blog-post of each one. I will use a common base topology like this:<br />
<img src="http://www.gliffy.com/pubdoc/2034133/M.png" alt="Base topology" /></p>
<p>The scenario is this: Two routers, r1 and r3, are connected to a transit-network. It might be internet, it might be anything else. It might be a crossover ethernet-cable and it might be a multi-hop MPLS-cloud. The host 192.168.1.50 needs to access 10.3.3.3 in a secure way over the transit-network.</p>
<p>To make sure that the routers have connectivity they have host-routes of eachother into the transit-network.</p>
<p>This is a blog post to collect the different configurations together. In the list below I will add each configuration example as I go&#8230;</p>
<ul>
<li><a href="http://blogg.kvistofta.nu/config-example-vanilla-static-ipsec-vpn-with-crypto-map/">Vanilla static ipsec vpn with crypto map</a></li>
<li><a href="http://blogg.kvistofta.nu/config-example-static-to-dynamic-ipsec/">Static to dynamic IPSec</a></li>
</ul>
<div class="shr-publisher-852"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://nat0.net/configuration-examples-for-vpn-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GRE-tunneling between two IOS-routers.</title>
		<link>http://nat0.net/gre-tunneling-between-two-ios-routers/</link>
		<comments>http://nat0.net/gre-tunneling-between-two-ios-routers/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 21:23:18 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco IOS]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[GRE]]></category>
		<category><![CDATA[ipsec]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=838</guid>
		<description><![CDATA[The last days I´ve been playing with GRE-tunnels (just to prepare myself for testing DMVPN). I did a simple GRE-tunnel between two routers (split apart with a firewall simulating internet) and made EIGRP flow thru the the tunnel. It´s really cool and simple. Just create a Tunnel-interface and assign source and destinations: interface Tunnel0 ip [...]]]></description>
			<content:encoded><![CDATA[<p></p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>The last days I´ve been playing with GRE-tunnels (just to prepare myself for testing DMVPN). I did a simple GRE-tunnel between two routers (split apart with a firewall simulating internet) and made EIGRP flow thru the the tunnel. It´s really cool and simple. Just create a Tunnel-interface and assign source and destinations:</p>
<p><code><br />
interface Tunnel0<br />
 ip address 10.99.99.1 255.255.255.0<br />
 tunnel source FastEthernet0.11<br />
 tunnel destination 10.10.30.3<br />
</code></p>
<p>and the same on the other router:</p>
<p><code><br />
interface Tunnel0<br />
 ip address 10.99.99.3 255.255.255.0<br />
 tunnel source FastEthernet0.30<br />
 tunnel destination 10.10.11.1<br />
</code></p>
<p>the 10.10.11.1 and 10.10.30.3 ip:s are the physical interface-ip of respective router. The tunnel-interfaces shares a common subnet, 10.99.99.0/24.</p>
<p>After doing that I just added the interface to the EIGRP process:</p>
<p><code><br />
router eigrp 11<br />
  network 10.99.99.0 0.0.0.255<br />
</code></p>
<p>Since the GRE-tunnel handles multicast the EIGRP-enabled routers become neighbours and exchange routes.</p>
<p>The next step is to encrypt the traffic. Sending this tunnel-traffic in clear text is not a really good idea, is it? What needs to be done is to create an ipsec profile and isakmp policy on each router.</p>
<p><code><br />
crypto ipsec transform-set TSET esp-aes esp-sha-hmac<br />
 mode transport<br />
crypto ipsec profile IPSECPROF<br />
 set transform-set TSET<br />
 set pfs group2<br />
crypto isakmp policy 10<br />
 encr aes<br />
 authentication pre-share<br />
 group 2<br />
crypto isakmp key cisco address 10.10.30.3<br />
</code></p>
<p>After doing that the only remaining step is to apply the ipsec profile to the tunnel interface, and voila, all traffic thru that interface will be encrypted:</p>
<p><code><br />
interface Tunnel0<br />
 ip address 10.99.99.1 255.255.255.0<br />
 tunnel source FastEthernet0.11<br />
 tunnel destination 10.10.30.3<br />
 tunnel protection ipsec profile IPSECPROF<br />
</code></p>
<p>One thing to remember. <b>Never</b> use gre keepalives when ipsec-encrypting your GRE-traffic. This got me stuck in troubleshooting for a while before a kind guy on a mailing-list told me so and referred to <a href="http://www.cisco.com/en/US/tech/tk827/tk369/technologies_tech_note09186a008048cffc.shtml">this article</a>.</p>
<p><a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/r1.txt">Here</a> and <a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/r3.txt">here</a> are the complete configs for ipsec-protected GRE-tunnels in my home lab environment.</p>
<div class="shr-publisher-838"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://nat0.net/gre-tunneling-between-two-ios-routers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lab notes &#8211; WB1 Lab4 Part 1</title>
		<link>http://nat0.net/lab-notes-wb1-lab4-part-1/</link>
		<comments>http://nat0.net/lab-notes-wb1-lab4-part-1/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 13:46:22 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[CCIE Security Lab]]></category>
		<category><![CDATA[Cisco ASA]]></category>
		<category><![CDATA[Cisco IOS]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=829</guid>
		<description><![CDATA[Today I started to work with IPExpert CCIE Security workbook 1 Lab 4a &#8211; VPN-solutions. During my work I made the following notes which might be interresting to read for other CCIE-candidates. I will also from now on continue to do these notes and post them on this blog. Explaining and writing is simply a [...]]]></description>
			<content:encoded><![CDATA[<p></p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><div id="_mcePaste">Today I started to work with <a href="http://www.ipexpert.com/Cisco/CCIE/Security/Workbook/Technology-Focused-Security-Lab-Workbook">IPExpert CCIE Security workbook 1</a> Lab 4a &#8211; VPN-solutions. During my work I made the following notes which might be interresting to read for other CCIE-candidates. I will also from now on continue to do these notes and post them on this blog. Explaining and writing is simply a great way for me to learn.</div>
<div>Also, if my boss some day ask me what the heck I am doing all these work-hours, I will gladly give him a link to this blog. <img src='http://nat0.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </div>
<h3>Task 4.1 &#8211; IOS CA</h3>
<div>This was quite straight-forward. Make an IOS become a root certificate authority for later use.</div>
<div id="_mcePaste">
<ul>
<li>What confuses me is that there is nothing in the configuation telling it to authenticate with certificates. All there is compared to &#8220;normal&#8221; preshared-key-auth is a missing &#8220;authen pre-share&#8221;. Which ofcours means that authentication is done with the certificates by default. I understand, I just have to get used to the fact that there is no command visible in the crypto isakmp policy saying &#8220;authentication MY-CA-TRUSTPOINT&#8221;.</li>
<li> When entering a wrong peer in the crypto map, it´s not just enough to re-enter a new ip. Since a crypto map sequence can have multiple peers for redundancy the old one doesnt go away. The effect is that the tunnel goes up, after a while, since it first tries with the bad peer ip before trying the second one. Remove the first.</li>
<li>Me being more used to vpns in asa than in ios usually tear down vpn-tunnels with the commands &#8220;clear crypto isakmp sa&#8221; and &#8220;clear crypto ipsec sa&#8221;. In IOS the corresponding command is &#8220;clear crypto session&#8221;. Cool.</li>
</ul>
</div>
<h3>Task 4.2 &#8211; IOS L2L</h3>
<p>This is all about enrollment of certificates from the CA in previous task to two IOS-routers and setup an ipsec-tunnel.</p>
<ul>
<li> What confuses me is that there is nothing in the configuation telling it to authenticate with certificates. All there is compared to &#8220;normal&#8221; preshared-key-auth is a missing &#8220;authen pre-share&#8221;. Which ofcours means that authentication is done with the certificates by default. I understand, I just have to get used to the fact that there is no command visible in the crypto isakmp policy saying &#8220;authentication MY-CA-TRUSTPOINT&#8221;.</li>
<li>When entering a wrong peer in the crypto map, it´s not just enough to re-enter a new ip. Since a crypto map sequence can have multiple peers for redundancy the old one doesnt go away. The effect is that the tunnel goes up, after a while, since it first tries with the bad peer ip before trying the second one. Remove the first.</li>
<li>Me being more used to vpns in asa than in ios usually tear down vpn-tunnels with the commands &#8220;clear crypto isakmp sa&#8221; and &#8220;clear crypto ipsec sa&#8221;. In IOS the corresponding command is &#8220;clear crypto session&#8221;. Cool.</li>
</ul>
<h3>Task 4.3 &#8211; VPN IOS-ASA</h3>
<p>The task was to setup a tunnel between IOS and ASA. Preshared-key, all straight-forward. However, I was asked to prioritize to certan traffic going into the tunnel from the IOS-router. This was done by creating a service-policy on outside-interface like this:</p>
<p><code><br />
class-map match-all VPN-CLASS</code></p>
<p><code> </code></p>
<p><code>match access-group 150  ! The ACL that defines the traffic to prioritize</code></p>
<p><code>policy-map VPN-POLICY</code></p>
<p><code>class VPNCLASS</p>
<p>priority 200 (I was also assign to restrict the prioritized traffic to 200kbps)</p>
<p>interface Fa1/1</p>
<p></code></p>
<p><code>service-policy output VPN-POLICY<br />
</code></p>
<ul>
<li>And, dont forget to do &#8220;qos pre-classify&#8221; on the crypto map! Otherwise your class-map has to look for ESP-traffic and that is not very granular, is it? <img src='http://nat0.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>&#8220;create lo3 on r2, assign it ip 192.168.3.2/24&#8243; and &#8220;create a vpn tunnel between Vlan100 and the newly created loopback network&#8221;. I used &#8220;host 192.168.3.2&#8243; in acl, but it clearly states &#8220;the loopback _network_&#8221;. Darn!</li>
</ul>
<h3>Task 4.4 L2L Aggressive mode with PSK</h3>
<div id="_mcePaste">
<ul>
<li>Stuck Twice.</li>
</ul>
</div>
<div>I PROMISE NEVER TO FORGET TO APPLY THE CRYPTO MAP TO THE INTERFACE AGAIN</div>
<div id="_mcePaste">I PROMISE NOT TO FORGET TO APPLY THE CRYPTO MAP TO IF AGAIN</div>
<div id="_mcePaste">I PROMISE NOTTO FORGET TO APPLY THE CRYPTO MAP TO IF AGAIN</div>
<div id="_mcePaste">
<ul>
<li>Stuck again. Couldn´t get the tunnel up even when comparing my configs with the solution guide. After getting help from <a href="http://www.mail-archive.com/ccie_security@onlinestudylist.com/">OSL </a>I made it:</li>
</ul>
</div>
<p><span style="font-family: arial, sans-serif; line-height: normal; border-collapse: collapse; color: #333333;"><em>Hi</em></span></p>
<div><em><br />
</em></div>
<div><em>I am struggling with this task, I simply cannot get the tunnel up. And I cant see what Ive done wrong. </em></div>
<div><em><br />
</em></div>
<div><em>Background: Make a tunnle between r2 and r5. Assume that r5-ip is dynamic, the tunnel should only be initiated from r5. (that is: dynamic map on r2).</em></div>
<div><em><br />
</em></div>
<div><span style="font-family: arial, sans-serif; line-height: normal; border-collapse: collapse; color: #333333;"><em>The relevant parts of the config looks like this:</em></span></div>
<div><span style="font-family: arial, sans-serif; color: #333333;"><span style="border-collapse: collapse; line-height: normal;"><em><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; color: #000000;"><span style="border-collapse: separate; font-style: normal; line-height: 19px;"><br />
</span></span></em></span></span></div>
<div>Answer from Brandon:</div>
<p><span style="font-family: arial, sans-serif; line-height: normal; border-collapse: collapse; color: #333333;">Not sure if this is it or not but you have crypto isakmp key ipexpert<br />
hostname <a style="color: #364452;" href="http://r5.ipexpert.com/" target="_blank">r5.ipexpert.com</a> and the debug shows    FQDN name    : <a style="color: #364452;" href="http://r5.ipexpert.com/" target="_blank">R5.ipexpert.com</a></span></p>
<div>Voila! Changed the &#8220;r5&#8243; to &#8220;R5&#8243; and it started working!</div>
<h3>Task 4.5 L2L Overlapping subnets.</h3>
<div id="_mcePaste">The task was to create a tunnel between 4 routers to protect traffic between internal nets. The restrictions was: no static routing, no crypto maps and no GRE.</div>
<div id="_mcePaste">
<ul>
<li>I havent worked  very much with tunnel-interfaces but this was a pleasant first date. It´s kind of magic making a virtual interface and make the router route traffic thru it. Even more coolish when you encrypt the traffic and make a routing protocol talk thru the tunnel.</li>
<li>Since I wasn´t allowed to use static routing I had to create loopback-interfaces to force knowledge of that local networks translated address-space into the routing-protocol. I was thinking of some kind of &#8220;add-reverse-route&#8221;-option for the &#8220;ip nat source static network&#8221;-command but I guess there is no such solution? Or could this routing-issue be solved in another way?</li>
</ul>
</div>
<h3>Task 4.6 &#8211; Easy VPN Server on IOS</h3>
<div id="_mcePaste">
<ul>
<li>This task deals with connecting a plain ipsec-client from XP workstation to an VPN-server on ios. First step was to verify connectivity on XP. Wrong IP, changing it. Now, a good advice from someone &#8220;who knows&#8221;: Do NOT add a default route on the student NIC of the <a href="http://proctorlabs.com/PDF/sec_bp3_top.pdf">labb </a>pc:s. It has 2 nics and the other one is convinently named &#8220;Outside NIC &#8211; Do not Touch!&#8221; which is fine because thats how you reach the machine over internet. But if you add a default &#8220;gateway&#8221; on the student nic (which you are allowed to fool with) you will convert that kind little XP-machine into an unpredicible beast. If you are lucky u will reach it after a while and remove that default gw. So I´ve heard. <img src='http://nat0.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>IOS auto-enroll and the enroll-feature of ipsec vpn client is cool. Just point it to http://&lt;ios ca ip&gt;/cgi-bin/pkiclient.exe and request a certificate.</li>
<li> I had to look at the solution guide quite alot in this case. Even when doing that I couldnt get the vpn-client to connect. I just got these error messages:</li>
</ul>
</div>
<p><code> </code></p>
<p><code></p>
<div id="_mcePaste">Feb 26 12:35:24.740: ISAKMP:(1011):deleting SA reason "Recevied fatal informational" state (R) CONF_XAUTH    (peer 8.9.2.200)</div>
<div id="_mcePaste">Feb 26 12:35:24.740: ISAKMP:(1011):deleting SA reason "Recevied fatal informational" state (R) CONF_XAUTH    (peer 8.9.2.200)</div>
<p></code></p>
<div>
<ul>
<li>Suddenly I looked at the bottom right corner of my screen and saw tht the time was 3 minutes until the lab-period was over. I have never backed up a bunch of routers this fast before. First thing next lab-attempt will be to load the configs and troubleshoot the EasyVPN-config of R4.</li>
</ul>
</div>
<div>Conclusion of this lab so far: It´s intense! I´ve been configuring plenty of VPN-solutions before, but I guess that my experience covers only 20-30% of the VPN-related topics in this lab. All these profiles-configurations in IOS are all new to me. I guess I have some CCO-chapters to read during the weekend&#8230;</div>
<div>Here are my current configurations: <a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/asa1.txt" target="_blank">asa1</a>, <a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/r2.txt" target="_blank">r2</a>, <a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/r4.txt" target="_blank">r4</a>, <a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/r5.txt" target="_blank">r5 </a>and <a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/r6.txt" target="_blank">r6</a>.</div>
<div class="shr-publisher-829"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://nat0.net/lab-notes-wb1-lab4-part-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cisco IOS Zone Based Policy Firewall</title>
		<link>http://nat0.net/cisco-ios-zone-based-policy-firewall/</link>
		<comments>http://nat0.net/cisco-ios-zone-based-policy-firewall/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 18:37:57 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco IOS]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=680</guid>
		<description><![CDATA[The last days I have been testing Zone Based Policy Firewall in Cisco IOS. It´s a feature much like CBAC. It´s using the same basics of inspection-configuration. The major difference between CBAC and ZBFW is that while the first is built upon inspection at specific interfaces, the latter defines zones of one or many interfaces [...]]]></description>
			<content:encoded><![CDATA[<p></p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>The last days I have been testing Zone Based Policy Firewall in Cisco IOS. It´s a feature much like CBAC. It´s using the same basics of inspection-configuration. The major difference between CBAC and ZBFW is that while the first is built upon inspection at specific interfaces, the latter defines zones of one or many interfaces and then defines inspection in a single direction from one zone to another.</p>
<h2>Task 1</h2>
<p>To make a somewhat realistic scenario I take a router in my home-lab. It´s preconfigured for basic routing without filtering anything. The goal is to make the router stateful with ZBFW. I want to block all traffic thru the router except from outbound telnet. Lets rock.</p>
<p><a href="http://nat0.net/wp-content/uploads/2010/02/zbfw-topology.jpg"><img class="alignnone size-medium wp-image-736" title="zbfw topology" src="http://nat0.net/wp-content/uploads/2010/02/zbfw-topology-234x300.jpg" alt="" width="234" height="300" /></a></p>
<h3>Step 1. Define zones</h3>
<p>Each interface participating in a Zone Based Firewall-setup needs to be added to a zone. In this basic setup I have 2 zones: INSIDE and OUTSIDE</p>
<p><code><br />
zone security OUTSIDE<br />
zone security INSIDE<br />
</code></p>
<h3>Step 2. Applying zones to interfaces</h3>
<p>I have three interfaces in my setup: two internal an one external. The zone-membership is configured on interface-level.</p>
<p><code><br />
interface FastEthernet0<br />
zone-member security OUTSIDE<br />
!<br />
interface FastEthernet1<br />
zone-member security INSIDE<br />
!<br />
interface Vlan13<br />
zone-member security INSIDE<br />
</code></p>
<h3>3. Define allowed traffic</h3>
<p>Let´s focus on outbound traffic. We want to allow all telnet-traffic from our INSIDE-zone. This is done with a class-map type inspect. This class-map will later be reused for all other outbound traffic to be inspected, so remember to name it wisely.</p>
<p><code><br />
class-map type inspect match-any class-INSIDE-TO-OUTSIDE<br />
match protocol telnet<br />
</code></p>
<h3>4. Decide what do do with it</h3>
<p>Next step is configuring the policy-map. Since only one policy-map can be assigned at each function (in this case for traffic from INSIDE to OUTSIDE) it might be reused later. This policy-map will put together all actions we want to take on all traffic in the direction. For now we want to tell our router to inspect all traffic defined by the class-map created in the previous step.</p>
<p>The policy-map is processed in top-down order. At the end of the policy-map there is a class class-default that by default drops &#8220;all other&#8221; traffic, just the way the implicit deny ip any any does in access-lists.</p>
<p><code><br />
policy-map type inspect policy-INSIDE-TO-OUTSIDE<br />
class type inspect class-INSIDE-TO-OUTSIDE<br />
inspect<br />
class class-default<br />
drop<br />
!<br />
</code></p>
<h3>5. Apply it</h3>
<p>Now the final step is to apply this configuration. We have zones, let´s create a zone-pair. It is a definition of traffic from one zone to another, in one direction. Traffic in opposit direction (that is in our case: traffic initiated on OUTSIDE going to INSIDE) needs to be taken care of with another setup of class-map, policy-map and zone-pair.</p>
<p><code><br />
zone security OUTSIDE<br />
zone security INSIDE<br />
zone-pair security INSIDE-TO-OUTSIDE source INSIDE destination OUTSIDE<br />
service-policy type inspect policy-INSIDE-TO-OUTSIDE<br />
</code></p>
<h3>6. Logging</h3>
<p>Also, a really good command to remember is the &#8220;ip inspect log drop-pkt&#8221;. Without it you will not see traffic that gets dropped by the firewall. So remember to add it and maybe remove it as the last step before leaving the building&#8230;</p>
<p><code><br />
ip inspect log drop-pkt<br />
</code></p>
<h3>7. Verify</h3>
<p>Lets verify that I can telnet from INSIDE to OUTSIDE:</p>
<p><code><br />
r1#telnet 10.0.11.1<br />
Trying 10.0.11.1 ... Open</code></p>
<p><code> </code></p>
<p><code>User Access Verification</code></p>
<p><code> </code></p>
<p><code>Password:<br />
Password:<br />
Password:<br />
[Connection to 10.0.11.1 closed by foreign host]<br />
r1#<br />
</code></p>
<p>Great. It works.</p>
<p>What we have accomplished is to make a chain of &#8220;maps&#8221; that looks like this on a flow chart:</p>
<p><a href="http://nat0.net/wp-content/uploads/2010/02/zbfw1.jpg"><img class="alignnone size-medium wp-image-696" title="zbfw1" src="http://nat0.net/wp-content/uploads/2010/02/zbfw1-300x212.jpg" alt="" width="300" height="212" /></a></p>
<h2>Task 2. Also allow specific pings outbound</h2>
<p>The next task for me is to enable ping from inside hosts to the outside. To make it a bit trickier I decide to make an exception for the internal host 10.13.13.13 who should not be able to ping.</p>
<h3>Step 1. Define traffic</h3>
<p>First define what traffic will be allowed. Since we need to specify traffic on a per-host-level we cannot just &#8220;match protocol icmp&#8221; like we did with telnet, but instead do it with an access-list that is referred to in our previous created class-map (which is type match-any which mean that it can have multiple match-statements and it´s enough to match one of them).</p>
<p><code><br />
ip access-list extended acl-INSIDE-TO-OUTSIDE-inspect<br />
deny   icmp host 10.13.13.13 any echo<br />
permit icmp any any echo<br />
!<br />
</code></p>
<h3>2. Add it to the class-map.</h3>
<p><code><br />
class-map type inspect match-any class-INSIDE-TO-OUTSIDE<br />
match protocol telnet <strong> (&lt;--- Already there!)</strong><br />
match access-group name acl-INSIDE-TO-OUTSIDE-inspect<br />
</code></p>
<h3>3. Verify.</h3>
<p>Since the class-map were already in the policy-map with the action &#8220;inspect&#8221; I dont need to do anything else. We´re all done. Lets verify:</p>
<p><code><br />
r3#ping 10.0.11.1</code></p>
<p><code> </code></p>
<p><code>Type escape sequence to abort.<br />
Sending 5, 100-byte ICMP Echos to 10.0.11.1, timeout is 2 seconds:<br />
!!!!!<br />
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms<br />
r3#ping 10.0.11.1 sou lo0</code></p>
<p><code> </code></p>
<p><code>Type escape sequence to abort.<br />
Sending 5, 100-byte ICMP Echos to 10.0.11.1, timeout is 2 seconds:<br />
Packet sent with a source address of 10.13.13.13<br />
.....<br />
Success rate is 0 percent (0/5)<br />
r3#<br />
</code></p>
<p>Yes! We can ping an outside host, but not when sourcing from 10.13.13.13. This is verified by the log-output (remember the ip inspect log drop-pkt-command?):</p>
<p><code><br />
%FW-6-LOG_SUMMARY: 5 packets were dropped from 10.13.13.13:8 =&gt; 10.0.11.1:0 (target:class)-(INSIDE-TO-OUTSIDE:class-default)</code></p>
<p>Now the flow of configuration building-blocks looks like this:</p>
<p><a href="http://nat0.net/wp-content/uploads/2010/02/zbfw2.jpg"><img class="alignnone size-medium wp-image-697" title="zbfw2" src="http://nat0.net/wp-content/uploads/2010/02/zbfw2-300x215.jpg" alt="" width="300" height="215" /></a></p>
<p>So, why did I specify the telnet-traffic with &#8220;match protocol telnet&#8221; but the icmp-traffic with an access-list? First of all, the end-result is the same; it will inspect the state of the traffic. Even the pings are inspected and handled in a session-alike fashion.</p>
<p>When doing &#8220;match protocol telnet&#8221; i rely upon the PAM-table (Port Application Mapping) which by default saids that &#8220;telnet&#8221; equals tcp/23. If I add a PAM-entry that adds tcp/2323 to the telnet-application, traffic on that port should also have been inspected. But the granularity of just specifying the port or application was not good enough for the ping since we needed to define an exception for a single host.<br />
Of course I could also put the telnet-traffic into the access-list, it would have the exact same end result:</p>
<p><code><br />
class-map type inspect match-any class-INSIDE-TO-OUTSIDE<br />
no match protocol telnet<br />
!<br />
ip access-list extended acl-INSIDE-TO-OUTSIDE-inspect<br />
deny   icmp host 10.13.13.13 any echo<br />
permit icmp any any echo<br />
permit tcp any any eq 23<br />
</code></p>
<p>Notes:</p>
<ul>
<li>I have had a REALLY hard time trying to fully understand the concept of class-maps and policy-maps when doing inspection. This simple rule has made it so much easier to understand how to do and not: <strong>ALL class-maps and Policy-maps should be &#8220;type inspect&#8221; when working with inspection.</strong> Doing &#8220;class-map yadayo&#8221; without &#8220;type inspect&#8221; in between (and the same for policy-maps) just made me confused. Plain (as in not type inspect) policy-maps and class-maps are for other purposes than making the router stateful.</li>
<li>Security-zones doesnt cooperate very well with interface access-lists. Actually, the idea behind ZBFW is to replace acls on that router. That means that ZBFW doesn´t make any &#8220;holes&#8221; in any existing access-lists. Since interface-acls in inbound direction gets processed before zbfw you need to have access-lists &#8220;wide-open&#8221; enough to make sure that all ZBFW-traffic gets thru. I recommend not applying acls to interfaces when using ZBFW.</li>
<li>Traffic to and from the router itself are wide open in this example. There is a self-zone that takes care of this. Hopefully this will be covered in a later post.</li>
<li>Traffic between interfaces in the same zone are permitted.</li>
</ul>
<h3>Conclusion:</h3>
<p>ZBFW is cool if you have to secure a Cisco-router which have many interfaces that can be treated with the same security-policy.</p>
<div class="shr-publisher-680"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://nat0.net/cisco-ios-zone-based-policy-firewall/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PAM-table &#8211; a sheat-sheet for well known port numbers</title>
		<link>http://nat0.net/pam-table-a-sheat-sheet-for-well-known-port-numbers/</link>
		<comments>http://nat0.net/pam-table-a-sheat-sheet-for-well-known-port-numbers/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 21:35:22 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco IOS]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=682</guid>
		<description><![CDATA[The ip port-map router-command gives you an extensive list of protocols and their respective port-numbers. This can become handy at the CCIE lab where you dont have access to google]]></description>
			<content:encoded><![CDATA[<p></p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Do you have a hard time remembering all those port-numbers? Most of them are probably burned-in to the back of your head. But some of them can be hard remembering. For me for instance, I can never remember which port BGP uses. The problem is that when doing your CCIE-lab you have no access to your best friend; Google.</p>
<p>The solution? Use the PAM-table in the routers. This port-to-application-mapping is used for inspection engines that need to know which ports to inspect when doing http inspection as an example. This table can be tweaked but the default mapping can give you a huge load of information about most protocol. The command is &#8220;show ip port-map&#8221;:</p>
<p><code><br />
r1#sh ip port-map<br />
Default mapping:  snmp                 udp port 161                      system defined<br />
Default mapping:  echo                 tcp port 7                          system defined<br />
Default mapping:  echo                 udp port 7                          system defined<br />
Default mapping:  telnet               tcp port 23                         system defined<br />
Default mapping:  wins                 tcp port 1512                       system defined<br />
Default mapping:  n2h2server           tcp port 9285                       system defined<br />
Default mapping:  n2h2server           udp port 9285                       system defined<br />
Default mapping:  nntp                 tcp port 119                        system defined<br />
Default mapping:  pptp                 tcp port 1723                       system defined<br />
Default mapping:  rtsp                 tcp port 554,8554                   system defined<br />
Default mapping:  bootpc               udp port 68                         system defined<br />
Default mapping:  gdoi                 udp port 848                        system defined<br />
r1#<br />
</code></p>
<p>The table is quite extensive so I recommend piping the output to find what you are looking for. Like this&#8230;</p>
<p>BGP?<br />
<code><br />
r1#sh ip port-map | incl bgp<br />
Default mapping:  bgp                  tcp port 179                        system defined<br />
r1#</code></p>
<p>These Netbios-ports. Which is which?<br />
<code><br />
r1#sh ip port-map | incl netbios<br />
Default mapping:  netbios-dgm          udp port 138                        system defined<br />
Default mapping:  netbios-ssn          tcp port 139                        system defined<br />
Default mapping:  netbios-ns           udp port 137                        system defined<br />
r1#<br />
</code></p>
<p>And finally, what is that udp/520-traffic that shows up in my logs?<br />
<code><br />
r1#sh ip port-map | incl 520<br />
Default mapping:  router               udp port 520                        system defined<br />
r1#</code><br />
(Well. It would have been clearer if they just said &#8220;RIP&#8221; instead of &#8220;router&#8221;, but you get the point&#8230;)</p>
<div class="shr-publisher-682"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://nat0.net/pam-table-a-sheat-sheet-for-well-known-port-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IOS Archive feature</title>
		<link>http://nat0.net/ios-archive-feature/</link>
		<comments>http://nat0.net/ios-archive-feature/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 10:33:58 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco IOS]]></category>
		<category><![CDATA[English posts]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=653</guid>
		<description><![CDATA[What changes have been done since last &#8220;wr mem&#8221;? Or more like; what differences are there between running-config and startup-config? Use the archive-feature! r2#sh arch conf diff nvram:startup-config system:running-config Contextual config diffs: line vty 0 4 +transport input all +transport output all line vty 0 4 -transport input telnet -transport output all Wanna make periodic [...]]]></description>
			<content:encoded><![CDATA[<p></p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>What changes have been done since last &#8220;wr mem&#8221;? Or more like; what differences are there between running-config and startup-config?</p>
<p>Use the archive-feature!</p>
<p><code><br />
r2#sh arch conf diff nvram:startup-config system:running-config<br />
Contextual config diffs:<br />
line vty 0 4<br />
+transport input all<br />
+transport output all<br />
line vty 0 4<br />
-transport input telnet<br />
-transport output all</code></p>
<p></code></p>
<p>Wanna make periodic backups of the router config to local flash?</p>
<p>Use the archive-feature!</p>
<p><code><br />
r1#sh run | sect archive<br />
archive<br />
 log config<br />
  record rc<br />
  logging enable<br />
  hidekeys<br />
 path flash:backup<br />
 time-period 86400<br />
r1#<br />
</code></p>
<p>You can of course archive the config to an external server instead...</p>
<p><code><br />
r1(config)#archive<br />
r1(config-archive)#path ?<br />
  flash:  Write archive on flash: file system<br />
  ftp:    Write archive on ftp: file system<br />
  http:   Write archive on http: file system<br />
  https:  Write archive on https: file system<br />
  pram:   Write archive on pram: file system<br />
  rcp:    Write archive on rcp: file system<br />
  scp:    Write archive on scp: file system<br />
  tftp:   Write archive on tftp: file system</p>
<p>r1(config-archive)#<br />
</code></p>
<div class="shr-publisher-653"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://nat0.net/ios-archive-feature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco ACL logging with cookies</title>
		<link>http://nat0.net/cisco-acl-logging-with-cookies/</link>
		<comments>http://nat0.net/cisco-acl-logging-with-cookies/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 11:29:40 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco IOS]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[acl]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[router]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=603</guid>
		<description><![CDATA[The cookie-feature of logging in router access-lists is new for me and I fell in love with it at first sight! I don´t know how often I debug complexe acls trying to find where specific traffic hits. By adding a &#8220;cookie&#8221; after the log-statement in an ace you get that cookie tagged to all log-events. [...]]]></description>
			<content:encoded><![CDATA[<p></p><!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>The cookie-feature of logging in router access-lists is new for me and I fell in love with it at first sight! I don´t know how often I debug complexe acls trying to find where specific traffic hits. By adding a &#8220;cookie&#8221; after the log-statement in an ace you get that cookie tagged to all log-events. Look:</p>
<p><code><br />
R5(config-ext-nacl)#deny ip any any log ?<br />
  WORD  User defined cookie (max of 64 char)<br />
  <cr><br />
</code></p>
<p>Applied to an acl:</p>
<p><code><br />
ip access-list extended acl_vlan1256<br />
 permit icmp any any echo<br />
 permit icmp any any echo-reply<br />
 permit icmp any any traceroute<br />
 deny   tcp any host 9.4.45.4 eq www time-range MAINT<br />
 permit tcp any host 9.4.45.4 eq www<br />
 deny   tcp any eq bgp any log SOURCE-BGP<br />
 deny   tcp any any eq bgp log DEST-BGP<br />
 deny   udp any any eq ntp log BLOCKING_THAT_DAMN_NTP_THINGIE<br />
 deny   ip any any log BLOCK-ALL<br />
</code></p>
<p>And the logging looks like this:</p>
<p><code><br />
*Jan 14 22:25:59.246: %SEC-6-IPACCESSLOGP: list acl_vlan1256 denied tcp 9.9.156.9(25402) -> 9.9.156.5(179), 1 packet  [DEST-BGP]<br />
*Jan 14 22:26:23.586: %SEC-6-IPACCESSLOGP: list acl_vlan1256 denied tcp 9.9.156.9(18382) -> 9.9.156.5(23), 1 packet  [BLOCK-ALL]<br />
*Jan 14 22:26:28.438: %SEC-6-IPACCESSLOGP: list acl_vlan1256 denied tcp 9.9.156.9(179) -> 9.9.156.5(14918), 1 packet  [SOURCE-BGP]<br />
*Jan 14 22:26:33.267: %SEC-6-IPACCESSLOGP: list acl_vlan1256 denied tcp 9.9.156.9(26842) -> 9.9.156.5(179), 1 packet  [DEST-BGP]<br />
</code></p>
<p>Cool!</p>
<p><code><br />
To: Santa</p>
<p>Hi, dude!</p>
<p>Next christmas I wish the logging-cookie-feature-thing in ASA. Can I have it, please?</p>
<p>Regards Jimmy<br />
</code></p>
<div class="shr-publisher-603"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://nat0.net/cisco-acl-logging-with-cookies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

