Flux rss
Bookmark Bookmark & Share
NAT - Traslazione di indirizzi, port forwarding e port triggerin NAT - Network Address Translation, porto e encaminhamento porto NAT - Adressenumsetzung, port forwarding und port triggering NAT - Translation d'adresses, port forwarding et port triggering NAT- Conversión de direcciones de red, habilitación de puertos y

The principle of NAT

Network address translation or NAT was developed in order to respond to the shortage of IP addresses with IPv4 protocol (in time the IPv6 protocol will respond to this problem).

In fact, in IPv4 addressing the number of routable IP addresses (which are unique in the world) is not enough to enable all machines requiring it to be connected to the internet.

The principle of NAT therefore consists of using a gateway connection to the Internet, having at least one network interface connected to the internal network and at least one network interface connected to the Internet (possessing a routable IP address), in order to connect all the machines to the network.

NAT gateway

It is a question of creating, at gateway level, a translation of packets coming from the internal network to the external network.

So, each machine on the network needing to access the Internet is configured to use the NAT gateway (by specifying the IP address of the gateway in the "Gateway" field with its TCP/IP parameters). When a network machine makes a request to the Internet, the gateway makes the request in its place, receives the response, then sends it to the machine which made the request.

Principle of network address translation

Since the gateway completely conceals the internal addresses on the network, the network address translation mechanism provides a secure function. In fact, to an external observer of the network, all requests seem to come from the gateway IP address.

Address space

The organisation managing public address space (routable IP addresses) is the Internet Assigned Number Authority (IANA). RFC 1918 defines a private address space enabling any organisation to allocate IP addresses to machines on its internal network without risk of entering into conflict with a public IP address allocated by IANA. These addresses known as non-routable relate to the following address ranges:

  • Class A: range from 10.0.0.0 to 10.255.255.255;
  • Class B: range from 172.16.0.0 to 172.31.255.255;
  • Class C: range from 192.168.0.0 to 192.168.255.55;
All the machines on an internal network, connected to the internet via a router and not having a public IP address must use an address within one of these ranges. For small domestic networks, the address range from 192.168.0.1 to 192.168.0.255 is generally used.

Static translation

The principle of static NAT consists of linking a public IP address to a private internal IP address on the network. The router (or more precisely the gateway) thus allows a private IP address (for example 192.168.0.1) to be linked to a public routable IP address on the Internet and conducts the translation, in either direction, by changing the address in the IP packet.

Static network address translation therefore enables internal network machines to be connected to the Internet in a transparent way but does not resolve the problem of the lack of addresses insofar as n routable IP addresses are necessary to connect n machines to the internal network.

Dynamic translation

Dynamic NAT enables a routable IP address (or a reduced number of routable IP addresses) to be shared between several machines with private addresses. So seen from outside, all the machines on the internal network virtually possess the same IP address. This is the reason why the term "IP masquerading" is sometimes used to indicate dynamic network address translation.

In order to be able to "multiplex" (share) the different IP addresses on one or several routable IP addresses, dynamic NAT uses Port Address Translation (PAT), i.e. the allocation of a different source port for each request in such a way as to be able to maintain a correspondence between the requests coming from the internal network and the responses of the machines on the Internet, all addressed to the router's IP address.

Port Forwarding

Network address translation only allows requests coming from the internal network to the external network, which means that it is impossible as such for an external machine to send a packet to a machine on the internal network. In other words, the internal network machines cannot operate as a server with regards the external network.

For this reason, there is a NAT extension called "port forwarding" or port mapping consisting of configuring the gateway to send all packets received on a particular port to a specific machine on the internal network. So, if the external network needs to access a web server (port 80) operating on machine 192.168.1.2, it will be necessary to define a port forwarding rule on the gateway, redirecting all TCP packets received on port 80 to machine 192.168.1.2.

Port Triggering

The majority of client-server applications make a request over a remote host on a given port and open a port in return to recover the data. Nevertheless, certain applications use more than one port to exchange data with the server, this is the case for example with FTP, for which a connection is established by port 21, but data is transferred via port 20. So with NAT, after a connection request on port 21 by a remote FTP server, the gateway awaits a connection on a single port and will refuse the connection request on port 20 of the client.

There is a mechanism derived from NAT, called "port triggering", making it possible to authorise the connection to certain ports (port forwarding) if a condition (request) is fulfilled. It is therefore a question of conditional port forwarding, enabling a port to be opened only when an application requires it so it is not permanently left open.

More information

For more information, you are advised to consult this other article, dedicated to network address translation:

RFCs 1918 and 3022 describe the principle of internal address space and network address translation in detail:

Article written by Jean-François PILLOU

