Cisco Systems



Network Address Translation


Address Translation

Advantages
  • Conserves legally registered addresses.
  • Remedies address overlap events
  • Increases flexibility when connecting to the Internet.
  • Eliminates address renumbering as a network evolves.


Disadvantages
  • Translation results in switching path delays.
  • Causes loss of end-to-end IP traceability
  • Certain applications will not function with NAT enabled
  • Complicates tunneling protocols such as IPsec because NAT modifies the values in the header
Ce processus existe sous trois variantes :
  • Static NAT
  • Dynamic NAT
  • Port Address Translation (PAT) or Overloading

Terms

Inside local
Source host inside address before translation—typically an RFC 1918 address.

Outside local
Address of an outside host as it appears to the inside network. This is usually the address of the router interface connected to ISP—the actual Internet address.

Inside global
Source host address used after translation to get onto the Internet. This is also the actual Internet address.

Outside global
Address of outside destination host and, again, the real Internet address.

Static NAT

Le NAT statique translate une adresse IP privée avec toujours la même adresse IP public.
S’il y a 4 utilisateurs nécessitant une translation d’adresse, il faudra donc utiliser 4 adresses IP publiques.

Exemple de Configuration
ISP2(config)#ip nat inside source static 172.16.1.2 11.0.0.2
ISP2(config)#int f0/0
ISP2(config-if)#ip nat inside
ISP2(config-if)#int s0/0/0
ISP2(config-if)#ip nat outside

Le NAT Statique permet d'acceder a une machine depuis l'exterieur en faisant usage de l'adresse publique qui a ete utilisee pour le NAT


Dynamic NAT

Le NAT dynamique translate une adresse privée avec une adresse IP publique appartenant à un pool d’adresses.
L’adresse IP publique utilisée pour la translation n’est donc pas toujours la même.
S’il n’y a pas assez d’adresses IP publiques disponibles les utilisateurs devront attendre qu’une adresse se libère pour pouvoir être translaté.

Exemple de Configuration

Example 1
LAB(config)#ip nat pool ABC 11.0.0.7 11.0.0.9 netmask 255.255.255.0
LAB(config)#access-list 1 permit any
LAB(config)#ip nat inside source list 1 pool ABC

ISP2(config)#int f0/0
ISP2(config-if)#ip nat inside
ISP2(config-if)#int s0/0/0
ISP2(config-if)#ip nat outside


Example 2 (Using Overload for multiple access with one address)
LAB(config)#ip nat pool ABC 11.0.0.7 11.0.0.9 netmask 255.255.255.0
LAB(config)#access-list 1 permit any
LAB(config)#ip nat inside source list 1 pool ABC overload

ISP2(config)#int f0/0
ISP2(config-if)#ip nat inside
ISP2(config-if)#int s0/0/0
ISP2(config-if)#ip nat outside

Example 2 (Using Overload for multiple access with one address)
LAB(config)#ip nat pool mypool 198.18.184.105 198.18.184.110 netmask 255.255.255.248
LAB(config)#access-list 1 permit 192.168.100.16 0.0.0.15
LAB(config)#ip nat inside source list 1 pool mypool overload


Port Address Translation (PAT)

Le PAT (Port Address Translation) ou Overloading permet d’attribuer une seule adresse IP publique pour la translation de plusieurs adresses IP privées.

Chaque utilisateur est différencié grâce à un numéro de port unique qui lui est attribué lorsqu’il souhaite communiquer.

Etant donné qu’il existe 65536 ports différents, un routeur pourrait translater jusqu’à 65536 adresses IP privées différentes.

Cependant en réalité, un équipement ne peut gérer en moyenne que la translation d’environ 4000 ports par adresse IP publique.

Avantages

  • Grande économie d’adresses IP
  • Ne pas avoir à refaire tout l’adressage IP lorsque l’on change de fournisseur d’accès internet.
  • Apporte également de la sécurité au sein du réseau interne puisque les machines qui s’y trouvent ne sont pas accessibles depuis l’extérieur.

Exemple de Configuration

ISP2(config)#access-list 10 permit any
ISP2(config)#ip nat inside source list 10 int s0/0/0 overload

ISP2(config)#int f0/0
ISP2(config-if)#ip nat inside
ISP2(config-if)#int s0/0/0
ISP2(config-if)#ip nat outside


Commands

ISP2(config)#sh ip nat translations show translated addresses

You can also verify your NAT configuration via the debug ip nat command.
This output will show the sending address, the translation, and the destination address on each debug line:

ISP2(config)#debug ip nat

But wait—how do you clear your NAT entries from the translation table? Just use the
clear ip nat translation command, and if you want to clear all entries from the NAT table,
just use an asterisk (*) at the end of the command.

Supposedly the sky’s the limit regarding the number of mappings the NAT table can hold. But this is reality, so things like memory and CPU, or even the boundaries set in place by the scope of available addresses or ports, can cause limitations on the actual number of entries. Consider that each NAT mapping devours about 160 bytes of memory. And sometimes the amount of entries must be limited for the sake of performance or because of policy restrictions, but this doesn’t happen very often. In situations like these, just go to the

ip nat translation max-entries command for help.

Another handy command for troubleshooting is

show ip nat statistics. Deploying this gives you a summary of the NAT configuration, and it will count the number of active translation types too. Also counted are hits to an existing mapping as well any misses, with the latter causing an attempt to create a mapping. This command will also reveal expired translations. If you want to check into dynamic pools, their types, the total available addresses, how many addresses have been allocated and how many have failed, plus the number of translations that have occurred, just use thepool keyword after statistics.


Port Redirection

Dans un souci d’économie d’adresse IP, chaque réseau d’entreprise et chaque réseau domestique sont avec des adresses IP dites « privées » en 192.168.0.0, 172.16.0.0, 10.0.0.0 par exemple. Pour pouvoir faire communiquer les réseaux en adresses IP privée sur le WAN, il est indispensable de configurer le NAT overload. Mais de cette façon, il est impossible de faire communiquer un réseau privé avec un autre réseau privé via le WAN.

Objectif : Dans notre cas, nous voulons juste rendre accessible notre serveur WEB cisco.fr via l’IP publique 132.78.241.30 de l’entreprise JAUNE.

Syntax

Router(config)#ip nat inside source static Transpot-Protocol Inside-local-IP Inside-local-Port Inside-Global-IP Inside-Global-Port

Example :
Router(config)#ip nat inside source static tcp 192.168.1.2 80 132.78.241.30 80

Eninam BAGNABANA     |         |     bagnadavid@outlook.fr     |