Question: What is difference between router and gateway?

Solution: A router is a piece of networking gear which routes traffic between networks or subnets. Routers function at layer 3, meaning they route based on IP addresses.

Routers use route tables to determine how to route traffic. IP addresses or address ranges are assigned to each interface, and when a packet is routed, the destination address is located in the table so the packet is forwarded out the correct interface.

The gateway router is the connection from your network to the outside world. All traffic not destined for another subnet or segment of the internal network is sent to the gateway and on to its external destination.

The gateway router, like any other router, uses a route table. However, the wildcard or ALL address definition is used, indicating that all traffic not designated as internal gets sent out into the outside world.
Incoming Traffic

The gateway also serves as the access point to your network. From the outside, the only IP address seen is your gateway address. All traffic bound for your network comes into the gateway interface, and is routed internally from there.