later they came up with a concept of private IP address which can be used without any restrictions and free to use but cannot be routable on the internet. With the introduction of NAT, this problem has been solved and it provides better security to the internal hosts because private IP address has been hidden with the public IP address.
There are 4 options that available to configure NAT PAT
- one to one dynamic NAT.
- one to one static NAT.
- one to many dynamic PAT.
- one to one static port forwarding.
Before heading to the configuration , we have to discuss some cisco defined terminology. From site A view
Inside local:- this is the private network side, all internal network within an organization.
Inside global:- public network side which is connected to the internet.
How to configure one to one dynamic NATFirstly we are going to create a standard access list that permitting that 192.168.1.0/24 network. So that we can use this access list to match all the hosts in that network.
IP access-list private
Access-list 1 permit 192.168.1.0 0.0.0.255
Next, we have to mention interfaces of the router which is inside and which is outside. Inside interface is connected to the internal private network and out side interface is connected to the internet. This configuration is same for all 4 options.
Ip nat inside
Ip nat outside.
Creating a pool of public address.Here each public IP address of the pool will dynamically map each private IP address of the host.
Ip nat pool public 188.8.131.52 184.108.40.206 netmask 255.255.255.0
Final main command. Here source will access list and the pool contains public IP addresses.
Ip nat inside source list private pool Public
How to configure one to one static NATIP nat inside source static 192.168.1.2 220.127.116.11
Ip nat inside source static 192.168.1.3 18.104.22.168
Here we have mapped each host's private IP address to each public IP address
How to configure PAT (port address translation )IP nat inside source list private interface gi0/0 overload
Here interface keyword points to the public IP address of the interface and overload command enables the functionality that multiple internal hosts use that single IP address. That IP address is 22.214.171.124 in this scenario.
How to configure port forwarding staticIp nat inside source static TCP 192.168.1.2 80 126.96.36.199 80 extendable
This is pretty similar to static nat but here you have to mention the local port and global port. And extendable keyword is used to map multiple ports against that single IP address again and again.