52 Nat Pat
52 Nat Pat
52 Nat Pat
NAT:
Network Address Translation, or NAT, implies a translation of an IP address to another IP
address. Network Address Translation (NAT) modifies only the Layer 3 header of IP.
PAT:
Port Address Translation, or PAT, implies a translation of an IP address and Port to another IP
address and Port. PAT modifies both the Layer 3 and Layer 4 header. PAT as a subset of NAT.
Static vs Dynamic:
Both a NAT and a PAT can exist in two forms: Static NAT or Dynamic NAT.
Static NAT:
A Static mapping is sometimes referred to as a One-to-One translation. Static NAT translation is
bidirectional. Whether the internal host or the external host sent the first packet, it would
“pass through” the Static NAT. Static NAT is used to do a one-to-one mapping between an
inside address and an outside address. Static NAT also allows connections from an outside host
to an inside host.
Dynamic NAT:
A Dynamic mapping is sometimes referred to as a One-to-Many– implying that in a Dynamic
translation, many addresses can appear as one. Dynamic NAT is used when you have a “pool”
of public IP addresses that you want to assign to your internal hosts dynamically.
Static NAT:
Static NAT implies a translation of single IP address to another single IP address. Static NAT
modifies only the L3 header. Static NAT is useful when a network device inside a private
network needs to be accessible from internet.
Dynamic NAT:
Translation of just the IP address, where the device determines the new IP address after
translation. Dynamic NAT can be defined as mapping of a private IP address to a public IP
address from a group of public IP addresses called as NAT Pool.
R1 Basic Configuration
R1(config)#interface f0/0 R1(config)#interface f0/1
R1(config-if)#ip address dhcp R1(config-if)#ip add 192.168.0.100 255.255.255.0
R1(config-if)#no shutdown R1(config-if)#no shutdown
R1(config)#ip name-server 8.8.8.8 R1(config)#ip domain-lookup
After send the traffic from 192.168.01, it is translated and send the traffic outside.
PAT Configuration on R1
R1(config)#access-list 1 permit 192.168.0.0 0.0.0.255
R1(config)#ip nat pool mypool 192.168.169.139 192.168.169.139 netmask 255.255.255.0
R1(config)#ip nat inside source list 1 pool mypool overload
R1(config)#interface f0/0
R1(config-if)#ip nat outside
R1(config-if)#interface f0/1
R1(config-if)#ip nat inside