According to the way TCP/IP works, in order for hosts to communicate on the Internet, each must have a unique IP address.
However, due to the shortage of public IP addresses available, it is necessary to use one IP address for many hosts using NAT.
Network Address Translation is a way to translate one IP address into another. This implies a NAT router (Linux in our case) that rewrites the source or destination IP of a device behind the NAT router.
There are many small boxes called SOHO routers or NAT routers that can be used to perform NAT for a small private LAN. They are cheap and usually you can just plug them in and everything works. If you have already used one, you will see that there are many things you can do with Linux.
To explain NAT in more detail, let's take a look at the following diagram:
We have a Linux router with one Internet connection and a public IP address—1.1.1.1. We can use whatever IP addresses we want from the private IP segments...