Home > Articles > Cisco > CCNA Routing and Switching

Fundamentals of NAT

Network Address Translation is critical in today’s networks due to the depletion of IPv4 IP addresses for use on the public Internet. While NAT breaks the fundamental tenant of the Internet end to end, it does provide a measure of security. In this article, we are going to examine NAT in its various forms.
Like this article? We recommend

There's a very good chance that you are using Network Address Translation (NAT) right now and most people are not even aware of it. When the IPv4 address space was originally developed everyone thought that there would be more than enough available addresses to cover all eventual needs, but with the veritable explosion of internet users and the ever increasing number of home networks, the number of available IP Addresses turned out to be insufficient to the task at hand. So what does NAT have to do with the ever expanding size of the internet? The answer is: EVERYTHING!

So what does NAT have to do with network security? NAT breaks the end-to-end IP/TCP model. More specifically, dynamic NAT automatically creates a FIREWALL between our internal network and any outside networks, to include the largest external network in the world[md]the internet. Basically, this means that a host on an external network cannot connect to an internal host unless that host has initiated an outbound session. This means that an internal user can browse the internet, and download files; but an external host cannot initiate a session to an internal IP Address and use it to connect to internal devices or services. In this blog we are going to explore the security aspects of this technology.

NAT as a Firewall

NAT translates the addresses of hosts behind a firewall or router and is normally used for internal networks that have unregistered (non-routable) IP addresses. NAT will translate these unregistered addresses into routable addresses assigned to outside networks. Outside networks are most usually referred to as public networks, and NAT allows non-routable or unregistered IP address spaces to connect to the web while providing added security. With Cisco IOS, NAT translation is used by a device that sits between the private, or inside, network and the outside, or public, network. NAT has many forms and works in many ways:

  • Static NAT is where we map an unregistered IP Address to a registered IP Address on a one-to-one basis. This is most commonly employed when there is a device that needs to be accessible from outside the network.
  • Dynamic NAT is where an unregistered IP Address is mapped to a registered IP Address from a group of available registered IP Addresses.
  • PAT (NAT Overload) is a variation of dynamic NAT that maps multiple unregistered IP Addresses to a single registered IP Address by using different ports. Other names for this variation include port-level multiplexed NAT or Single Address NAT.

NAT Terminology

Before we even attempt to look at how to configure NAT on a router or a Firewall, we need to become familiar with the terminology used in the NAT environment.

  • Inside Local Address is an IP Address that is assigned to a host on the inside network. This address is not advertised to the Public/Outside network. This is most frequently not a routable or legitimate IP Address.
  • Inside Global Address is a routable IP Address assigned by the International Number Authority or its regional delegates.
  • Outside Local Address is an IP Address used by an outside host of the network. It is this address that is being translated as it appears to the private network.
  • Outside Global Address is the IP Address assigned to a host on the outside or public network that is being translated by that host's network.

Configuring Static NAT

Here we will look at what is involved in configuring Static NAT on a Cisco router. Static NAT is pretty straight forward. Remember this is most commonly used for translating addresses on a one-to-one basis. This is accomplished via a three-step process:

  1. Step 1: Designate at least one NAT inside interface.
  2. R1(config)# interface fastethernet0/1
    R1(config-if)# ip address 192.168.100.1 255.255.255.0
    R1(config-if)# ip nat inside
  3. Step 2: Designate at least one NAT outside interface.
  4. R1(config)# int serial0/0
    R1(config-if)# ip address 10.10.10.100 255.255.255.0
    R1(config-if)# ip nat outside
  5. Step 3: NAT the source IP to the outside IP Address.
  6. R1(config)# ip nat inside source static 192.168.100.1 172.1.1.1
    R1(config)# ip nat inside source static 192.168.100.2 172.1.1.2
    R1(config)# ip nat inside source static 192.168.100.3 172.1.1.3

This configuration will result in the IP Addresses 192.168.100.1 to 192.168.100.3 being translated to 172.1.1.1, 172.1.1.2 and 172.1.1.3 respectively.

