<?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>iTechBlog &#187; Port Address Translation</title>
	<atom:link href="http://www.dide3d.com/tag/port-address-translation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dide3d.com</link>
	<description>Get Tech&#039;d...!                                              </description>
	<lastBuildDate>Mon, 06 Sep 2010 05:48:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>NAT Unplugged</title>
		<link>http://www.dide3d.com/2009/04/nat-unplugged/</link>
		<comments>http://www.dide3d.com/2009/04/nat-unplugged/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 12:01:51 +0000</pubDate>
		<dc:creator>Divin John</dc:creator>
				<category><![CDATA[Cisco *STUFF*]]></category>
		<category><![CDATA[NAT,PAT]]></category>
		<category><![CDATA[Routing]]></category>
		<category><![CDATA[Inside Global]]></category>
		<category><![CDATA[Inside Local]]></category>
		<category><![CDATA[inside Source]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[NAT Overload]]></category>
		<category><![CDATA[NAT Pool]]></category>
		<category><![CDATA[Outside Global]]></category>
		<category><![CDATA[Outside Local]]></category>
		<category><![CDATA[Outside Source]]></category>
		<category><![CDATA[PAT]]></category>
		<category><![CDATA[Port Address Translation]]></category>
		<category><![CDATA[sh ip nat translations]]></category>

		<guid isPermaLink="false">http://www.dide3d.com/?p=1051</guid>
		<description><![CDATA[In its simplest configuration, the Network Address Translator (NAT) operates on a router connecting two networks together; one of these networks (designated as inside) is addressed with either private or obsolete addresses that need to be converted into legal addresses before packets are forwarded onto the other network (designated as outside). The translation operates in [...]]]></description>
			<content:encoded><![CDATA[<blockquote>
<p style="text-align: left;">In its simplest configuration, the Network Address Translator (NAT) operates on a router connecting two networks together; one of these networks (designated as inside) is addressed with either private or obsolete addresses that need to be converted into legal addresses before packets are forwarded onto the other network (designated as outside). The translation operates in conjunction with routing, so that NAT can simply be enabled on a customer-side Internet access router when translation is desired.</p>
<p style="text-align: left;">
<p class="pSubhead1CMT" style="font-size: 9pt; font-style: normal; font-variant: normal; font-weight: bold; margin-left: 0pt; margin-right: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: uppercase;">TERMINOLOGY</p>
<p><a name="wp9000010"></a><span class="content"><a href="http://www.dide3d.com/wp-content/uploads/2009/04/nat.jpg"></a></span></p>
<p class="pCaption_HeadCMT" style="margin: 0pt 0pt 2pt; font-size: 7pt; font-style: normal; font-variant: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Figure 1</p>
<p><a name="wp9000011"></a></p>
<p class="pCaptionCMT" style="margin: 0pt 0pt 7pt; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">NAT Concepts</p>
<p><a name="wp9000012"></a></p>
<div><img id="wp2000001" src="http://www.cisco.com/en/US/technologies/tk648/tk361/tk438/images/09186a00803ee4ac_guest-Cisco_IOS_Network_Address_Translation-US-Product_Bulletin-EN_2_2_2_2_2_2_2_2_2_2-1.jpg" border="0" alt="" hspace="0" vspace="0" width="482" height="191" /></div>
<p class="pSubhead2CMT" style="font-size: 9pt; font-style: normal; font-variant: normal; font-weight: bold; margin-left: 0pt; margin-right: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;"><span id="more-1051"></span></p>
<p class="pSubhead2CMT" style="font-size: 9pt; font-style: normal; font-variant: normal; font-weight: bold; margin-left: 0pt; margin-right: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Inside</p>
<p><a name="wp9000013"></a></p>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">The set of networks that are subject to translation.</div>
<p><a name="wp9000014"></a></p>
<p class="pSubhead2CMT" style="font-size: 9pt; font-style: normal; font-variant: normal; font-weight: bold; margin-left: 0pt; margin-right: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Outside</p>
<p><a name="wp9000015"></a></p>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">All other addresses. Usually these are valid addresses located on the Internet.</div>
<p><a name="wp9000016"></a></p>
<p class="pCaption_HeadCMT" style="margin: 0pt 0pt 2pt; font-size: 7pt; font-style: normal; font-variant: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Figure 2</p>
<p><a name="wp9000017"></a></p>
<p class="pCaptionCMT" style="margin: 0pt 0pt 7pt; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">NAT Terminology « Inside Addressing»</p>
<p><a name="wp9000018"></a></p>
<div><img id="wp2000002" src="http://www.cisco.com/en/US/technologies/tk648/tk361/tk438/images/09186a00803ee4ac_guest-Cisco_IOS_Network_Address_Translation-US-Product_Bulletin-EN_2_2_2_2_2_2_2_2_2_2-2.jpg" border="0" alt="" hspace="0" vspace="0" width="477" height="250" /></div>
<p class="pSubhead2CMT" style="font-size: 9pt; font-style: normal; font-variant: normal; font-weight: bold; margin-left: 0pt; margin-right: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Inside Local</p>
<p><a name="wp9000019"></a></p>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Configured IP address assigned to a host on the inside network. Address may be globally unique, allocated out of the private address space defined in RFC 1918, or might be officially allocated to another organization</div>
<p><a name="wp9000020"></a></p>
<p class="pSubhead2CMT" style="font-size: 9pt; font-style: normal; font-variant: normal; font-weight: bold; margin-left: 0pt; margin-right: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Inside Global</p>
<p><a name="wp9000021"></a></p>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">The IP address of an inside host as it appears to the outside network, &#8220;Translated IP Address&#8221;. Addresses can be allocated from a globally unique address space, typically provided by the ISP (if the enterprise is connected to the global Internet)</div>
<p><a name="wp9000022"></a></p>
<p class="pCaption_HeadCMT" style="margin: 0pt 0pt 2pt; font-size: 7pt; font-style: normal; font-variant: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Figure 3</p>
<p><a name="wp9000023"></a></p>
<p class="pCaptionCMT" style="margin: 0pt 0pt 7pt; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">NAT Terminology &#8220;Outside Addressing&#8221;</p>
<p><a name="wp9000024"></a></p>
<div><img id="wp2000003" src="http://www.cisco.com/en/US/technologies/tk648/tk361/tk438/images/09186a00803ee4ac_guest-Cisco_IOS_Network_Address_Translation-US-Product_Bulletin-EN_2_2_2_2_2_2_2_2_2_2-3.jpg" border="0" alt="" hspace="0" vspace="0" width="482" height="250" /></div>
<p class="pSubhead2CMT" style="font-size: 9pt; font-style: normal; font-variant: normal; font-weight: bold; margin-left: 0pt; margin-right: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Outside Local</p>
<p><a name="wp9000025"></a></p>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">The IP address of an outside host as it appears to the inside network. These addresses can be allocated from the RFC 1918 space if desired.</div>
<p><a name="wp9000026"></a></p>
<p class="pSubhead2CMT" style="font-size: 9pt; font-style: normal; font-variant: normal; font-weight: bold; margin-left: 0pt; margin-right: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Outside Global</p>
<p><a name="wp9000027"></a></p>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">The configured IP address assigned to a host in the outside network.</div>
<p><a name="wp9000028"></a></p>
<p class="pSubhead2CMT" style="font-size: 9pt; font-style: normal; font-variant: normal; font-weight: bold; margin-left: 0pt; margin-right: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Simple Translation Entry</p>
<p><a name="wp9000029"></a></p>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">A translation entry which maps one IP address to another.</div>
<p><a name="wp9000030"></a></p>
<p class="pSubhead2CMT" style="font-size: 9pt; font-style: normal; font-variant: normal; font-weight: bold; margin-left: 0pt; margin-right: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Extended Translation Entry</p>
<p>A translation entry which maps one IP address and port pair to another.</p>
<h1><span class="content"></p>
<p class="pSubhead2CMT" style="font-size: 9pt; font-style: normal; font-variant: normal; font-weight: bold; margin-left: 0pt; margin-right: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Port Address Translation (PAT)</p>
<p></span></h1>
<p class="pSubhead2CMT" style="font-size: 9pt; font-style: normal; font-variant: normal; font-weight: bold; margin-left: 0pt; margin-right: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;"><span class="content"> <a name="wp9000041"></a></span></p>
<p class="pCaption_HeadCMT" style="margin: 0pt 0pt 2pt; font-size: 7pt; font-style: normal; font-variant: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Figure 4</p>
<p><a name="wp9000042"></a></p>
<p class="pCaptionCMT" style="margin: 0pt 0pt 7pt; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Basic Concepts of PAT</p>
<p><a name="wp9000043"></a></p>
<div><img id="wp2000004" src="http://www.cisco.com/en/US/technologies/tk648/tk361/tk438/images/09186a00803ee4ac_guest-Cisco_IOS_Network_Address_Translation-US-Product_Bulletin-EN_2_2_2_2_2_2_2_2_2_2-4.jpg" border="0" alt="" hspace="0" vspace="0" width="455" height="179" /></div>
<p><a name="wp9000044"></a></p>
<p class="pCaption_HeadCMT" style="margin: 0pt 0pt 2pt; font-size: 7pt; font-style: normal; font-variant: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Figure 5</p>
<p><a name="wp9000045"></a></p>
<p class="pCaptionCMT" style="margin: 0pt 0pt 7pt; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Unique Source Port per Translation Entry</p>
<p><a name="wp9000046"></a></p>
<div><img id="wp2000005" src="http://www.cisco.com/en/US/technologies/tk648/tk361/tk438/images/09186a00803ee4ac_guest-Cisco_IOS_Network_Address_Translation-US-Product_Bulletin-EN_2_2_2_2_2_2_2_2_2_2-5.jpg" border="0" alt="" hspace="0" vspace="0" width="357" height="160" /></div>
<p><a name="wp9000047"></a></p>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Several internal addresses can be NATed to only one or a few external addresses by using a feature called Port Address Translation (PAT) which is also referred to as &#8220;overload&#8221;, a subset of NAT functionality.</div>
<p><a name="wp9000048"></a></p>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">PAT uses unique source port numbers on the Inside Global IP address to distinguish between translations. Because the port number is encoded in 16 bits, the total number could theoretically be as high as 65,536 per IP address. PAT will attempt to preserve the original source port, if this source port is already allocated PAT will attempt to find the first available port number starting from the beginning of the appropriate port group 0-511<span class="cCMTDefault" style="font-style: normal; font-weight: normal; vertical-align: super;">1</span>, 512-1023 or 1024-65535. If there is still no port available from the appropriate group and more than one IP address is configured, PAT will move to the next IP address and try to allocate the original source port again. This continues until it runs out of available ports and IP addresses.</div>
<p><a name="wp9000031"></a></p></blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">The stuff above is from Cisco Doc CD. <a href="http://www.cisco.com/en/US/technologies/tk648/tk361/tk438/technologies_white_paper09186a0080091cb9.html" target="_blank">http://www.cisco.com/en/US/technologies/tk648/tk361/tk438/technologies_white_paper09186a0080091cb9.html</a></div>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Now to lab it up and find out whether this thing actually works.</div>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">I have 3 routers in this config. R0, R1, R2. R0 and R2 has FastEthernet Ports connected to a Switch. The lab topology is given below.</div>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;"><span class="content"><a href="http://www.dide3d.com/wp-content/uploads/2009/04/nat.jpg"><img class="size-full wp-image-1059 aligncenter" title="nat" src="http://www.dide3d.com/wp-content/uploads/2009/04/nat.jpg" alt="nat" width="534" height="334" /></a></span></div>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">I decided to use OSPF as the routing protocol. I set the interfaces up, gave them ip addresses. Now, The NAT part. I need to accomplish the following:</div>
<blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">A User on the R0 FastEthernet Segment when connecting to anywhere in the network through Se0/0 should go out with the IP address 200.4.4.0/24 and there should be full connectivity.</div>
</blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Here is the running-config of all the routers.</div>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">R0</div>
<blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">interface Serial0/0<br />
ip address 110.1.1.1 255.255.255.0<br />
ip nat outside<br />
ip virtual-reassembly<br />
serial restart-delay 0<br />
clock rate 64000<br />
!<br />
interface Serial0/1<br />
no ip address<br />
shutdown<br />
serial restart-delay 0<br />
!<br />
interface Serial0/2<br />
no ip address<br />
shutdown<br />
serial restart-delay 0<br />
!<br />
interface Serial0/3<br />
no ip address<br />
shutdown<br />
serial restart-delay 0<br />
!<br />
interface FastEthernet1/0<br />
ip address 40.4.4.5 255.255.255.0 secondary<br />
ip address 40.4.4.6 255.255.255.0 secondary<br />
ip address 40.4.4.7 255.255.255.0 secondary<br />
ip address 40.4.4.10 255.255.255.0 secondary<br />
ip address 40.4.4.11 255.255.255.0 secondary<br />
ip address 40.4.4.12 255.255.255.0 secondary<br />
ip address 40.4.4.13 255.255.255.0 secondary<br />
ip address 40.4.4.14 255.255.255.0 secondary<br />
ip address 40.4.4.20 255.255.255.0 secondary<br />
ip address 40.4.4.1 255.255.255.0<br />
ip nat inside<br />
ip virtual-reassembly<br />
duplex auto<br />
speed auto<br />
!<br />
router ospf 1<br />
log-adjacency-changes<br />
network 40.4.4.1 0.0.0.0 area 0<br />
network 110.1.1.1 0.0.0.0 area 0<br />
!<br />
ip http server<br />
no ip http secure-server<br />
!<br />
!<br />
ip nat translation timeout 5<br />
ip nat pool NAT_POOL 200.4.4.1 200.4.4.254 netmask 255.255.255.0 type match-host<br />
ip nat inside source static network 40.4.4.0 200.4.4.0 /24<br />
!<br />
!<br />
ip access-list standard PERMIT_ETH10_NAT<br />
permit 40.4.4.0 0.0.0.255 log<br />
!<br />
!</div>
</blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">R1</div>
<blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">interface Serial0/0<br />
ip address 110.1.1.2 255.255.255.0<br />
serial restart-delay 0<br />
clock rate 64000<br />
!<br />
interface Serial0/1<br />
ip address 120.1.1.2 255.255.255.0<br />
serial restart-delay 0<br />
clock rate 64000<br />
!<br />
interface Serial0/2<br />
no ip address<br />
shutdown<br />
serial restart-delay 0<br />
!<br />
interface Serial0/3<br />
no ip address<br />
shutdown<br />
serial restart-delay 0<br />
!<br />
router ospf 1<br />
log-adjacency-changes<br />
network 110.1.1.2 0.0.0.0 area 0<br />
network 120.1.1.2 0.0.0.0 area 0<br />
!<br />
ip http server<br />
no ip http secure-server<br />
!<br />
!<br />
!<br />
!<br />
!</div>
</blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">R2</div>
<blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">interface Serial0/0<br />
ip address 120.1.1.1 255.255.255.0<br />
serial restart-delay 0<br />
clock rate 64000<br />
!<br />
interface Serial0/1<br />
no ip address<br />
shutdown<br />
serial restart-delay 0<br />
!<br />
interface Serial0/2<br />
no ip address<br />
shutdown<br />
serial restart-delay 0<br />
!<br />
interface Serial0/3<br />
no ip address<br />
shutdown<br />
serial restart-delay 0<br />
!<br />
interface FastEthernet1/0<br />
ip address 20.2.2.10 255.255.255.0 secondary<br />
ip address 20.2.2.11 255.255.255.0 secondary<br />
ip address 20.2.2.12 255.255.255.0 secondary<br />
ip address 20.2.2.13 255.255.255.0 secondary<br />
ip address 20.2.2.1 255.255.255.0<br />
duplex auto<br />
speed auto<br />
!<br />
router ospf 1<br />
log-adjacency-changes<br />
network 20.2.2.1 0.0.0.0 area 0<br />
network 120.1.1.1 0.0.0.0 area 0<br />
!<br />
ip http server<br />
no ip http secure-server<br />
!</div>
</blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">If you are wondering why all the secondary IP addresses configured on R0&#8242;s Fa1/0. Its just a work around to simulate PC&#8217;s on the FastEthernet Segment. So that you can source ICMP Echo&#8217;s from those IP addresses rather than have a an actual PC on the ethernet segment with that IP address.</div>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">I have configured static NAT(Inside Source) using the command</div>
<blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">ip nat inside source static network 40.4.4.0 200.4.4.0 /24</div>
</blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">This statement specifies that i am trying do translate my inside local[40.4.4.0/24] (Fa1/0) to Outside local[200.4.4.0/24]. With this the entire 40.4.4.0/24 network gets translated to 200.4.4.0/24. This is equivalent to writing 254 One-to-One Static Mapping.</div>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Now to check whether my NATing is working. I tried pinging 20.2.2.1 with a source IP of 40.4.4.1</div>
<blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">R0#ping 20.2.2.1 sour<br />
R0#ping 20.2.2.1 source 40.4.4.1</p>
<p>Type escape sequence to abort.<br />
Sending 5, 100-byte ICMP Echos to 20.2.2.1, timeout is 2 seconds:<br />
Packet sent with a source address of 40.4.4.1<br />
&#8230;..<br />
Success rate is 0 percent (0/5)</p></div>
</blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Can you guess whats wrong? Is the NAT working? So i ran a debug ip nat and then tried pinging 20.2.2.1 with source 40.4.4.1.</div>
<blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">R0#debug ip nat<br />
IP NAT debugging is on<br />
R0#ping 20.2.2.1 source 40.4.4.1</p>
<p>Type escape sequence to abort.<br />
Sending 5, 100-byte ICMP Echos to 20.2.2.1, timeout is 2 seconds:<br />
Packet sent with a source address of 40.4.4.1</p>
<p>*Mar  1 00:11:16.411: NAT: s=40.4.4.1-&gt;200.4.4.1, d=20.2.2.1 [10].<br />
*Mar  1 00:11:18.407: NAT: s=40.4.4.1-&gt;200.4.4.1, d=20.2.2.1 [11].<br />
*Mar  1 00:11:20.407: NAT: s=40.4.4.1-&gt;200.4.4.1, d=20.2.2.1 [12].<br />
*Mar  1 00:11:21.647: NAT: expiring 200.4.4.1 (40.4.4.1)<br />
*Mar  1 00:11:22.407: NAT: s=40.4.4.1-&gt;200.4.4.1, d=20.2.2.1 [13].<br />
*Mar  1 00:11:24.407: NAT: s=40.4.4.1-&gt;200.4.4.1, d=20.2.2.1 [14].<br />
Success rate is 0 percent (0/5)</p></div>
</blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Indeed NAT&#8217;s working fine! So why are ICMP replies coming back to R0. The ICMP Echo packets are going out of R0&#8242;s Se0/0 interface with an IP of 200.4.4.1. So does R2 know how to reach the 200.4.4.0/24 network. R2&#8242;s routing table is pasted below.</div>
<blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">R2#sh ip route<br />
Codes: C &#8211; connected, S &#8211; static, R &#8211; RIP, M &#8211; mobile, B &#8211; BGP<br />
D &#8211; EIGRP, EX &#8211; EIGRP external, O &#8211; OSPF, IA &#8211; OSPF inter area<br />
N1 &#8211; OSPF NSSA external type 1, N2 &#8211; OSPF NSSA external type 2<br />
E1 &#8211; OSPF external type 1, E2 &#8211; OSPF external type 2<br />
i &#8211; IS-IS, su &#8211; IS-IS summary, L1 &#8211; IS-IS level-1, L2 &#8211; IS-IS level-2<br />
ia &#8211; IS-IS inter area, * &#8211; candidate default, U &#8211; per-user static route<br />
o &#8211; ODR, P &#8211; periodic downloaded static route</p>
<p>Gateway of last resort is not set</p>
<p>20.0.0.0/24 is subnetted, 1 subnets<br />
C       20.2.2.0 is directly connected, FastEthernet1/0<br />
110.0.0.0/24 is subnetted, 1 subnets<br />
O       110.1.1.0 [110/128] via 120.1.1.2, 00:13:26, Serial0/0<br />
40.0.0.0/24 is subnetted, 1 subnets<br />
O       40.4.4.0 [110/129] via 120.1.1.2, 00:13:26, Serial0/0<br />
120.0.0.0/24 is subnetted, 1 subnets<br />
C       120.1.1.0 is directly connected, Serial0/0</p></div>
</blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">and there you go. R2 doesn&#8217;t know how to get to 200.4.4.0/24. So the work around would be introducing that particular network into the OSPF domain.</div>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">To dodge this i add a static route on R0 for the 200.4.4.0/24 with the next-hop as R0&#8242;s FastEthernet Interface. and redistribute this into OSPF. And my R0&#8242;s running-config after the redistribution is pasted below.</div>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">R0</div>
<blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">interface Serial0/0<br />
ip address 110.1.1.1 255.255.255.0<br />
ip nat outside<br />
ip virtual-reassembly<br />
serial restart-delay 0<br />
clock rate 64000<br />
!<br />
interface Serial0/1<br />
no ip address<br />
shutdown<br />
serial restart-delay 0<br />
!<br />
interface Serial0/2<br />
no ip address<br />
shutdown<br />
serial restart-delay 0<br />
!<br />
interface Serial0/3<br />
no ip address<br />
shutdown<br />
serial restart-delay 0<br />
!<br />
interface FastEthernet1/0<br />
ip address 40.4.4.5 255.255.255.0 secondary<br />
ip address 40.4.4.6 255.255.255.0 secondary<br />
ip address 40.4.4.7 255.255.255.0 secondary<br />
ip address 40.4.4.10 255.255.255.0 secondary<br />
ip address 40.4.4.11 255.255.255.0 secondary<br />
ip address 40.4.4.12 255.255.255.0 secondary<br />
ip address 40.4.4.13 255.255.255.0 secondary<br />
ip address 40.4.4.14 255.255.255.0 secondary<br />
ip address 40.4.4.20 255.255.255.0 secondary<br />
ip address 40.4.4.1 255.255.255.0<br />
ip nat inside<br />
ip virtual-reassembly<br />
duplex auto<br />
speed auto<br />
!<br />
router ospf 1<br />
log-adjacency-changes<br />
<strong>redistribute static subnets</strong><br />
network 40.4.4.1 0.0.0.0 area 0<br />
network 110.1.1.1 0.0.0.0 area 0<br />
!<br />
ip http server<br />
no ip http secure-server<br />
!<br />
<strong>ip route 200.4.4.0 255.255.255.0 FastEthernet1/0 200</strong><br />
!<br />
ip nat translation timeout 5<br />
ip nat pool NAT_POOL 200.4.4.1 200.4.4.254 netmask 255.255.255.0 type match-host<br />
ip nat inside source static network 40.4.4.0 200.4.4.0 /24<br />
!<br />
!<br />
ip access-list standard PERMIT_ETH10_NAT<br />
permit 40.4.4.0 0.0.0.255 log<br />
!<br />
!</div>
</blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">R2&#8242;s Routing Table after the R0&#8242;s static route and redistribution</div>
<blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">R2#sh ip route<br />
Codes: C &#8211; connected, S &#8211; static, R &#8211; RIP, M &#8211; mobile, B &#8211; BGP<br />
D &#8211; EIGRP, EX &#8211; EIGRP external, O &#8211; OSPF, IA &#8211; OSPF inter area<br />
N1 &#8211; OSPF NSSA external type 1, N2 &#8211; OSPF NSSA external type 2<br />
E1 &#8211; OSPF external type 1, E2 &#8211; OSPF external type 2<br />
i &#8211; IS-IS, su &#8211; IS-IS summary, L1 &#8211; IS-IS level-1, L2 &#8211; IS-IS level-2<br />
ia &#8211; IS-IS inter area, * &#8211; candidate default, U &#8211; per-user static route<br />
o &#8211; ODR, P &#8211; periodic downloaded static route</p>
<p>Gateway of last resort is not set</p>
<p><strong>200.4.4.0/24 is subnetted, 1 subnets<br />
O E2    200.4.4.0 [110/20] via 120.1.1.2, 00:01:26, Serial0/0</strong><br />
20.0.0.0/24 is subnetted, 1 subnets<br />
C       20.2.2.0 is directly connected, FastEthernet1/0<br />
110.0.0.0/24 is subnetted, 1 subnets<br />
O       110.1.1.0 [110/128] via 120.1.1.2, 00:18:38, Serial0/0<br />
40.0.0.0/24 is subnetted, 1 subnets<br />
O       40.4.4.0 [110/129] via 120.1.1.2, 00:18:38, Serial0/0<br />
120.0.0.0/24 is subnetted, 1 subnets<br />
C       120.1.1.0 is directly connected, Serial0/0</div>
</blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">Now. I will try pinging again&#8230;..!</div>
<blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">R0#ping 20.2.2.1 source 40.4.4.1</p>
<p>Type escape sequence to abort.<br />
Sending 5, 100-byte ICMP Echos to 20.2.2.1, timeout is 2 seconds:<br />
Packet sent with a source address of 40.4.4.1<br />
!!!!!<br />
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/36/60 ms<br />
R0#<br />
*Mar  1 00:20:06.591: NAT: s=40.4.4.1-&gt;200.4.4.1, d=20.2.2.1 [30]<br />
*Mar  1 00:20:06.643: NAT*: s=20.2.2.1, d=200.4.4.1-&gt;40.4.4.1 [30]<br />
*Mar  1 00:20:06.651: NAT: s=40.4.4.1-&gt;200.4.4.1, d=20.2.2.1 [31]<br />
*Mar  1 00:20:06.691: NAT*: s=20.2.2.1, d=200.4.4.1-&gt;40.4.4.1 [31]<br />
*Mar  1 00:20:06.699: NAT: s=40.4.4.1-&gt;200.4.4.1, d=20.2.2.1 [32]<br />
*Mar  1 00:20:06.719: NAT*: s=20.2.2.1, d=200.4.4.1-&gt;40.4.4.1 [32]<br />
*Mar  1 00:20:06.723: NAT: s=40.4.4.1-&gt;200.4.4.1, d=20.2.2.1 [33]<br />
*Mar  1 00:20:06.747: NAT*: s=20.2.2.1, d=200.4.4.1-&gt;40.4.4.1 [33]<br />
*Mar  1 00:20:06.747: NAT: s=40.4.4.1-&gt;200.4.4.1, d=20.2.2.1 [34]<br />
*Mar  1 00:20:06.767: NAT*: s=20.2.2.1, d=200.4.4.1-&gt;40.4.4.1 [34]</p></div>
</blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">In the above excerpt 40.4.4.1 gets translated to 200.4.4.1. Note in the bottom excerpt 40.4.4.12 gets translated to 200.4.4.12. It indeed is a One-to-One Mapping.!</div>
<blockquote>
<div class="pBodyCMT" style="margin: 0pt 0pt 7pt; font-style: normal; font-variant: normal; font-weight: normal; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none;">R0#ping 20.2.2.1 source 40.4.4.12</p>
<p>Type escape sequence to abort.<br />
Sending 5, 100-byte ICMP Echos to 20.2.2.1, timeout is 2 seconds:<br />
Packet sent with a source address of 40.4.4.12<br />
!!!!!<br />
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/35/76 ms<br />
R0#<br />
*Mar  1 00:20:47.991: NAT: s=40.4.4.12-&gt;200.4.4.12, d=20.2.2.1 [35]<br />
*Mar  1 00:20:48.015: NAT*: s=20.2.2.1, d=200.4.4.12-&gt;40.4.4.12 [35]<br />
*Mar  1 00:20:48.023: NAT: s=40.4.4.12-&gt;200.4.4.12, d=20.2.2.1 [36]<br />
*Mar  1 00:20:48.091: NAT*: s=20.2.2.1, d=200.4.4.12-&gt;40.4.4.12 [36]<br />
*Mar  1 00:20:48.099: NAT: s=40.4.4.12-&gt;200.4.4.12, d=20.2.2.1 [37]<br />
*Mar  1 00:20:48.115: NAT*: s=20.2.2.1, d=200.4.4.12-&gt;40.4.4.12 [37]<br />
*Mar  1 00:20:48.123: NAT: s=40.4.4.12-&gt;200.4.4.12, d=20.2.2.1 [38]<br />
*Mar  1 00:20:48.143: NAT*: s=20.2.2.1, d=200.4.4.12-&gt;40.4.4.12 [38]<br />
*Mar  1 00:20:48.151: NAT: s=40.4.4.12-&gt;200.4.4.12, d=20.2.2.1 [39]<br />
R0#ping 20.2.2.1 source 40.4.4.12<br />
*Mar  1 00:20:48.167: NAT*: s=20.2.2.1, d=200.4.4.</p></div>
</blockquote>
<p>So you might be wondering can the same be accomplished by dynamic NATing(NOT PAT). Yes you can. Instead of the <strong>ip nat inside source static network 40.4.4.0 200.4.4.0 /24 </strong>you gotta give</p>
<p><strong>R0(config)#ip nat inside source list PERMIT_ETH10_NAT pool  NAT_POOL</strong></p>
<p>where PERMIT_ETH10_NAT is an accesslist specifying which packets are eligible for NAT. and NAT_POOL is a Pool of IP addresses for NAT(200.4.4.0/24).</p>
<p>If you want 40.4.4.1 &#8212;&gt; 200.4.4.1 and 40.4.4.12 &#8212;&gt; 200.4.4.1 , then you must use TYPE as Match-Host while specifying the NAT Pool.</p>
<p>For Example</p>
<blockquote><p>ip nat pool NAT_POOL 200.4.4.1 200.4.4.254 netmask 255.255.255.0 type <strong>match-host</strong></p></blockquote>
<p>For PAT just use</p>
<blockquote><p>R0(config)#ip nat inside source list PERMIT_ETH10_NAT pool  NAT_POOL <strong>overload</strong></p></blockquote>
<p>IP NAT translation table with dynamic NATing.</p>
<blockquote><p>R0#sh ip nat translations<br />
Pro Inside global      Inside local       Outside local      Outside global<br />
icmp 200.4.4.12:10     40.4.4.12:10       20.2.2.1:10        20.2.2.1:10<br />
icmp 200.4.4.12:11     40.4.4.12:11       20.2.2.1:11        20.2.2.1:11<br />
&#8212; 200.4.4.12         40.4.4.12          &#8212;                &#8212;<br />
icmp 200.4.4.20:12     40.4.4.20:12       20.2.2.1:12        20.2.2.1:12<br />
&#8212; 200.4.4.20         40.4.4.20          &#8212;                &#8212;</p></blockquote>
<p>Now The same NAT translation table after PAT is enabled.</p>
<blockquote><p>R0#sh ip nat translations<br />
Pro Inside global      Inside local       Outside local      Outside global<br />
icmp 200.4.4.1:16      40.4.4.1:16        20.2.2.1:16        20.2.2.1:16<br />
icmp 200.4.4.1:17      40.4.4.10:17       20.2.2.1:17        20.2.2.1:17<br />
icmp 200.4.4.1:18      40.4.4.11:18       20.2.2.1:18        20.2.2.1:18<br />
icmp 200.4.4.1:19      40.4.4.12:19       20.2.2.1:19        20.2.2.1:19</p></blockquote>
<p>See the inside global address. Its 200.4.4.1. and each Inside local (IP address,Portnumber) is mapped to a Inside Global(Ip address,Portnumber). In this way, we can support like 64000 connections simulataneously using a single inside global IP address.!</p>
<p>Refer : <a href="http://articles.techrepublic.com.com/5100-10878_11-1053789.html">http://articles.techrepublic.com.com/5100-10878_11-1053789.html</a><br />
<a href="http://www.cisco.com/en/US/technologies/tk648/tk361/tk438/technologies_white_paper09186a0080091cb9.html" target="_blank">http://www.cisco.com/en/US/technologies/tk648/tk361/tk438/technologies_white_paper09186a0080091cb9.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dide3d.com/2009/04/nat-unplugged/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
