<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://hurlster.com/wiki/index.php?action=history&amp;feed=atom&amp;title=NAT</id>
	<title>NAT - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://hurlster.com/wiki/index.php?action=history&amp;feed=atom&amp;title=NAT"/>
	<link rel="alternate" type="text/html" href="https://hurlster.com/wiki/index.php?title=NAT&amp;action=history"/>
	<updated>2026-08-25T19:00:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://hurlster.com/wiki/index.php?title=NAT&amp;diff=2539&amp;oldid=prev</id>
		<title>Gqwill69: /* Inside to Global back to Inside */</title>
		<link rel="alternate" type="text/html" href="https://hurlster.com/wiki/index.php?title=NAT&amp;diff=2539&amp;oldid=prev"/>
		<updated>2013-03-04T21:24:20Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Inside to Global back to Inside&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Inside to Global back to Inside =&lt;br /&gt;
==Problem==&lt;br /&gt;
Traditional NAT does not allow to access the outside global address from the inside. For example, you have created port address translation with&lt;br /&gt;
&lt;br /&gt;
 ip nat inside source static tcp 12.12.12.254 80 23.23.23.254 80&lt;br /&gt;
&lt;br /&gt;
and want to access the webserver with its &amp;quot;official&amp;quot; address, 23.23.23.23 from the LAN (inside). This doesnt work with traditional IOS NAT and requires other methods, like split DNS.&lt;br /&gt;
&lt;br /&gt;
Reason is the way NAT is implemented; inside-&amp;gt;outside NAT happens after routing. Basically, you try to contact an address that lives on the same interface you are coming from (inside).&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
However, with the introduction of NAT Virtual Interface (NVI), there are no inside/outside domains anymore. This makes life easier - no need to cope with ip nat inside/outside definitions anymore, you simply specify &amp;quot;ip nat enable&amp;quot; at each interface participating in address translation.&lt;br /&gt;
&lt;br /&gt;
With NVI, the router now does route lookup twice, one before the NAT decision, to determine if the NAT rules you configured apply, and then another lookup to forward the packet. This allows for the scenario described above:&lt;br /&gt;
&lt;br /&gt;
 ip nat source static tcp 12.12.12.254 80 23.23.23.254 80&lt;br /&gt;
&lt;br /&gt;
For this to work, you usually require translation of the clients on the inside local network 12.12.12.0, too, to avoid asymmetric traffic flow, especially when you run IOS FW feature set. Without that, the server 12.12.12.254 would see traffic from the client IPs sourced from 12.12.12.0/24 and return traffic directly, bypassing the NAT on the router.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ip access-list extended INSIDE&lt;br /&gt;
 permit ip 12.12.12.0 0.0.0.255 any&lt;br /&gt;
