In order to access the Internet, we need one public IP address; however, we can use Private IP address in private networks. The Network address translation (NAT) allows multiple devices to access the Internet with a single public IP address.
Network address translation (NAT) is the process of translation of one or more local IP addresses translated into global IP addresses or vice versa in order to provide Internet access to local users. Now being familiar with Network address translation (NAT) we will look more into detail of IP NAT inside source and IP NAT outside source in this article.
Today we look more in detail about two ways of configuring Network Address Translation (NAT) which is IP NAT inside source and IP NAT outside source.
IP NAT inside source & IP NAT outside source
While configuring to use NAT in your network we need to define NAT inside and NAT outside interfaces. Before we deep dive into both terminologies and their configuration we need to understand more about a few terms.
- Inside local IP is how inside local IP address is seen by inside hosts, which is actual IP of our system
- Inside global IP is how inside address is seen globally by outside hosts, from outside hosts in Internet it is translated (NATed) IP address of our system
- Outside local address is how outside address is seen locally by inside hosts, it is translated (NATed) IP of host which resides out of network and used as destination IP address by hosts in LAN
- Outside global IP is how outside address is seen globally by outside hosts, it is real IP address of host which resides in network
IP NAT Inside
IP NAT inside is frequently used by today’s networks. With a large number of hosts in LAN and letting them connect to the Internet means external IP addresses to be provided for each internal host. Such a big range of public IP addresses could be expensive and might not be also available with service providers.
In that case NAT inside comes handy by simply translating all inside IP addresses to one public IP address using Port Address translation (PAT) which is a NAT feature.
- PAT translates the IP addresses to one outside IP in addition it will translate the layer 4 source ports.
- Router will rewrite the TCP or UDP source port by changing just one source IP address and will intimate a session with another host having the same layer 4 source then router will take up the free port.
- With this mechanism the router will be able to create 64511 sessions for one public IP address.
- Inside NAT will hide the server’s real IP address and put it under public IP in the Internet as service for public use. This will hide the internal network infrastructure and save public IP range as all our public services can be hosted under one IP.
IP NAT Outside
The outside NAT translation changes destination address which is useful when an organization has business connection to a 3rd party or external business entity and they are using the same IP address which is getting used somewhere in our internal network.
Let’s look at one sample example to configure NAT inside and NAT outside as per the above diagram. Here we have used Static NAT.
- IP NAT inside source translates source IP address packets which travel from inside to outside and translates destination IP address of packets which travel from outside to inside.
- IP NAT outside source on the other hand, translates the source IP address of packets which travel from outside to inside and translates the destination IP address of packets which travel from inside to outside.
NAT inside source IP (LAN perspective)
All traffic from the system with 10.0.10.1 will be NATed to 220.127.116.11 . Now let’s define the server IP address (18.104.22.168) which will be used by the system as destination IP address.
Now both inside and outside interfaces are defined
Two static one to one translation will be added to the NAT table. So, it is possible to initiate connection from inside or from outside.