<?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#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>IP Neworking, Security and a bit of fun</title>
	<atom:link href="http://iptechtalk.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://iptechtalk.wordpress.com</link>
	<description>A blog where we discuss anything and everything regarding neworking, with emphasis on security for now...</description>
	<lastBuildDate>Mon, 09 Nov 2009 07:45:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='iptechtalk.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>IP Neworking, Security and a bit of fun</title>
		<link>http://iptechtalk.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://iptechtalk.wordpress.com/osd.xml" title="IP Neworking, Security and a bit of fun" />
	<atom:link rel='hub' href='http://iptechtalk.wordpress.com/?pushpress=hub'/>
		<item>
		<title>IPSec Hairpinning</title>
		<link>http://iptechtalk.wordpress.com/2009/11/07/ipsec-hairpinning/</link>
		<comments>http://iptechtalk.wordpress.com/2009/11/07/ipsec-hairpinning/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 08:18:18 +0000</pubDate>
		<dc:creator>Barooq</dc:creator>
				<category><![CDATA[EZVPN]]></category>
		<category><![CDATA[IPSEC VPNS]]></category>
		<category><![CDATA[Site to Site VPN]]></category>
		<category><![CDATA[IPSec Hairpinning]]></category>
		<category><![CDATA[L2LVPN]]></category>

		<guid isPermaLink="false">http://iptechtalk.wordpress.com/?p=45</guid>
		<description><![CDATA[Well, no I am not love with hairpinning, but come to think of it, this can be a useful feature. For example, your remote sites are site-site VPNs to your HQ and you are at home, using remote access VPN &#8230; <a href="http://iptechtalk.wordpress.com/2009/11/07/ipsec-hairpinning/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iptechtalk.wordpress.com&amp;blog=8552573&amp;post=45&amp;subd=iptechtalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well, no I am not love with hairpinning, but come to think of it, this can be a useful feature.</p>
<p>For example, your remote sites are site-site VPNs to your HQ and you are at home, using remote access VPN to access the HQ. It would be nice, if you could access the remote sites as well, wouldn&#8217;t it ?</p>
<p>Our scenario or rather mission is such.</p>
<p><img src="/Users/Badar/Desktop/IPSEC%20Hairpinning.jpg" alt="" /><img src="/Users/Badar/Desktop/IPSEC%20Hairpinning.jpg" alt="" /><img src="/Users/Badar/Desktop/IPSEC%20Hairpinning.jpg" alt="" /></p>
<div id="attachment_58" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-58" title="IPSEC Hairpinning" src="http://iptechtalk.files.wordpress.com/2009/11/ipsec-hairpinning2.jpg?w=500&#038;h=394" alt="IPSEC Hairpinning" width="500" height="394" /><p class="wp-caption-text">IPSEC Hairpinning Topology</p></div>
<p>We want to create a L2L VPN between ASA and R2 to encrypt traffic between 10.0.0.0/24 and 136.1.121.0/24 network.</p>
<p>Then we want users to access from R4, our ASA using EZVPN and these users should be allowed to send encrypted traffic over the already created L2L VPN. Static routes are permitted for this configuration.</p>
<p>All devices are running RIP ver 2 and have full reach-ability to each other.</p>
<p>NAT-Control is not enable on ASA.</p>
<p>Also, the topology  is similar to INE Remote access VPN labs, except, I have put R4 in VLAN 100 instead of a test PC.</p>
<p>We start with configuring a basic L2L VPN between ASA and R2.</p>
<p><strong>Configuration:</strong></p>
<p><strong>ASA:</strong></p>
<blockquote><p>crypto isakmp policy 10</p>
<p>authen pre-share</p>
<p>group 2</p>
<p>hash md5</p>
<p>encryption 3des</p>
<p>!</p>
<p>crypto isakmp key CISCO address 136.1.23.2</p>
<p>!</p>
<p>crypto ipsec transform T_SET esp-3des esp-md5-hmac</p>
<p>!</p>
<p>access-list 122 permit ip 136.1.121.0 255.255.255.0 10.0.0.0 255.255.255.0</p>
<p>!</p>
<p>crypto map IMAP 5 set transform-set T_SET</p>
<p>crypto map IMAP 5 match address 122</p>
<p>crypto map IMAP 5 set peer 136.1.23.2</p>
<p>!</p>
<p>crypto map IMAP interface outside</p></blockquote>
<p><strong>R2:</strong></p>
<blockquote><p>crypto isakmp policy 10</p>
<p>authen pre-share</p>
<p>group 2</p>
<p>hash md5</p>
<p>encryption 3des</p>
<p>!</p>
<p>crypto isakmp key 0 CISCO address 136.1.123.12</p>
<p>!</p>
<p>crypto ipsec transform T_SET esp-3des esp-md5-hmac</p>
<p>!</p>
<p>access-list 122 permit ip 10.0.0.0 0.0.0.255 136.1.121.0 0.0.0.255</p>
<p>!</p>
<p>crypto map IMAP 5 isakmp-ipsec</p>
<p>set transform-set T_SET</p>
<p>match address 122</p>
<p>set peer 136.1.123.12</p>
<p>!</p>
<p>int S0/1</p>
<p>crypto map IMAP</p>
<p>!</p></blockquote>
<p><em>Now to create an EZVPN tunnel, I would use the existing transform sets and crypto maps.</em></p>
<p><strong>Here is the configuration on ASA , which is our EZVPN server</strong></p>
<p><strong>ASA:<br />
</strong></p>
<blockquote><p>ip local pool LOCAL_POOL 20.0.0.1-20.0.0.255</p>
<p>!</p>
<p>vpn-addr-assign local</p>
<p>!</p>
<p>group-policy EZVPN_POLICY internal</p>
<p>group-policy EZVPN_POLICY attributes</p>
<p>vpn-tunnel-protocol ipsec</p>
<p>address-pools value LOCAL_POOL</p>
<p>!</p>
<p>tunnel-group EZVPN type remote-access</p>
<p>tunnel-group EZVPN ipsec-attributes</p>
<p>pre-shared-key CISCO</p>
<p>tunnel-group EZVPN general-attributes</p>
<p>default-group-policy EZVPN_POLICY</p>
<p>authentication-server-group LOCAL</p>
<p>!</p>
<p>crypto dynamic-map D_MAP 100 set transform-set T_SET</p>
<p>crypto dynamic-map D_MAP 100 set reverse-route</p>
<p>crypto map IMAP 20 ipsec-isakmp dynamic D_MAP</p>
<p>!</p>
<p>router rip</p>
<p>redistribute static</p>
<p>!</p></blockquote>
<p><strong>R4 EZVPN remote (Client):</strong></p>
<blockquote><p>crypto ipsec client ezvpn EZVPN</p>
<p>group EZVPN key CISCO</p>
<p>connect auto</p>
<p>mode client</p>
<p>peer 136.1.123.12</p>
<p>int lo0</p>
<p>crypto ipsec client ezvpn EZVPN inside</p>
<p>!</p>
<p>int fa0/0</p>
<p>crypto ipsec client ezvpn EZVPN outside</p>
<p>!</p></blockquote>
<p><strong>We test both tunnels</strong></p>
<p>For L2L:</p>
<p>R2:</p>
<blockquote><p>ping 136.1.121.1 source fa0/0</p>
<p>Sending 5, 100-byte ICMP Echos to 136.1.121.1, timeout is 2 seconds:</p>
<p>Packet sent with a source address of 10.0.0.2</p>
<p>.!!!!</p>
<p>Success rate is 80 percent (4/5), round-trip min/avg/max = 48/48/48 ms</p></blockquote>
<p>Rack1ASA1#</p>
<blockquote><p>sh crypto ipsec sa</p>
<p>interface: outside</p>
<p>Crypto map tag: IMAP, seq num: 5, local addr: 136.1.123.12</p>
<p>access-list 122 permit ip 136.1.121.0 255.255.255.0 10.0.0.0 255.255.255.0</p>
<p><strong>local ident (addr/mask/prot/port): (136.1.121.0/255.255.255.0/0/0)</strong></p>
<p><strong>remote ident (addr/mask/prot/port): (10.0.0.0/255.255.255.0/0/0)</strong></p>
<p>current_peer: 136.1.23.2</p>
<p><strong>#pkts encaps: 4, #pkts encrypt: 4, #pkts digest: 4</strong></p></blockquote>
<p><em>please pay close attention to IPSEC SAs to understand the difference.</em></p>
<p>Now we bring up EZVPN tunnel and test it</p>
<p>Rack1R4#</p>
<blockquote><p>crypto ipsec client ezvpn xauth</p>
<p>Username: test</p>
<p>Password:</p>
<p>Rack1R4#</p>
<p>Nov  6 09:33:29.201: %CRYPTO-6-EZVPN_CONNECTION_UP: (Client)  User=  Group=EZVPN  Client_public_addr=136.1.100.4  Server_public_addr=136.1.123.12  Assigned_client_addr=20.0.0.1</p>
<p>Rack1R4#</p>
<p>Nov  6 09:33:31.084: %LINK-3-UPDOWN: Interface Loopback10000, changed state to up</p>
<p>Nov  6 09:33:32.086: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback10000, changed state to up</p></blockquote>
<p>Rack1R4#</p>
<p>Rack1R1#</p>
<blockquote><p>sh ip route</p></blockquote>
<blockquote><p>Codes: C &#8211; connected, S &#8211; static, R &#8211; RIP, M &#8211; mobile, B &#8211; BGP</p>
<p>D &#8211; EIGRP, EX &#8211; EIGRP external, O &#8211; OSPF, IA &#8211; OSPF inter area</p>
<p>N1 &#8211; OSPF NSSA external type 1, N2 &#8211; OSPF NSSA external type 2</p>
<p>E1 &#8211; OSPF external type 1, E2 &#8211; OSPF external type 2</p>
<p>i &#8211; IS-IS, su &#8211; IS-IS summary, L1 &#8211; IS-IS level-1, L2 &#8211; IS-IS level-2</p>
<p>ia &#8211; IS-IS inter area, * &#8211; candidate default, U &#8211; per-user static route</p>
<p>o &#8211; ODR, P &#8211; periodic downloaded static route</p>
<p>Gateway of last resort is not set</p>
<p>136.1.0.0/24 is subnetted, 5 subnets</p>
<p>C       136.1.11.0 is directly connected, FastEthernet0/0.11</p>
<p>R       136.1.23.0 [120/2] via 136.1.121.12, 00:00:22, FastEthernet0/0.121</p>
<p>R       136.1.100.0 [120/2] via 136.1.121.12, 00:00:22, FastEthernet0/0.121</p>
<p>C       136.1.121.0 is directly connected, FastEthernet0/0.121</p>
<p>R       136.1.123.0 [120/1] via 136.1.121.12, 00:00:22, FastEthernet0/0.121</p>
<p><strong> 20.0.0.0/32 is subnetted, 1 subnets</strong></p>
<p><strong>R       20.0.0.1 [120/1] via 136.1.121.12, 00:00:16, FastEthernet0/0.121</strong></p>
<p>10.0.0.0/24 is subnetted, 1 subnets</p>
<p>R       10.0.0.0 [120/3] via 136.1.121.12, 00:00:23, FastEthernet0/0.121</p></blockquote>
<p>Rack1R4#ping 150.1.1.1 source lo0 rep 10</p>
<blockquote><p>Type escape sequence to abort.</p>
<p>Sending 10, 100-byte ICMP Echos to 150.1.1.1, timeout is 2 seconds:</p>
<p>Packet sent with a source address of 150.1.4.4</p>
<p>!!!!!!!!!!</p>
<p>Success rate is 100 percent (10/10), round-trip min/avg/max = 8/8/12 ms</p></blockquote>
<p><strong><em>All right, both our tunnels are up.</em></strong></p>
<p><strong><em>Now we will configure Hairpinning and allow EZVPN users through the L2L tunnel.</em></strong></p>
<p><em><br />
</em></p>
<p><strong>Hairpininnig Configuration ASA:</strong></p>
<blockquote><p>access-list 122 extended permit ip 20.0.0.0 255.255.255.0 10.0.0.0 255.255.255.0</p></blockquote>
<p><em>(The interesting traffic should also include traffic from 20.0.0.0/24 subnet which is the pool we are assigning to our users)</em></p>
<blockquote><p>same-security-traffic permit intra-interface</p></blockquote>
<p><em>(Since both VPNs terminate on outside interface, we have to use this command to allow traffic to enter and exit through outside interface)</em></p>
<p><strong>R4:</strong></p>
<blockquote><p>ip route 10.0.0.0 255.255.255.0 136.1.123.12</p></blockquote>
<p><em>(Because of RIP, R4 has a route towards 10.0.0.0/24 through R3 so the traffic wouldn&#8217;t traverse the tunnel. By this static route, we are forcing R4 or our EZVPN client to go through the EZVPN for the 10.0.0.0/24 subnet)</em></p>
<p><strong>R2:</strong></p>
<blockquote><p>ip route 20.0.0.0 255.255.255.0 136.1.123.12</p>
<p>access-list 122 permit ip 10.0.0.0 0.0.0.255 20.0.0.0 0.0.0.255</p></blockquote>
<p><em>(Again, the proxy ACL to allow traffic from EZVPN to traverse our L2L tunnel)</em></p>
<p>That seems all right.</p>
<p>Now lets test it.</p>
<p>but before, clear the SA&#8217;s and bring up the tunnels again.</p>
<p>All right, after bringing up the tunnels, here is my IPSEC SA</p>
<p>Rack1ASA1#</p>
<blockquote><p>sh crypto ipsec sa | inc local ident|remote ident|encaps|decaps</p>
<p><strong>local ident (addr/mask/prot/port): (136.1.121.0/255.255.255.0/0/0)</strong></p>
<p><strong>remote ident (addr/mask/prot/port): (10.0.0.0/255.255.255.0/0/0)</strong></p>
<p><strong>#pkts encaps: 4, #pkts encrypt: 4, #pkts digest: 4</strong></p>
<p><strong>#pkts decaps: 4, #pkts decrypt: 4, #pkts verify: 4</strong></p>
<p>#PMTUs sent: 0, #PMTUs rcvd: 0, #decapsulated frgs needing reassembly: 0</p>
<p><strong> local ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)</strong></p>
<p><strong> remote ident (addr/mask/prot/port): (20.0.0.1/255.255.255.255/0/0)</strong></p>
<p><strong> #pkts encaps: 10, #pkts encrypt: 10, #pkts digest: 10</strong></p>
<p><strong> #pkts decaps: 10, #pkts decrypt: 10, #pkts verify: 10</strong></p>
<p>#PMTUs sent: 0, #PMTUs rcvd: 0, #decapsulated frgs needing reassembly: 0</p></blockquote>
<p><em><strong>The local ident </strong><strong> (0.0.0.0/0.0.0.0/0/0) designates and EZVPN tunnel.</strong></em></p>
<p>Now I will ping 10.0.0.0/24 on R4 which will traverse both tunnels</p>
<p><strong>R4:</strong></p>
<blockquote><p>ping 10.0.0.2 source lo 0</p>
<p>Type escape sequence to abort.</p>
<p>Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:</p>
<p>Packet sent with a source address of 150.1.4.4</p>
<p>!!!!!</p>
<p>Success rate is 100 percent (5/5), round-trip min/avg/max = 52/52/56 ms</p></blockquote>
<p>Rack1R4#</p>
<p>Rack1R4#</p>
<blockquote><p>ping 10.0.0.2 source loopback 0 rep 100</p>
<p>Type escape sequence to abort.</p>
<p>Sending 100, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:</p>
<p>Packet sent with a source address of 150.1.4.4</p>
<p>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</p>
<p>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</p></blockquote>
<p>Rack1ASA1#</p>
<blockquote><p>sh crypto ipsec sa | inc local ident|remote ident|encaps|decaps</p>
<p><strong> local ident (addr/mask/prot/port): (20.0.0.0/255.255.255.0/0/0)</strong></p>
<p><strong> remote ident (addr/mask/prot/port): (10.0.0.0/255.255.255.0/0/0)</strong></p>
<p><strong> #pkts encaps: 106, #pkts encrypt: 106, #pkts digest: 106</strong></p>
<p><strong> #pkts decaps: 105, #pkts decrypt: 105, #pkts verify: 105</strong></p>
<p>#PMTUs sent: 0, #PMTUs rcvd: 0, #decapsulated frgs needing reassembly: 0</p>
<p><strong>local ident (addr/mask/prot/port): (136.1.121.0/255.255.255.0/0/0)</strong></p>
<p><strong>remote ident (addr/mask/prot/port): (10.0.0.0/255.255.255.0/0/0)</strong></p>
<p><strong>#pkts encaps: 4, #pkts encrypt: 4, #pkts digest: 4</strong></p>
<p><strong>#pkts decaps: 4, #pkts decrypt: 4, #pkts verify: 4</strong></p>
<p>#PMTUs sent: 0, #PMTUs rcvd: 0, #decapsulated frgs needing reassembly: 0</p>
<p><strong> local ident (addr/mask/prot/port): (0.0.0.0/0.0.0.0/0/0)</strong></p>
<p><strong> remote ident (addr/mask/prot/port): (20.0.0.1/255.255.255.255/0/0)</strong></p>
<p><strong> #pkts encaps: 115, #pkts encrypt: 115, #pkts digest: 115</strong></p>
<p><strong> #pkts decaps: 117, #pkts decrypt: 117, #pkts verify: 117</strong></p>
<p>#PMTUs sent: 0, #PMTUs rcvd: 0, #decapsulated frgs needing reassembly:</p></blockquote>
<ul>
<li>We have an SA from 20.0.0.0 – 10.0.0.0 . It is our L2L ASA for our EZVPN traffic. The encaps and decaps and what we expected.</li>
<li>The second one is our L2L SA between 136.1.121.0-10.0.0.0 networks and number of encaps decaps have not increased.</li>
<li>The third is our EZVPN SA. And along with the new L2L ASA, we have packets traversing this connection as well. Which means, our EZVPN users, trying to access 10.0.0.0/24 are also traversing L2L tunnel and we have achieved our objectives.</li>
</ul>
<p>Well folks, thats it for IPSEC hairpinning for now.</p>
<p>I know I am slow with the posts, but I&#8217;ve been studying for CCIE, remember?:)</p>
<p>I have done VOL1 INE labs and will be moving to Vol2 this week.</p>
<p>Also, if you stumble onto this article, please leave a comment. Tell me if you think it made any sense, or not? Was the format OK or needs something (More theory, more verification etc) and I would keep that in mind while writing the next tutorial.  And if you like the format and find the article useful, also drop in a line <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong><br />
</strong></p>
<br />Posted in EZVPN, IPSEC VPNS, Site to Site VPN Tagged: EZVPN, IPSec Hairpinning, L2LVPN <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iptechtalk.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iptechtalk.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iptechtalk.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iptechtalk.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iptechtalk.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iptechtalk.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iptechtalk.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iptechtalk.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iptechtalk.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iptechtalk.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iptechtalk.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iptechtalk.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iptechtalk.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iptechtalk.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iptechtalk.wordpress.com&amp;blog=8552573&amp;post=45&amp;subd=iptechtalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iptechtalk.wordpress.com/2009/11/07/ipsec-hairpinning/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b80abc5a27357a6fac491315dadff00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Barooq</media:title>
		</media:content>

		<media:content url="http://iptechtalk.files.wordpress.com/2009/11/ipsec-hairpinning2.jpg" medium="image">
			<media:title type="html">IPSEC Hairpinning</media:title>
		</media:content>
	</item>
		<item>
		<title>The need for DNS Doctoring on ASA: Methods and Workarounds</title>
		<link>http://iptechtalk.wordpress.com/2009/09/04/the-need-for-dns-doctoring-on-asa-methods-and-workarounds/</link>
		<comments>http://iptechtalk.wordpress.com/2009/09/04/the-need-for-dns-doctoring-on-asa-methods-and-workarounds/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 20:53:56 +0000</pubDate>
		<dc:creator>Barooq</dc:creator>
				<category><![CDATA[ASA]]></category>
		<category><![CDATA[DNS Doctoring]]></category>
		<category><![CDATA[DNAT]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://iptechtalk.wordpress.com/?p=20</guid>
		<description><![CDATA[In a typical DNS exchange a client sends a URL or hostname to a DNS server in order to determine the IP address of that host. The DNS server receives the request, looks up the name-to-IP-address mapping for that host, &#8230; <a href="http://iptechtalk.wordpress.com/2009/09/04/the-need-for-dns-doctoring-on-asa-methods-and-workarounds/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iptechtalk.wordpress.com&amp;blog=8552573&amp;post=20&amp;subd=iptechtalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a typical DNS exchange a client sends a URL or hostname to a DNS server in order to determine the IP address of that host. The DNS server receives the request, looks up the name-to-IP-address mapping for that host, and then provides the A-record with the IP address to the client. While this procedure works well in many situations, problems can occur. These problems can occur when the client and the host that the client tries to reach are both on the same of different private network behind NAT, but the DNS server used by the client is on another public network.</p>
<p>Without DNS doctoring or another solution enabled in this situation, if the client sends a DNS request for the IP address of the Web Server it is unable to access the WWW server. This is because the client receives an A-record that contains the mapped public address of WWW server. When the client tries to access this IP address, the security appliance drops the packets because it does not allow packet redirection on the same interface.</p>
<p>There are many permutations of this issue and different options to solve it. Mainly, we can summarize the solution in following three methods</p>
<p>1)      <span style="text-decoration:underline;">Using Alias command for DNS Doctoring or Destination NAT</span></p>
<p>2)      <span style="text-decoration:underline;">Using Static with DNS Keyword for DNS Doctoring.</span></p>
<p>3)      <span style="text-decoration:underline;">Using Hairpinning and DNAT instead of DNS Doctoring.</span></p>
<p>Based on the location of clients and web-server we can have the following situations.</p>
<ul>
<li>Clients and Web Server are both on DMZ while DNS Server is a public server on the Outside. (DMZ can be changed with inside as the emphasis is client and Web Server being behind the same interface)</li>
<li>Web Server is on DMZ and Clients are on inside.</li>
</ul>
<p>The tutorial will show all possible ways in which the problem can be solved based on the clients.</p>
<p>We’ll use the Test Server as client in both DMZ and use a router for DNS requests on the inside. We will be using the topology of InternetworkExpert<a href="#_edn1">[i]</a> and though the Lab Workbook 1 has two excellent labs on the topic, we’ll go further and include all possible scenarios.</p>
<h3><strong>Topology:</strong></h3>
<p><img class="aligncenter size-full wp-image-25" title="topology" src="http://iptechtalk.files.wordpress.com/2009/09/topology1.jpg?w=500" alt="topology"   /></p>
<p>We’ll use the test server as inside as well as on DMZ zone to simulate clients.</p>
<h3><strong>Scenario 1:</strong></h3>
<h3><strong>Using the Alias Command for DNS Doctoring and DNAT:</strong></h3>
<p>First, let’s describe the difference between the two.</p>
<p>DNS Doctoring performs two functions:</p>
<ul>
<li>Translates a public address (the routable or mapped address) in a DNS reply to a private address (the real address) when the DNS client is on a private interface.</li>
<li>Translates a private address to a public address when the DNS client is on the public interface.</li>
</ul>
<p>While DNAT or Destination NAT has the following functions</p>
<ul>
<li>In dnat, the ASA changes the destination IP of an application call from one IP address to another IP address.</li>
<li>This process is used when you want the actual application call from the internal client to the server in a perimeter (dmz) network by its external IP address. This does not &#8220;doctor&#8221; the DNS replies.</li>
</ul>
<p>So for Clients on the DMZ, we would use DNS Doctoring and for Clients on inside, we will use DNAT. Technically the configuration will be same, but its important to understand whats actually happening here.</p>
<h3>Configuration and Explanation:</h3>
<p>As First step, we will not configure the DNS Doctoring and simulate the issue. This will be our basic configuration on ASA.</p>
<h3>ASA1:</h3>
<h3><strong>Nat-control</strong></h3>
<p><strong>nat (inside) 1 0 0</strong></p>
<p><strong>nat (dmz) 1 0 0</strong></p>
<p><strong>global (outside) 1 interface</strong></p>
<p><strong>static (dmz,outside) 136.1.122.100 10.0.0.100</strong></p>
<p><strong>static (inside,dmz) 136.1.121.0 136.1.121.0 netmask 255.255.255.0</strong></p>
<p><strong>access-list OUT_IN permit ip any any </strong></p>
<p><strong>access-group OUT_IN in interface outside</strong></p>
<h3>R2:</h3>
<p><strong>ip dns server</strong></p>
<p><strong>ip host WWW 136.1.122.100</strong></p>
<p>Now we’ll make the Test Server in inside VLAN first and Then in DMZ and Try to reach the WWW server after DNS resolution from R2:</p>
<p><strong>int fa 0/20</strong></p>
<p><strong>swit acc vlan 120</strong></p>
<p>In IE topology, the Test server is connected with SW2F0/20</p>
<p><img class="aligncenter size-full wp-image-26" title="untitled" src="http://iptechtalk.files.wordpress.com/2009/09/untitled.jpg?w=500" alt="untitled"   /></p>
<p>As you can see the DNS server is resolving the IP to 136.1.122.100 which the published IP.</p>
<p>The problem with this resolution is that ASA will drop the traffic.</p>
<h3>R1:</h3>
<p><strong>ip domain lookup </strong></p>
<p><strong>ip name-server 136.1.122.2</strong></p>
<p><strong>Rack1R1#ping WWW</strong></p>
<p><strong>Translating &#8220;WWW&#8221;&#8230;domain server (136.1.122.2) [OK]</strong></p>
<p><strong> </strong></p>
<p><strong>Translating &#8220;WWW&#8221;&#8230;domain server (136.1.122.2) [OK]</strong></p>
<p><strong> </strong></p>
<p><strong>Type escape sequence to abort.</strong></p>
<p><strong>Sending 5, 100-byte ICMP Echos to 136.1.122.100, timeout is 2 seconds:</strong></p>
<p><strong>&#8230;..</strong></p>
<p><strong>Success rate is 0 percent (0/5)</strong></p>
<p>Now we’ll use the DNS Doctoring and DNAT and test again. We’ll change the test server to inside zone and repeat the testing process.</p>
<p><strong>alias (dmz) 10.0.0.100 136.1.122.100 255.255.255.255</strong></p>
<p><strong>alias (inside) 10.0.0.100 136.1.122.100 255.255.255.255</strong></p>
<p><strong>sysopt noproxyarp  inside</strong></p>
<p><strong>sysopt noproxyarp  dmz</strong></p>
<p>Now on R1:</p>
<p><strong>Rack1R1#ping WWW</strong></p>
<p><strong>Translating &#8220;WWW&#8221;&#8230;domain server (136.1.122.2) [OK]</strong></p>
<p><strong> </strong></p>
<p><strong>Type escape sequence to abort.</strong></p>
<p><strong>Sending 5, 100-byte ICMP Echos to 10.0.0.100, timeout is 2 seconds:</strong></p>
<p><strong>&#8230;..</strong></p>
<p><strong>Success rate is 0 percent (0/5)</strong></p>
<p><strong> </strong></p>
<p>As we can see, now the server name is resolved to DMZ address 10.0.0.100, for clients on DMZ and inside Zone and there is no need for redirection on outside interface anymore. The ping is not allowed because on DMZ interface ICMP is dropped. But DNS resolution is what we want</p>
<p>Also on our client</p>
<h3>Some Notes:</h3>
<p><img class="aligncenter size-full wp-image-27" title="untitleds" src="http://iptechtalk.files.wordpress.com/2009/09/untitleds.jpg?w=500" alt="untitleds"   /></p>
<p>Other Configuration Notes</p>
<ul>
<li>The interface in the <strong>alias</strong> command needs to be the &#8220;interface&#8221; that the clients call from.</li>
<li>You can have multiple <strong>alias</strong> commands tied to different interfaces on the same ASA</li>
</ul>
<h3>Scenario 2:</h3>
<h3><span style="text-decoration:underline;">Using Static with DNS Keyword for DNS Doctoring:</span></h3>
<p>Remove the previous Alias commands.</p>
<p>Now we’ll use the Static command with DNS keyword to solve the issue.</p>
<p>For clients on the DMZ we’ll need this command as we need DNS Doctoring. But remember we used alias for Destination NAT previously for clients on inside. In this case, with static command we will not need to do an anything for clients on the inside as dns keyword will take care of that. Because the DNS reply will be changed at the outside interface to 10.0.0.100, so both clients on inside and DMZ will be able to access the host using the private IP address.</p>
<p><strong>Here is the configuration</strong></p>
<p><strong>clear configure alias</strong></p>
<p><strong> </strong></p>
<p><strong>no static (dmz,outside) 136.1.122.100 10.0.0.100 netmask 255.255.255.255</strong></p>
<p><strong>static (dmz,outside) 136.1.122.100 10.0.0.100 dns netmask 255.255.255.255</strong></p>
<p><strong>Here is the verification.</strong></p>
<p><strong>Rack1R1#ping WWW</strong></p>
<p><strong>Translating &#8220;WWW&#8221;&#8230;domain server (136.1.122.2) [OK]</strong></p>
<p><strong> </strong></p>
<p><strong>Type escape sequence to abort.</strong></p>
<p><strong>Sending 5, 100-byte ICMP Echos to 10.0.0.100, timeout is 2 seconds:</strong></p>
<p><strong>&#8230;..</strong></p>
<p><strong>Success rate is 0 percent (0/5)</strong></p>
<p><strong>Rack1R1# </strong></p>
<p><strong>And on the client</strong></p>
<p><img class="aligncenter size-full wp-image-28" title="untitled3" src="http://iptechtalk.files.wordpress.com/2009/09/untitled3.jpg?w=500" alt="untitled3"   /></p>
<h3>Scenario 3:</h3>
<h3><span style="text-decoration:underline;">Using Hairpinning and DNAT instead of DNS Doctoring.</span></h3>
<p>Remember the main raison deter of the alias command is that ASA doesn’t allow the packet redirection on same interface. What if we can change this behavior?</p>
<p>This wasn’t possible in earlier versions (and if you ask me, it shouldn’t be as it’s a serious security breach). But Cisco bowing to the demands of customers and in order to match checkpoint allows this feature now. This is called Hairpinning.</p>
<p>In our scenario, we’ll do hairpinning for the clients on DMZ and DNAT for the clients on the inside. Here is what Cisco’s website says about Hairpinning</p>
<p><em>“Hairpinning is the process by which traffic is sent back out the same interface on which it arrived. This feature was introduced in security appliance software version 7.0. For versions earlier than 7.2(1), it is required that at least one arm of the hairpinned traffic (inbound or outbound) be encrypted. From 7.2(1) and later, this requirement is no longer in place. Both the traffic inbound and the traffic outbound might be unencrypted when you use 7.2(1). </em></p>
<p><em>Hairpinning, in conjunction with a static NAT statement, can be used to achieve the same effect as DNS doctoring. This method does not change the contents of the DNS A-record that is returned from the DNS server to the client.”</em></p>
<p>For clients on inside, we’ll simply publish the public address of our WWW server by using static command.</p>
<p><strong>Here is the configuration.</strong></p>
<p><strong>static (dmz,outside) 136.1.122.100 10.0.0.100 netmask 255.255.255.255 </strong></p>
<p><strong>static (inside,dmz) 136.1.121.0 136.1.121.0 netmask 255.255.255.0</strong></p>
<p><strong>same-security-traffic permit intra-interface </strong><em>(Enables Hairpinning and redirection on interface)</em><strong> </strong></p>
<p><strong>global (dmz) 1 interface </strong><em>(nat-control is enabled. Traffic going to DMZ must be Natted)</em><strong> </strong></p>
<p><strong>static (dmz,dmz) 136.1.122.100 10.0.0.100 </strong></p>
<p><strong>static (dmz,inside) 136.1.122.100 10.0.0.100</strong></p>
<p><strong>For Testing:</strong></p>
<p><strong>access-list DMZ_IN permit ip any any</strong></p>
<p><strong>access-group DMZ_IN in interface dmz</strong></p>
<p><strong> </strong></p>
<p>Here is the verification.</p>
<p><strong>Rack1R1#telnet WWW 80</strong></p>
<p><strong>Translating &#8220;WWW&#8221;&#8230;domain server (136.1.122.2) [OK]</strong></p>
<p><strong>Trying WWW (136.1.122.100, 80)&#8230; Open</strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong>HTTP/1.1 400 Bad Request</strong></p>
<p><strong>Server: Microsoft-IIS/5.0</strong></p>
<p><strong>Date: Fri, 04 Sep 2009 18:43:11 GMT</strong></p>
<p><strong>Content-Type: text/html</strong></p>
<p><strong>Content-Length: 87</strong></p>
<p><strong> </strong></p>
<p><strong>&lt;html&gt;&lt;head&gt;&lt;title&gt;Error&lt;/title&gt;&lt;/head&gt;&lt;body&gt;The parameter is incorrect. &lt;/body&gt;&lt;/html&gt;</strong></p>
<div>
<p><strong>[Connection to WWW closed by foreign host]</strong></div>
<div>
<p><strong> </strong></div>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong>As you can see, even though the DNS resolves to 136.1.122.100, R1 is able to reach .</strong></p>
<p><strong>Similarly for hosts in DMZ</strong></p>
<p><strong><img class="aligncenter size-full wp-image-29" title="a" src="http://iptechtalk.files.wordpress.com/2009/09/a.jpg?w=500" alt="a"   /></strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><img class="aligncenter size-full wp-image-30" title="b" src="http://iptechtalk.files.wordpress.com/2009/09/b.jpg?w=500" alt="b"   /></p>
<p>I hope this tutorial is useful of the non-existent reader base of this blog J</p>
<hr size="1" /><a href="#_ednref1">[i]</a> Copyrighted topology-The writer of this blog has obtained permission from Mr.Brian and Mr.Peter to use the topology or diagram as reference.</p>
<br />Posted in ASA, DNS Doctoring Tagged: ASA, DNAT, DNS Doctoring, Security <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iptechtalk.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iptechtalk.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iptechtalk.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iptechtalk.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iptechtalk.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iptechtalk.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iptechtalk.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iptechtalk.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iptechtalk.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iptechtalk.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iptechtalk.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iptechtalk.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iptechtalk.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iptechtalk.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iptechtalk.wordpress.com&amp;blog=8552573&amp;post=20&amp;subd=iptechtalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iptechtalk.wordpress.com/2009/09/04/the-need-for-dns-doctoring-on-asa-methods-and-workarounds/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b80abc5a27357a6fac491315dadff00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Barooq</media:title>
		</media:content>

		<media:content url="http://iptechtalk.files.wordpress.com/2009/09/topology1.jpg" medium="image">
			<media:title type="html">topology</media:title>
		</media:content>

		<media:content url="http://iptechtalk.files.wordpress.com/2009/09/untitled.jpg" medium="image">
			<media:title type="html">untitled</media:title>
		</media:content>

		<media:content url="http://iptechtalk.files.wordpress.com/2009/09/untitleds.jpg" medium="image">
			<media:title type="html">untitleds</media:title>
		</media:content>

		<media:content url="http://iptechtalk.files.wordpress.com/2009/09/untitled3.jpg" medium="image">
			<media:title type="html">untitled3</media:title>
		</media:content>

		<media:content url="http://iptechtalk.files.wordpress.com/2009/09/a.jpg" medium="image">
			<media:title type="html">a</media:title>
		</media:content>

		<media:content url="http://iptechtalk.files.wordpress.com/2009/09/b.jpg" medium="image">
			<media:title type="html">b</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction</title>
		<link>http://iptechtalk.wordpress.com/2009/07/13/introduction/</link>
		<comments>http://iptechtalk.wordpress.com/2009/07/13/introduction/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 11:03:18 +0000</pubDate>
		<dc:creator>Barooq</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Introduction]]></category>

		<guid isPermaLink="false">http://iptechtalk.wordpress.com/?p=3</guid>
		<description><![CDATA[Hello I am Barooq, CCIE # 22087. I kept a blog at http://ccie-chronicles.blogspot.com and also wrote some articles on http://www.cciecandidate.com during my ccie R/s preperation. After a hiatus spanning over 8 months, I am back in the game. Prepering for my &#8230; <a href="http://iptechtalk.wordpress.com/2009/07/13/introduction/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iptechtalk.wordpress.com&amp;blog=8552573&amp;post=3&amp;subd=iptechtalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello I am Barooq, CCIE # 22087.</p>
<p>I kept a blog at <a href="http://ccie-chronicles.blogspot.com">http://ccie-chronicles.blogspot.com</a> and also wrote some articles on <a href="http://www.cciecandidate.com">http://www.cciecandidate.com</a> during my ccie R/s preperation.</p>
<p>After a hiatus spanning over 8 months, I am back in the game. Prepering for my CCIE security ( The effort has just begun).</p>
<p>I shifted from blogspot for two reasons</p>
<p>1) I want this blog to be about networking in general, not ccie prep particularly.</p>
<p>2)Lets face it, blogspot sucks:)</p>
<p>I will be writing tutorials and general tech talk, predominantly about security related topics (CCIE and general) and will also include my observations, whatever intersting subject I encounter during the prep and at work etc.</p>
<p>I am using INE products (Workbooks only). I have always heard great things about COD, but even after the gracious discount, it was out of my reach.</p>
<p>Hopefully, my first tech post will be there somewhre this week:)</p>
<p>Peace to all</p>
<br />Posted in Uncategorized Tagged: General, Introduction <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iptechtalk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iptechtalk.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iptechtalk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iptechtalk.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iptechtalk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iptechtalk.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iptechtalk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iptechtalk.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iptechtalk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iptechtalk.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iptechtalk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iptechtalk.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iptechtalk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iptechtalk.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iptechtalk.wordpress.com&amp;blog=8552573&amp;post=3&amp;subd=iptechtalk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iptechtalk.wordpress.com/2009/07/13/introduction/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b80abc5a27357a6fac491315dadff00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Barooq</media:title>
		</media:content>
	</item>
	</channel>
</rss>
