What Is a Gateway
What a Gateway Is and What It Does
"Internal" IP addresses in a LAN are exactly like internal phone extensions in an office phone system. You can use them to call out, but nobody can reach you directly from the outside. If someone calls the office and wants to talk to you, one of two things may happen: (1) the receptionist manually transfers the call to your extension, or (2) you have a special outside number which is mapped to your internal extension, so whoever dials the external number is automatically forwarded to your extension.
In a LAN, when you want to "call out" (communicate from your computer to an external computer, like an Internet host running a website) you go through a gateway . A gateway is a unique device on the network, because it is connected to two networks at the same time: Both internally, to your LAN, and externally, to the WAN. Just like the office phone system (the PBX itself) is connected both to the internal extensions in the office, and to the "real" outside phone lines of the office.
So, as can be seen above, a gateway has two addresses -- one on each network. And it can be very easily used for making an outbound connection. But -- what happens when you want to make an inbound connection?