A routing table tells a router where to forward packets based on their destination IP address.
Destination — the network address in CIDR notation
Gateway — the next-hop router IP
Interface — the physical or virtual NIC used
Metric — cost/priority (lower = preferred)
Longest Prefix Match: When multiple routes match a destination IP, the route with the longest (most specific) subnet mask wins. For example, 192.168.1.0/24 is preferred over 192.168.0.0/16 because /24 is more specific than /16.
The default route0.0.0.0/0 matches all destinations and is used as a last resort when no more specific route exists.
If two routes have the same prefix length, the one with the lower metric is chosen.