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.

Pearson IT Certification Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Pearson IT Certification and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Pearson IT Certification products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.pearsonitcertification.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020