Configuring Dynamic NAT

Dynamic NAT configuration is only slightly more complicated than the Static NAT configuration we just looked at. In its simplest form, dynamic NAT is a four-step configuration process:

  1. Step 1: Designate at least one NAT inside interface.
  2. R1(config)# interface fastethernet0/0
    R1(config-if)# ip nat inside
  3. Step 2: Designate at least on NAT outside interface.
  4. R1(config-if)# interface serial0/0
    R1(config-if)# ip nat outside 
  5. Step 3: Create a pool of Public IP Addresses.
  6. R1(config)# ip nat pool PUBLIC 222.2.2.2 222.2.2.5 prefix-length 29

    This defines the range of IP Addresses that will be handed out by the router to our internal hosts trying to connect to the Internet. Each time a host sends a packet destined for the Internet, the router will automatically allocate one of the Public IP addresses for the duration of the browser session. When the session is over, the NAT entry will timeout and the Public IP address will be returned to the pool.

  7. Step 4: Create an Access Control List (ACL) that will include the local hosts or network(s).
  8. R1(config)# ip nat inside source list 100 pool PUBLIC 
    R1(config)# access-list 100 remark == [Control NAT Pool Service]== 
    R1(config)# access-list 100 permit ip 192.168.0.0 0.0.0.255 any

    This ACL will be applied to the NAT pool named 'PUBLIC', and control what hosts will be assigned Public IP address and therefore able to access the Internet.

Configuring NAT Overload (PAT)

NAT Overload is the most common NAT deployment used in Small Office/Home Office networks. NAT Overload is a variation of Static or Dynamic NAT with a few enhancements. By this point we have an understanding of how both Static and Dynamic NAT work so we can jump right in.

Overloading implies that a single public IP Address can be used by multiple internal hosts simultaneously. This is done by translating source UDP/TCP ports in the packets and keeping track of them within a NAT translation table. We will look at a typical NAT configuration found in most small networks. In its simplest form we are looking at a four-step process:

  1. Step 1: Designate at least one NAT inside interface.
  2. R1(config)# interface fastethernet0/0
    R1(config-if)# ip nat inside
  3. Step 2: Designate at least one NAT outside interface.
  4. R1(config-if)# interface Serial0/0
    R1(config-if)# ip nat outside 
  5. Step 3: Create an Access Control List (ACL) that will include the local hosts or network(s).
  6. R1(config)# ip nat inside source list 100 pool PUBLIC 
    R1(config)# access-list 100 remark == [Control NAT Pool Service]== 
    R1(config)# access-list 100 permit ip 192.168.1.0 0.0.0.255 any

    This defines the range of IP Addresses that will be handed out by the router to our internal hosts trying to connect to the Internet.

  7. Step 4: Enable NAT overload and bind it to the outside interface.
  8. R1(config)# ip nat inside source list 100 interface serial 0/0 overload

    From this point the configuration will create PAT translations to allow the users in the network 192.168.1.0/24 to access the public internet.

Displaying the NAT/PAT translation table

The network translation table can best be viewed by using the 'show ip nat translation' command:

R1#show ip nat translation
Pro    Inside global           Inside local             Outside local             Outside global
tcp    171.71.1.1:3598     10.10.10.2:3598    198.133.219.25:80   198.133.219.25:80
tcp    171.71.1.1:3612     10.10.10.3:3612    198.133.219.25:80   198.133.219.25:80
tcp    171.71.1.1:3616     10.10.10.4:3616    198.133.219.25:80   198.133.219.25:80
tcp    171.71.1.1:3620     10.10.10.5:3620    198.133.219.25:80   198.133.219.25:80
R1#

We can see that this table indicates that multiple packets have passed through R1 all destined to port 80.

Conclusion

We have looked closely at the anatomy and terminology of Network Address Translation protocol. We have configured Static and Dynamic NAT on Cisco routers. In addition to this, we have learned how to control the Dynamic NAT service using ACLs as well as how to obtain detailed statistics on the NAT process itself.

