Policy NAT and Twice NAT – NAT Series – Practical Networking .net (2024)

This article is a part of aserieson Network Address Translation (NAT). Use the navigation boxes to view the rest of the articles.

Network Address Translation

  • Why NAT?
  • NAT Terminology
  • Static NAT
  • Static PAT
  • Dynamic PAT
  • Dynamic NAT
  • Policy NAT and Twice NAT
  • NAT Terminology Disambiguation

Every type of NAT we have discussed so far have two things in common. The first is that only the source of the packet is used to make a NAT decision. The second is that only the source of the outbound packet is translated. Policy NAT and Twice NAT are two ways of performing any type of NAT that expand beyond these two facts.

Summary of the types of NAT

First, let’s quickly recap what we learned in the previous articles:

NAT vs PAT – these terms define whether just the IP address portion of the packet, or the IP address and Port number are being translated

Static vs Dynamic – these terms define whether the post-translation attributes are explicitly defined by the administrator, or ephemerally determined by the router.

When combined, this provides four possible variations of Network Address Translation:

  • Static NAT – Translation of just the IP address where the administrator explicitly defines the IP address after translation
  • Static PAT – Translation of the IP address and Port, where the administrator explicitly defines the IP address and Port after translation
  • Dynamic PAT – Translation of the IP address and Port, where the router determines the new IP address and Port after translation
  • Dynamic NAT – Translation of just the IP address, where the router determines the new IP address after translation

Decision Criteria

To configure each type of NAT above, we must define for the router exactly what traffic should be translated, and what it should be translated to.

If we review the configuration applied in the Static NAT or Dynamic PAT articles, we essentially instructed the Router to perform the following translations:

  • If the source IP addressis 10.2.2.33, translate the source IP statically to 73.8.2.33
  • If the source IP addressis 10.6.6.0/24 translate the source IP to 32.8.2.66 and dynamically pick a unique Source port

Notice in both cases we are making a decision to perform address translation based solely upon matching the source IP address of the packet – the destination address was not considered.

This is fine if you want all traffic from the Inside servers translated the same way for everydestination they may speak to. However, there are times when you want to translate traffic to a certain destination one way, then translate traffic to a different destination a completely different way.

In such cases, when you need to conditionally translate traffic based upon the destination of the packet, you will need to use what is known as a Policy NAT.

Policy NAT

The following example is the same illustration as we used in the Dynamic PAT article, except we’ve added one additional, conditional translation to the configuration:

Policy NAT and Twice NAT – NAT Series – Practical Networking .net (1)

There are two parts to the Router’s configuration. The first part of the configuration produces this behavior:

  • If the source IP addressis 10.6.6.0/24 and the destination IP address is 45.5.4.9, translate the source IP using Dynamic PAT to the address 32.8.2.77

The additional configuration tells the router to translate a packet based upon the criteria of matching both the Source and Destination of the packet. In the industry, this is referred to as a Policy NAT.

A Policy NAT is simply any of the four NAT types we discussed prior in this article series, except the NAT decision requires matching both the Source and Destination of a packet.

By contrast, every example of address translation thus far made a NAT decision based upon only the source of the packet.

The specific illustration immediately above was an example of a Policy Dynamic PAT – A translation decision based upon matching the source and destination of the packet (Policy), with the router determining the attributes after translation (Dynamic), which translated the source IP address and port (PAT).

The second part of the configuration produces this behavior:

  • If the source IP address is 10.6.6.0/24, and the destination IP address is <anything>, translate the source IP using Dynamic PAT to the address 32.8.2.66

The second configuration item in the illustration above is simply a regular, Dynamic PAT.

Every traditional Dynamic PAT implies matching for any destination. Whereas the Policy Dynamic PAT in the first example would only match for specific destinations.

Twice NAT

In each example of the traditional four types of NAT we’ve discussed in this article series, only one “side” of the packet was being modified: the Source of the outbound packet or the Destination of the inbound packet.

Moreover, in the prior section we discussed Policy NAT: making a NAT decision based upon matching both the source and destination of traffic. However, even in a Policy NAT, once the decision was made, only one side of the packet was being modified.

If you refer back to the Policy Dynamic PAT example, when Host A (10.6.6.61) was speaking to the Server, we translated 10.6.6.61 using a Dynamic PAT into 32.8.2.77. Notice the Server’s IP address (45.5.4.9) was never translated, only the client’s – only one side of the packet was changed (the source of the outbound packet).

There are occasions where you need to translate both sides of the packet – this type of translation is referred to as a Twice NAT. The term comes from the fact that you are performing NAT twice: once on the source of the packet and another time on the destination of the packet.

