{"id":787,"date":"2024-12-04T04:01:50","date_gmt":"2024-12-04T01:01:50","guid":{"rendered":"https:\/\/itgen.itbumper.com\/?page_id=787"},"modified":"2024-12-05T03:28:06","modified_gmt":"2024-12-05T00:28:06","slug":"0025_cisco-nat","status":"publish","type":"page","link":"https:\/\/itgen.itbumper.com\/?page_id=787","title":{"rendered":"0025_Cisco: NAT"},"content":{"rendered":"<p style=\"text-align: justify;\" data-tadv-p=\"keep\"><strong>NAT (Network Address Translation)<\/strong> is a mechanism for IP address translation used to:<\/p>\n<ol style=\"text-align: justify;\">\n<li><strong>Hide private addresses<\/strong> when accessing the internet (static or dynamic NAT, PAT).<\/li>\n<li><strong>Conserve public IP addresses<\/strong> using one external address for multiple internal devices (PAT).<\/li>\n<li><strong>Map external and internal services<\/strong> through static address translation.<\/li>\n<\/ol>\n<p style=\"text-align: justify;\" data-tadv-p=\"keep\"><strong>Types of NAT:<\/strong><\/p>\n<ul>\n<li style=\"text-align: justify;\"><strong>Static NAT<\/strong> \u2014 1:1 mapping of internal and external IP addresses.<\/li>\n<li style=\"text-align: justify;\"><strong>Dynamic NAT<\/strong> \u2014 dynamic mapping from internal addresses to a pool of external addresses.<\/li>\n<li style=\"text-align: justify;\"><strong>PAT (Port Address Translation)<\/strong> \u2014 all devices use one external address with different ports.<\/li>\n<\/ul>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#NAT\n\n#IP v4 private address ranges:\n#\t10.0.0.0\/8\t\t10.0.0.0 - 10.255.255.255\t\t#Class A\n#\t172.16.0.0\/12\t172.16.0.0 - 172.13.255.255\t\t#Class B\n#\t192.168.0.0\/16\t192.168.0.0 - 192.168.255.255\t#Class C\n\n#STATIC NAT (One to One)\n#\n#Inside local addresses are mapped to inside global public IP addresses\n#\t192.168.1.1\t&lt;-NAT One-to-One-&gt;100.0.0.1\n\t\t\t|\t\t\t\t\t\t|\n\t\tinterface g0\/1\t\t|\tinterface g0\/0\n\t\t\tip nat inside\t|\t\tip nat outside\n\t\t\texit\t\t\t|\t\texit\t\n\n\t\tip nat inside source static 192.168.1.1\t100.0.0.1\n\t\tip nat inside source static 192.168.1.2\t100.0.0.2\n\t\texit\n\tshow ip nat translations\n\tclear ip nat translations *\n\tshow ip nat statistics\n\n#DYNAMIC NAT\t(ACL uses in it)\n#An ACL is used to identify which traffic should be translated\n#\tIf the source IP address is permited by the ACL, the siurce IP address will be translated\n#\tIf the source IP address is deny by the ACL, the source IP address won`t be translated. Traffic won`t be dropped.\n#A NAT Pool is used to define the avaliable global IP addresses\n#Example ACL 1\n#\tpermit 192.168.0.0\/24\n#\tdeny any\n#POOL1: 100.0.0.1 to 100.0.0.10\n#If the packet with the source IP address permited by ACL 1, thanslate the source IP address to an IP address from POOL1\n#If the POOL1 has no free IP addresses, then the new request will be dropped, until any global IP address released. By timeout.\n\n\t\tinterface &lt;clients interface&gt;\n\t\t\tip nat inside\n\t\t\texit\n\t\tinterface &lt;outside interface&gt;\n\t\t\tip nat outside\n\t\t\texit\n\t\taccess-list 1 permit &lt;local IP network wildcard mask&gt;\n\t\tip nat pool POOL1 &lt;Public IP start Public IP end&gt; \t#can use mask prefix-length ie 24\n\t\tip nat inside source list 1 pool POOL1\n\tshow ip nat translations\n\tshow ip nat statistics\n\t\n#PAT or NAT Overload\n# Situation 1, then we have got some public IP addresses\n# Situation 2, then we have only one public IP address\n# For situation 1\n\t\tinterface g0\/1\n\t\t\tip nat inside\n\t\t\texit\n\t\tinterface g0\/0\n\t\t\tip nat outside\n\t\t\texit\n\t\taccess-list 1 permit 192.168.0.0 0.0.0.255\n\t\tip nat pool POOL1 100.0.0.1 100.0.0.255 \t#or use mask prefix-length 24\n\t\tip nat inside source list 1 pool POOL1 overload\n\t\t\n# For situation 2\n\t\tinterface g0\/1\n\t\t\tip nat inside\n\t\t\texit\n\t\tinterface g0\/0\n\t\t\tip nat outside\n\t\t\texit\n\t\taccess-list 1 permit 192.168.0.0 0.0.0.255\n\t\tip nat pool POOL1 100.0.0.1 100.0.0.255 \t#or use mask prefix-length 24\n\t\tip nat inside source list 1 interface g0\/0 overload\n\n\n#PORT FORWARFING (Just add)\n\t\tinterface g0\/1\n\t\t\tip nat inside\n\t\t\tip nat inside source static tcp 192.168.1.100 80 &lt;WAN IP Address&gt; 80\t\t\n\t\t\tip nat inside source static tcp 192.168.1.100 80 &lt;WAN Interface&gt; 80\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>NAT (Network Address Translation) is a mechanism for IP address translation used to: Hide private addresses when accessing the internet (static or dynamic NAT, PAT). Conserve public IP addresses using one external address for multiple internal devices (PAT). Map external and internal services through static address translation. Types of NAT: Static NAT \u2014 1:1 mapping &hellip; <a href=\"https:\/\/itgen.itbumper.com\/?page_id=787\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;0025_Cisco: NAT&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/787"}],"collection":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=787"}],"version-history":[{"count":2,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/787\/revisions"}],"predecessor-version":[{"id":792,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/787\/revisions\/792"}],"wp:attachment":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}