The primary difference between gateways and routers is that a gateway is the single point of access to computers outside your network. Depending on the complexity of your network, gateways can only be one or a few since they provide the exit and entry points like doors of a house. Routers, on the other hand, determine the shortest possible path your data can travel from Computer A to Computer B, like hallways and staircases.
A gateway is either a server with a gateway application installed or a device that connects a network of computers to another network. If Network A wants to connect to Network B and vice versa, both networks must have gateways that provide exit and entry points for computers from the two networks to communicate. Gateways are important. They define the boundaries of your network.
A router is an application device that has ports, which the computers and servers connect to. Routers are programmed with routing tables to determine the shortest possible path between Computer A and Computer B. A routing table contains a list of IP addresses that a router can connect to transfer data. It is sophisticated enough to determine the number of possible "hops" from one computer to another.
Video of the Day
To illustrate the difference between routers and gateways, imagine two networks with 20 computers each. For the 20 computers inside the network to communicate with each other, no gateway is needed. A router with a routing table that defines the hops within those 20 computers is enough. Now, if Computer A from Network A wants to send files to Computer B from Network B, there must be both a Gateway A and a Gateway B so that the two networks will be able to communicate.
Routers are devices that need to be secured from being flooded with too much data and network traffic. A router needs to be secured in such a way that congestion between routing paths are minimized, so several routing tables should be set up to map out how data travels across the network. Gateway security is more crucial. Being the exit and entry point of a network, gateway servers and equipment should be secured from viruses, since anything that passes through the gateway can access its internal network. If one router is congested or compromised, you can simply take out that router and the other routers will determine other possible paths to get data across the network. If you take a gateway out, you bring a whole network down.
Gateway and Router Configurations
Routers are configured by defining their routing tables. The routing table contains a list of IP addresses that the router can pass data along to. Gateways are configured by defining what is considered internal network and what is considered external. Gateway servers typically have two IP addresses. One is the internal IP address, which computers inside the network communicate to; the other is an external IP address for those outside the network.