There are many use cases for Twice NAT, we will provide one examples below. Another example will be illustrated in a separate article.

Changing the Destination with Twice NAT

At the core of it, a Twice NAT is a type of NAT where both the Source and Destination of the packet will be translated. Take this scenario as an example.

You are in charge of a Router with hosts on a private network (10.6.6.0/24) that have chosen to use Google’s Public DNS Resolving Server (8.8.8.8). However, company policy states DNS requests must be made using the Corporate DNS server (32.9.1.8). One option is to manually verify every user’s DNS configuration, but that does not scale. Instead, another option would be to translate any outbound requests to 8.8.8.8 into a request for 32.9.1.8.

Policy NAT and Twice NAT – NAT Series – Practical Networking .net (2)

Notice the configuration is making a decision based upon matching a Source of 10.6.6.0/24 and a Destination of 8.8.8.8 – this makes the configuration a Policy NAT. Furthermore, the configuration is translating the source using a Dynamic PAT, and the destination using a Static NAT – this makes the configuration a Twice NAT, since we are doing two instances of address translation.

The packet sent by the host is sourced from a private IP address and destined to Google’s DNS servers. But after crossing the router, the packet is now sourced from a public IP address and destined to the Corporate DNS servers.

The internal host is still configured to use Google’s DNS servers, but their traffic is automatically being redirected to the corporate DNS servers. The internal host will not know that anything is different, and unless they go out of their way to validate the DNS responses, they will have no idea that the response is coming from the corporate DNS server and not Google’s DNS server.

Summary of New Terms

In this article, we unpacked and compared the ideas of a Policy NAT and a Twice NAT. As a quick summary:

  • A Policy NAT is any translation that occurs based upon matching both the Source and Destination of traffic.
  • A Twice NAT is any translation that involves translating both the Source and Destination of traffic.

These two terms can be combined, giving us a Policy Twice NAT. Which is a type of NAT which makes a decision based upon the Source and Destination of a packet (Policy NAT), and translates both the Source and Destination of a packet (Twice NAT).

Series Navigation

Dynamic NAT >>NAT Terminology Disambiguation >>

Related Posts:
VPN with Overlapping Networks
Cisco NAT Terminology
NAT Terminology
Policy NAT and Twice NAT – NAT Series – Practical Networking .net (2024)

FAQs

What is the difference between twice NAT and policy NAT? ›

As a quick summary: A Policy NAT is any translation that occurs based upon matching both the Source and Destination of traffic. A Twice NAT is any translation that involves translating both the Source and Destination of traffic.

What is NAT and double NAT? ›

A double NAT happens if another router, for example a Nest Wifi router, is connected to the ISP modem or gateway. All this means is that data is going through a NAT process twice, which might cause a very small delay, of the order of milliseconds to data getting in and out of your home.

What is the difference between object NAT and twice NAT? ›

Twice-nat is natting the source and destination and so there are two nats taking place. Below is good visual on the below link. Whereas object network nat is just nat once on either direction of the traffic flow. Example your home computers on the private subnet access the Internet with natted to a public-address.

What is twice NAT? ›

Twice NAT refers to translation of both the source and destination IP addresses of a data packet. It is applied to the situation where a private IP address is the same as a public IP address. Figure 5-8 Networking diagram for twice NAT. The process of twice NAT is described as follows: Host A with the IP address 1.1.

What is the disadvantage of double NAT? ›

Because NAT is performed by each router or gateway, your network is split into two different private networks. The devices connected to one private network might have communication problems with the devices connected to the other private network, and you might experience problems with: Online games. VPN connections.

What are the two types of NAT? ›

Types of Network Address Translation
  • Static NAT: Static NAT maps an internal IP address to an external one on a one-to-one basis. ...
  • Dynamic NAT: With Dynamic NAT, a firewall has a pool of external IP addresses that it assigns to internal computers as needed.

How do you know if you're double NAT? ›

To detect Double NAT on a network, log into a router and look up the IP address of its WAN port. If you see an address in it means that the device the router's WAN port connects to is doing NAT, and hence, you're dealing with double NAT.

Does double NAT affect performance? ›

Bridge mode is only needed when encountering specific cases of double NAT. For most people, double NAT does not affect Wi-Fi performance.

What is Type 2 NAT mean? ›

NAT Type 2: Moderate

With your connection passing through the router, acting as an initial defense, Moderate NAT allows connections to third-party servers through a few open ports. This setup provides a certain level of protection against external traffic.

What is the benefit of double NAT? ›

Also, a double NAT setup makes the top-level NAT network—hosted by your new router—isolated (and more secure) because devices in this network are behind two layers of firewalls and NATs. They are also invisible to those connecting to the lower-level NAT.

