Router – Network Gateways vs Interfaces

interfaceNetworkrouter

When looking at the contents of a routing table section on the Wikipedia article on Routing Tables, it contains a table as an example of a routing table with two headings which have an unclear distinction to me: Gateway and Interface.

I believe a gateway is where a packet is forwarded to by the router. If this is the case, what is the Interface column? If this is not, what is the Gateway column representing, particularly in comparison with the Interface column?

enter image description here

Best Answer

An interface is a connection to a local segment. Generally, it's a network interface or port (layer 1 and 2). A single network port may have multiple IP addresses and represent multiple layer-3 interfaces though. Using VLAN tags (802.1Q), it may also represent multiple layer-2 interfaces.

A gateway is a potential path to a remote network. It needs to be in reach of one or more interfaces, ie. be part of the same segment and subnet. The default gateway is the path to 'everything we don't have a better path for'.

Gateway is the functional name from the perspective of a local segment where a gateway leads 'elsewhere'. Router is the very same thing from the overall perspective of the larger network - a connection between two or more subnets.

Now, the interface in a routing table is that interface which is to be used to talk to the given gateway. A host may have multiple interfaces with the connecting segment and normally chooses the one with the highest link speed (lowest metric).