Last update on Thursday October 16, 2008 02:43:22 PM.This document entitled « NAT- Network address translation, port forwarding and port trigg » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.

NAT - Address Translation The Concept of NAT The process of network address translation (NAT) was developed in order to respond to the lack of IP addresses with the IPv4 protocol (the IPv6 protocol will propose a solution to this problem). In IPv4 addressing, there are not... en.kioskea.net/contents/protect/nat.php3
Network equipment - Bridge/routers Introduction to bridge/routers A bridge/router is a hybrid element that joins the features of a router and those of a bridge. Therefore, this kind of hardware is used for transferring non-routable protocols from one network to another, and to route... en.kioskea.net/contents/lan/brouteurs.php3
IP Address What is an IP address? Computers communicate over the Internet using the IP protocol (Internet Protocol), which uses numerical addresses, called IP addresses, made up of four whole numbers (4 bytes) between 0 and 255 and written in the format... en.kioskea.net/contents/internet/ip.php3
What is your IP address?What is your IP address? What is an IP address? How to know your IP address? For Windows 2000/ Windows XP/ Windows Vista users For Windows 95/ Windows 98 users By using online tools What is an IP address? When a PC is connected to... en.kioskea.net/faq/sujet-225-what-is-your-ip-address
Conversion of an IP address 32-bitConversion of an IP address 32-bit We will make a ping kioskea.net in view retrieve the IP address (in bold) $ Ping-c1 kioskea.net PING kioskea.net (194,169,240,130) 56 (84) data bytes. 64 bytes from www.kisokea.org... en.kioskea.net/faq/sujet-1617-conversion-of-an-ip-address-32-bit
Having a static IP address under Ubuntu 8.10Having a static IP address under Ubuntu 8.10 To have a fixed IP persistent: Configure manually the interfaces For a fix IP (10.0.0.1 on your eth1 interface) use: To make use of dynamic IP (e.g eth0): DNS NetworkManager is a... en.kioskea.net/faq/sujet-979-having-a-static-ip-address-under-ubuntu-8-10
To disable auto login network share foldersHello, Every time when i access the folder from network computer using ip address \\192.168.1.2 it open easily. But i want to use user name and password when i access to network share folders. Other computer on the network are work normally. My... en.kioskea.net/forum/affich-35879-to-disable-auto-login-network-share-folders
I can not find the network printerHello, I have problem according to the network printer. A network Printer allready installed on other PC in my office but when I trying to find it then i am recieving some erors for example( Windows con not find '//iec-1143'. Make sure you typed... en.kioskea.net/forum/affich-109377-i-can-not-find-the-network-printer
ADDING A LAPTOP TO MY NETWORKHello, I have a desktop, with a comcast modem & a netgear router. my laptop is set up with my network but my husband has a compaq laptop,(without a wi-fi card installed directly in his laptop), is there any one who can help me network his laptop... en.kioskea.net/forum/affich-58438-adding-a-laptop-to-my-network
Download Find MAC Address by LizardSystemsFind MAC address is a tool allowing you to know the MAC addresses of the computers on your network. A MAC address is a single number identifying a network peripheral. Unlike other similar software which only uses one or two methods, it can use ARP,... en.kioskea.net/telecharger/telecharger-3475-find-mac-address-by-lizardsystems
Download Softperfect Network ScannerSoftPerfect Network Scanner allows to display the shared resources in a network as well as its characteristics: the used SNMP, user IP address, host's name, etc.... In addition, the software defines the types of resources which must be scanned. This... en.kioskea.net/telecharger/telecharger-2348-softperfect-network-scanner
Download Pidgin PortablePortable Pidgin is a numerous protocol of customer of instantaneous freight forwarding. He works in AOL, ICQ, MSN and Yahoo. You can be connected to several networks with the same program.All your personal information is contained in program so no... en.kioskea.net/telecharger/telecharger-288-pidgin-portable
IP address spoofingIP address spoofing "IP address spoofing" is a technique that involves replacing the IP address of an IP packet's sender with another machine's IP address. This technique lets a pirate send packets anonymously. It is not a question of changing the... en.kioskea.net/contents/attaques/usurpation-ip-spoofing.php3
Windows networkingNetworking in Windows 2000/XP To configure each computer, simply go to the control panel, then double-click "network connections" and right-click "local area connection", then choose properties! The local area connection window displays the... en.kioskea.net/contents/configuration-reseau/configurer-reseau-windows-xp.php3
Creating an ad hoc WiFi networkPresentation of the ad hoc WiFi network If you have two or more computers equipped with wireless adapters (WiFi cards), it is possible to easily connect them in a network by setting up a so-called "ad hoc" network, that is, a computer-to-computer... en.kioskea.net/contents/configuration-reseau/configurer-routeur-wifi.php3