What is the loopback rule of NAT? ›

You can create loopback rules from destination NAT rules to allow internal hosts to communicate with other internal hosts over the external IP address or the domain name. For example, create a destination NAT rule to translate incoming traffic to your servers and create a loopback rule.

What is NAT and difference between static and dynamic NAT? ›

The main difference between dynamic NAT and static NAT is that static NAT allows a remote host to initiate a connection to a translated host if an access list exists that allows it, while dynamic NAT does not. The figure shows a typical static NAT scenario.

What is NAT 1 and NAT 2? ›

N-Acetyltransferase 1 (NAT1) and 2 (NAT2) are important enzymes in the biotransformation of these carcinogens and exhibit genetic polymorphism.

What is TWICE known for? ›

Twice debuted in 2015 under JYP Entertainment with the hit song "Like Ohh-Ahh". They are best known for their cuter and more girly concepts, and eye-catching choreographies.

What is two-way NAT? ›

Double NAT occurs when two or more routers on a network are performing Network Address Translation (NAT). Double NAT (sometimes known as double routing) generally does not affect computer use or web browsing but can cause issues with VoIP service.

Is double NAT a big deal? ›

Double NAT, then, is when you have two routers and the IP address conversion occurs twice. It's not always a bad thing, but it can cause connectivity issues when trying to communicate with devices outside of the network.

What is the difference between firewall policy NAT and central NAT? ›

Policy NAT mode requires NATs to be configured inside firewall policies, which is the default mode that FortiGate uses. Central NAT mode separates NATs and policies into 2 independent modules so policies do not reference NAT objects.

What is the purpose of the NAT policy? ›

NAT conserves IP addresses that are legally registered and prevents their depletion. Network address translation security. NAT offers the ability to access the internet with more security and privacy by hiding the device IP address from the public network, even when sending and receiving traffic.

Top Articles
11 Ways To Save The Most Money During A Recession
Altcoins Erklärt: Definition, Bedeutung und Bitcoin Alternative
Foxy Roxxie Coomer
Duralast Gold Cv Axle
Truist Bank Near Here
Is pickleball Betts' next conquest? 'That's my jam'
Chase Bank Operating Hours
Bucks County Job Requisitions
Los Angeles Craigs List
Gwdonate Org
Tracking Your Shipments with Maher Terminal
Shreveport Active 911
Kris Carolla Obituary
2016 Ford Fusion Belt Diagram
Gon Deer Forum
Bitlife Tyrone's
Overton Funeral Home Waterloo Iowa
Driving Directions To Bed Bath & Beyond
Clear Fork Progress Book
라이키 유출
Tygodnik Polityka - Polityka.pl
A Biomass Pyramid Of An Ecosystem Is Shown.Tertiary ConsumersSecondary ConsumersPrimary ConsumersProducersWhich
Georgia Cash 3 Midday-Lottery Results & Winning Numbers
Cpt 90677 Reimbursem*nt 2023
Craigslist Ludington Michigan
Pixel Combat Unblocked
Tottenham Blog Aggregator
Pfcu Chestnut Street
Metro By T Mobile Sign In
Graphic Look Inside Jeffrey Dresser
2016 Honda Accord Belt Diagram
Does Iherb Accept Ebt
Synchrony Manage Account
Myql Loan Login
Mcgiftcardmall.con
2008 DODGE RAM diesel for sale - Gladstone, OR - craigslist
Paperless Employee/Kiewit Pay Statements
Anhedönia Last Name Origin
Amc.santa Anita
Strange World Showtimes Near Century Stadium 25 And Xd
Port Huron Newspaper
Tacos Diego Hugoton Ks
Phmc.myloancare.com
Dying Light Mother's Day Roof
Das schönste Comeback des Jahres: Warum die Vengaboys nie wieder gehen dürfen
Mlb Hitting Streak Record Holder Crossword Clue
Random Warzone 2 Loadout Generator
Quest Diagnostics Mt Morris Appointment
Julies Freebies Instant Win
Fallout 76 Fox Locations
Goosetown Communications Guilford Ct
Latest Posts
Article information

Author: Amb. Frankie Simonis

Last Updated:

Views: 5496

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Amb. Frankie Simonis

Birthday: 1998-02-19

Address: 64841 Delmar Isle, North Wiley, OR 74073

Phone: +17844167847676

Job: Forward IT Agent

Hobby: LARPing, Kitesurfing, Sewing, Digital arts, Sand art, Gardening, Dance

Introduction: My name is Amb. Frankie Simonis, I am a hilarious, enchanting, energetic, cooperative, innocent, cute, joyous person who loves writing and wants to share my knowledge and understanding with you.