!&lt;br /&gt;
ip nat source list INSIDE interface FastEthernet0/1 overload&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Config and Reference==&lt;br /&gt;
===Caveats===&lt;br /&gt;
* Note the difference in the syntax, NVI is configured with &amp;quot;ip nat&amp;quot; opposite to traditional nat &amp;quot;ip nat [inside|outside]&amp;quot;.&lt;br /&gt;
* Some of the NVI config statements do not support route-maps for granular translation control.  &lt;br /&gt;
* In general, you will loose some visibility/flexibility/granularity, because you dont tell explicitly: &amp;quot;this net is inside&amp;quot; etc.&lt;br /&gt;
&lt;br /&gt;
===Links===&lt;br /&gt;
&lt;br /&gt;
[http://www.cisco.com/en/US/technologies/tk648/tk361/tk438/technologies_white_paper09186a0080091cb9_ps6640_Products_White_Paper.html NAT Overview]&lt;br /&gt;
&lt;br /&gt;
[http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080133ddd.shtml NAT Order of Operation]&lt;br /&gt;
&lt;br /&gt;
[http://www.cisco.com/en/US/docs/ios/12_3t/12_3t14/feature/guide/gtnatvi.html NVI feature description]&lt;br /&gt;
&lt;br /&gt;
[http://blog.internetworkexpert.com/2008/02/15/the-inside-and-outside-of-nat Detailed analysis from a slightly different angle]&lt;br /&gt;
&lt;br /&gt;
===Sample config===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(R1) -- 12.12.12.0 -- (R2) -- 23.23.23.0 -- (R3)&lt;br /&gt;
&lt;br /&gt;
R1:&lt;br /&gt;
&lt;br /&gt;
interface FastEthernet0/0&lt;br /&gt;
 ip address 12.12.12.254 255.255.255.0 secondary&lt;br /&gt;
 ! for testing only&lt;br /&gt;
 ip address 12.12.12.1 255.255.255.0&lt;br /&gt;
 duplex auto&lt;br /&gt;
 speed auto&lt;br /&gt;
 &lt;br /&gt;
 ip route 23.23.23.0 255.255.255.0 FastEthernet0/0 12.12.12.2&lt;br /&gt;
 &lt;br /&gt;
R2:&lt;br /&gt;
 &lt;br /&gt;
interface FastEthernet0/0&lt;br /&gt;
 ip address 12.12.12.2 255.255.255.0&lt;br /&gt;
 ip nat enable&lt;br /&gt;
 duplex auto&lt;br /&gt;
 speed auto&lt;br /&gt;
!&lt;br /&gt;
interface FastEthernet0/1&lt;br /&gt;
 ip address 23.23.23.2 255.255.255.0&lt;br /&gt;
 ip nat enable&lt;br /&gt;
 duplex auto&lt;br /&gt;
 speed auto&lt;br /&gt;
!&lt;br /&gt;
ip nat source list INSIDE interface FastEthernet0/1 overload&lt;br /&gt;
ip nat source static tcp 12.12.12.254 23 23.23.23.254 23 extendable&lt;br /&gt;
ip nat source static tcp 12.12.12.254 80 23.23.23.254 80 extendable &lt;br /&gt;
! &lt;br /&gt;
ip access-list extended INSIDE&lt;br /&gt;
 permit ip 12.12.12.0 0.0.0.255 any&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
R3:&lt;br /&gt;
 &lt;br /&gt;
interface FastEthernet0/0&lt;br /&gt;
 ip address 23.23.23.3 255.255.255.0&lt;br /&gt;
 duplex auto&lt;br /&gt;
 speed auto&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
R1#telnet 23.23.23.254&lt;br /&gt;
Trying 23.23.23.254 ... Open&lt;br /&gt;
&lt;br /&gt;
Password required, but none set&lt;br /&gt;
&lt;br /&gt;
R1#&lt;br /&gt;
&lt;br /&gt;
R2#sh ip nat nvi translations&lt;br /&gt;
Pro Source global      Source local       Destin  local      Destin  global&lt;br /&gt;
tcp 23.23.23.2:44076   12.12.12.1:44076   23.23.23.254:23    12.12.12.254:23&lt;br /&gt;
tcp 23.23.23.254:23    12.12.12.254:23    ---                ---&lt;br /&gt;
tcp 23.23.23.254:80    12.12.12.254:80    ---                ---&lt;br /&gt;
&lt;br /&gt;
[Connection to 23.23.23.254 closed by foreign host]&lt;br /&gt;
R1#telnet 23.23.23.254 80&lt;br /&gt;
Trying 23.23.23.254, 80 ... Open&lt;br /&gt;
&lt;br /&gt;
R1#&lt;br /&gt;
&lt;br /&gt;
R3#telnet 23.23.23.254&lt;br /&gt;
Trying 23.23.23.254 ... Open&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Password required, but none set&lt;br /&gt;
&lt;br /&gt;
[Connection to 23.23.23.254 closed by foreign host]&lt;br /&gt;
R3#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
= Ubuntu IPtables NAT =&lt;br /&gt;
PC --&amp;gt; (eth1)Ubuntu(eth0) --&amp;gt; Internet&lt;br /&gt;
 root@ubuntu:~# echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;br /&gt;
 root@ubuntu:~# /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE&lt;br /&gt;
 root@ubuntu:~# /sbin/iptables -A FORWARD -i eth0 -o eth1 -m state \&lt;br /&gt;
 --state RELATED,ESTABLISHED -j ACCEPT&lt;br /&gt;
 root@ubuntu:~# /sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Gqwill69</name></author>
	</entry>
</feed>