IP NAT Stateful permet de synchroniser les tables de NAT entre 2 routeurs
- Inside Local = IP privé d’un host du résau local
- Inside Global = IP Publique utilisé pour le Nat
- Outside Local = IP privé de destination
- Outside Global = IP Publique de destination
Les postes BB1 et BB2 ont 2 routes par défaut : R4 (10.10.0.4) et R5 (10.10.0.5)
Ils doivent utiliser le pool 213.36.21.10 à 213.36.21.13 pour ateindre Internet
Configuration de IP NAT Stateful
1- Activation du « stateful »
- Pas d’instance HSRP
- le routeur R4 a l’ID 1 ( le routeur R5 aura l’id 2 )
- le process stateful a l’ID 100 (commun au 2 routeurs)
- l’adresse IP des routeurs primaire et backup sont spécifiées
R4(config)#ip nat stateful id 1
R4(config-ipnat-snat)#primary 10.10.0.4
R4(config-ipnat-snat-pri)#peer 10.10.0.5
R4(config-ipnat-snat-pri)#mapping-id 100
2- Configuration du pool d’adresses IP publiques utilisées
R4(config)#ip nat pool MY-POOL 213.36.21.10 213.36.21.13 prefix-length 24
3 – Création d’une access-list
R4(config)#access-list 1 permit 10.10.0.0 0.0.0.255
4 – Création d’une route-map
R4(config)#route-map MY-LAN permit 10 R4(config-route-map)#match ip address 1
5 – Activation du NAT
R4(config)#int fa0/0 R4(config-if)#ip nat inside R4(config)#int fa0/1 R4(config-if)#ip nat outside R4(config)#ip nat inside source route-map MY-LAN pool MY-POOL mapping-id 100
Même chose sur le routeur R5 (avec l’ID 2) :
R5(config)#ip nat stateful id 2
R5(config-ipnat-snat)#backup 10.10.0.5
R5(config-ipnat-snat-bkp)#peer 10.10.0.4
R5(config-ipnat-snat-bkp)#mapping-id 100
R5(config)#ip nat pool MY-POOL 213.36.21.10 213.36.21.13 prefix-length 24
R5(config)#access-list 1 permit 10.10.0.0 0.0.0.255
R5(config)#route-map MY-LAN permit 10
R5(config-route-map)#match ip address 1
R5(config)#int fa0/0
R5(config-if)#ip nat inside
R5(config)#int fa0/1
R5(config-if)#ip nat outside
R5(config)#ip nat inside source route-map MY-LAN pool MY-POOL mapping-id 100
Vérifications :
BB1#ping 80.80.80.21 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 80.80.80.21, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/7/8 ms R4#show ip nat translations Pro Inside global Inside local Outside local Outside global icmp 213.36.21.12:3491 10.10.0.101:3491 80.80.80.21:3491 80.80.80.21:3491 icmp 213.36.21.12:3492 10.10.0.101:3492 80.80.80.21:3492 80.80.80.21:3492 icmp 213.36.21.12:3493 10.10.0.101:3493 80.80.80.21:3493 80.80.80.21:3493 icmp 213.36.21.12:3494 10.10.0.101:3494 80.80.80.21:3494 80.80.80.21:3494 icmp 213.36.21.12:3495 10.10.0.101:3495 80.80.80.21:3495 80.80.80.21:3495 R5#show ip nat translations Pro Inside global Inside local Outside local Outside global icmp 213.36.21.12:3491 10.10.0.101:3491 80.80.80.21:3491 80.80.80.21:3491 icmp 213.36.21.12:3492 10.10.0.101:3492 80.80.80.21:3492 80.80.80.21:3492 icmp 213.36.21.12:3493 10.10.0.101:3493 80.80.80.21:3493 80.80.80.21:3493 icmp 213.36.21.12:3494 10.10.0.101:3494 80.80.80.21:3494 80.80.80.21:3494 icmp 213.36.21.12:3495 10.10.0.101:3495 80.80.80.21:3495 80.80.80.21:3495