vceplus-200-125    | boson-200-125    | training-cissp    | actualtests-cissp    | techexams-cissp    | gratisexams-300-075    | pearsonitcertification-210-260    | examsboost-210-260    | examsforall-210-260    | dumps4free-210-260    | reddit-210-260    | cisexams-352-001    | itexamfox-352-001    | passguaranteed-352-001    | passeasily-352-001    | freeccnastudyguide-200-120    | gocertify-200-120    | passcerty-200-120    | certifyguide-70-980    | dumpscollection-70-980    | examcollection-70-534    | cbtnuggets-210-065    | examfiles-400-051    | passitdump-400-051    | pearsonitcertification-70-462    | anderseide-70-347    | thomas-70-533    | research-1V0-605    | topix-102-400    | certdepot-EX200    | pearsonit-640-916    | itproguru-70-533    | reddit-100-105    | channel9-70-346    | anderseide-70-346    | theiia-IIA-CIA-PART3    | certificationHP-hp0-s41    | pearsonitcertification-640-916    | anderMicrosoft-70-534    | cathMicrosoft-70-462    | examcollection-cca-500    | techexams-gcih    | mslearn-70-346    | measureup-70-486    | pass4sure-hp0-s41    | iiba-640-916    | itsecurity-sscp    | cbtnuggets-300-320    | blogged-70-486    | pass4sure-IIA-CIA-PART1    | cbtnuggets-100-101    | developerhandbook-70-486    | lpicisco-101    | mylearn-1V0-605    | tomsitpro-cism    | gnosis-101    | channel9Mic-70-534    | ipass-IIA-CIA-PART1    | forcerts-70-417    | tests-sy0-401    | ipasstheciaexam-IIA-CIA-PART3    | mostcisco-300-135    | buildazure-70-533    | cloudera-cca-500    | pdf4cert-2v0-621    | f5cisco-101    | gocertify-1z0-062    | quora-640-916    | micrcosoft-70-480    | brain2pass-70-417    | examcompass-sy0-401    | global-EX200    | iassc-ICGB    | vceplus-300-115    | quizlet-810-403    | cbtnuggets-70-697    | educationOracle-1Z0-434    | channel9-70-534    | officialcerts-400-051    | examsboost-IIA-CIA-PART1    | networktut-300-135    | teststarter-300-206    | pluralsight-70-486    | coding-70-486    | freeccna-100-101    | digitaltut-300-101    | iiba-CBAP    | virtuallymikebrown-640-916    | isaca-cism    | whizlabs-pmp    | techexams-70-980    | ciscopress-300-115    | techtarget-cism    | pearsonitcertification-300-070    | testking-2v0-621    | isacaNew-cism    | simplilearn-pmi-rmp    | simplilearn-pmp    | educationOracle-1z0-809    | education-1z0-809    | teachertube-1Z0-434    | villanovau-CBAP    | quora-300-206    | certifyguide-300-208    | cbtnuggets-100-105    | flydumps-70-417    | gratisexams-1V0-605    | ituonline-1z0-062    | techexams-cas-002    | simplilearn-70-534    | pluralsight-70-697    | theiia-IIA-CIA-PART1    | itexamtips-400-051    | pearsonitcertification-EX200    | pluralsight-70-480    | learn-hp0-s42    | giac-gpen    | mindhub-102-400    | coursesmsu-CBAP    | examsforall-2v0-621    | developerhandbook-70-487    | root-EX200    | coderanch-1z0-809    | getfreedumps-1z0-062    | comptia-cas-002    | quora-1z0-809    | boson-300-135    | killtest-2v0-621    | learncia-IIA-CIA-PART3    | computer-gcih    | universitycloudera-cca-500    | itexamrun-70-410    | certificationHPv2-hp0-s41    | certskills-100-105    | skipitnow-70-417    | gocertify-sy0-401    | prep4sure-70-417    | simplilearn-cisa    |
http://www.pmsas.pr.gov.br/wp-content/    | http://www.pmsas.pr.gov.br/wp-content/    |