NAT : Network Address Translation
NAT et translation d’adresses
Le protocole NAT (Network Address Translation) effectue la correspondance
entre une adresse privée (adresse non routée sur Internet et accessible
uniquement dans un réseau local ) et l’adresse publique (adresse qui est routée par
les routeurs du réseau Internet )pour se connecter à Internet
Private Public
[Link]/24
SWA [Link]/30
SWA
[Link]/24
2
NAT statique
mappage direct un à un entre une adresse privée et une adresse
publique au niveau de la passerelle (au niveau du routeur RTA pour
cet exemple)
S:[Link] D:[Link] S:200.10.10 D:[Link]
.1
.5
Host A SWA RTA [Link]/24
([Link])
[Link]/24 [Link]/24
SWA
.2
D:192.168. S:[Link] D:200.10.1 S:[Link]
Host B 1.1 0.5
[Link] [Link]
[Link] [Link]
3
NAT dynamique
principe de pool d’adresses publiques : une plage d’adresses publique définie
Chaque utilisateur du réseau local, désirant se connecter à Internet, son adresse
privée sera associée, dynamiquement pour une période fixe, à une adresse publique
appartenant au pool d’adresses
Le nombre d’adresses du pool défini est inférieur au nombre de machines dans le
réseau local (les utilisateurs n’accèdent tous en même temps à Internet)
S:[Link] D:[Link] S:[Link] D:[Link]
.1 S:[Link] D:[Link] S:[Link] D:[Link]
Host A [Link]/24
SWA RTA
[Link]/24
[Link]/24 SWA
.2 Address Group
[Link]
[Link]
Host B
[Link]/24 [Link]/24
[Link] [Link]
[Link] [Link] 4
Network Address Port Translation
La passerelle NAT peut affecter une même adresse publique pour
plusieurs machines ayant des adresses privées différentes, en utilisant
les numéros de ports des applications utilisées par les utilisateurs
S:[Link]:1025 S:[Link]:2843
.1 S:[Link]:1028 S:[Link]:2844
Host A [Link]/24
SWA RTA
[Link]/24
[Link]/24 SWA
G0/0/1
.2 Address Group
[Link]
[Link]
Host B
[Link]/24 [Link]/24
[Link]:1025 [Link]:2843
[Link]:1028 [Link]:2844
5
…… ……
Easy IP
concerne les réseaux locaux de petites échelles
Une unique adresse IP publique temporaire est utilisée par les
machines pour accéder à Internet
S:[Link]:1025 S:[Link]:2843
.1 S:[Link]:1028 S:[Link]:2844
Host A [Link]/24
SWA RTA
[Link]/30
[Link]/24 SWA
G0/0/1 S1/0/0
.2
[Link]/24 [Link]/30
Host B [Link]:2843
[Link]:1025
[Link]:1028 [Link]:2844
…… ……
6
Static NAT Configuration
.1 S:[Link] D:[Link] S:[Link] D:[Link]
Host A [Link]/24
SWA RTA
[Link]/24
G0/0/1 S1/0/0
.2
Host B
[RTA]interface GigabitEthernet0/0/1
[RTA-GigabitEthernet0/0/1]ip address [Link] 24
[RTA]interface Serial1/0/0
[RTA-Serial1/0/0]ip address [Link] 24
[RTA]nat static global [Link] inside [Link]
Page 7
RTA]nat static global [Link] inside [Link]
Static NAT Configuration Validation
[RTA]display nat static
Static Nat Information:
Interface : Serial1/0/0
Global IP/Port : [Link]/----
Inside IP/Port : [Link]/----
Protocol : ----
VPN instance-name : ----
Acl number : ----
Netmask : [Link]
Description : ----
Total : 1
Static inside and global address translation can be verified.
Page 8
Dynamic NAT Configuration
[Link] [Link]
[Link] [Link]
.1 …… ……
Host A [Link]/24
SWA RTA
[Link]/24
G0/0/1 S1/0/0
.2
Host B
Définir le pool d’@
[RTA]nat address-group 1 [Link] [Link] publiques
[RTA]acl 2000
[RTA-acl-basic-2000]rule permit source [Link] [Link]
[RTA-acl-basic-2000]quit
Définir le trafic sortant auquel va être appliquée la translation d’@
[RTA]interface serial1/0/0
[RTA-Serial1/0/0]nat outbound 2000 address-group 1 no-pat
Appliquer le pool d’@ (address-group 1) au trafic sortant
Dynamic NAT Configuration
Validation
[RTA]display nat address-group 1
NAT Address-Group Information:
--------------------------------------
Index Start-address End-address
1 [Link] [Link]
[RTA]display nat outbound
NAT Outbound Information:
----------------------------------------------------------------
Interface Acl Address-group/IP/Interface Type
----------------------------------------------------------------
Serial1/0/0 2000 1 no-pat
----------------------------------------------------------------
Total : 1
Enables group binding parameter configuration to be verified.
Page 10
Easy IP Configuration
S:[Link]:1025 S:[Link]:2843
.1
S:[Link]:1028 S:[Link]:2844
Host A [Link]/24
SWA RTA
[Link]/24 RTA [Link]
SWA
G0/0/1 S1/0/0
.2
Host B
[RTA]acl 2000
[RTA-acl-basic-2000]rule permit source [Link]
[Link]
[RTA-acl-basic-2000]quit Appliquer au trafic sortant l’@
de l’interface de sortie du
[RTA]interface serial1/0/0
routeur [Link]
[RTA-Serial1/0/0]nat outbound 2000 Page 11
Easy IP Configuration Validation
[RTA] display nat outbound
NAT Outbound Information:
---------------------------------------------------------------------
Interface Acl Address-group/IP/Interface Type
---------------------------------------------------------------------
Serial1/0/0 2000 [Link] easyip
---------------------------------------------------------------------
Total : 1
Associated outbound interface parameters are displayed.
The type field verifies the successful configuration of Easy IP.
Page 12
NAT Internal Server Configuration
D:[Link]:8080 D:[Link]:80
Server
RTA
[Link]
[Link]/24 G0/0/1 S1/0/0
[RTA]interface GigabitEthernet0/0/1
[RTA-GigabitEthernet0/0/1]ip address [Link] 24
[RTA]interface Serial1/0/0
[RTA-Serial1/0/0]ip address [Link] 24
[RTA]nat server protocol tcp global [Link] www
inside [Link] 8080 Page 13
NAT Internal Server Configuration
Validation
[RTA]display nat server
Nat Server Information:
Interface : Serial1/0/0
Global IP/Port : [Link]/80(www)
Inside IP/Port : [Link]/8080
Protocol : 6(tcp)
VPN instance-name : ----
Acl number : ----
Description : ----
Total : 1
Successful translation of the IP address and port is achieved.
Page 14