Nat - cisco

De Wiki doc

Topologie

Mettre un schéma avec 4 machines (1 PC - 1 RT - 1RT - 1PC)

NAT statique

Routeur 1

Configuration IP

en
conf t
int fa 0/0
ip address 192.168.1.254 255.255.255.0
no shut
exit
int fa 0/1
ip address 1.1.1.1 255.255.255.252
no shut
exit

Configuration NAT

int fa 0/0
ip nat inside
exit
int fa 0/1
ip nat outside
exit
ip nat inside source static 192.168.1.1 8.8.8.1

Routeur 2

Configuration IP

en
conf t
int fa 0/0
ip address 192.168.2.254 255.255.255.0
no shut
exit
int fa 0/1
ip address 1.1.1.2 255.255.255.252
no shut
exit

Configuration NAT

int fa 0/0
ip nat inside
exit
int fa 0/1
ip nat outside
exit
ip nat inside source static 192.168.2.1 9.9.9.1

NAT dynamique

NAT PAT

On part du principe que le réseau à natter est 192.168.67.0/24, que l'interface LAN est la fa0/0 et que l'interface WAN est la fa0/1.

access-list 1 permit 192.168.67.0 0.0.0.255
!
ip nat inside source list 1 interface FastEthernet0/1 overload
!
interface FastEthernet0/0
 ip address 192.168.67.254 255.255.255.0
 ip nat inside
 no shut
!
interface FastEthernet0/1
 ip address 8.8.8.1 255.255.255.252
 ip nat outside
 no shut

Redirection de port

Redirection d'un serveur WEB par exemple:

ip nat inside source static tcp 192.168.67.1 80 8.8.8.1 80 extendable

Source: https://www.cisco.com/c/en/us/support/docs/long-reach-ethernet-lre-digital-subscriber-line-xdsl/asymmetric-digital-subscriber-line-adsl/12905-827spat.html.