Router
the IP routerA router is the box that decides which network a packet belongs on next. It reads the destination IP address, looks it up in a table of known routes, and forwards the packet one hop closer — the join between one network and every other.
A router connects two different networks and forwards packets between them by IP address.
How it works
and passes traffic between them
The laptop on Network A can’t reach the server on Network B directly — they’re on different networks. The router sits on both, matches the destination 203.0.113.5 to Network B, and forwards it out eth1.
What a router does, step by step
A frame arrives; the router strips the L2 header and reads the destination IP inside the packet.
It finds the most specific matching prefix in its routing table — the longest-prefix match — to pick an egress interface.
It drops the TTL by one (killing loops), then wraps the packet in a fresh L2 frame for the next hop.
Out it goes on the chosen interface. Routing protocols like OSPF and BGP keep the table current in the background.
In cybersecurity
Because every packet between networks passes through it, the router is the network’s first line of defence — and, if left open, its first way in.
Access-control lists let it drop or allow traffic by IP and port before it ever reaches the LAN.
NAT masks every internal address behind one public IP, so hosts aren’t directly reachable from outside.
Routing between subnets keeps a breach in one segment from spreading freely across the whole network.
Default passwords and stale firmware turn a router into an easy foothold — patch it and change the credentials.
Its logs and flow records are the vantage point for spotting scans, exfiltration and odd traffic patterns.
It terminates encrypted tunnels, letting remote sites and workers join the network over a trusted link.
