Networking routers
From wikinotes
Routers are responsible for bridging/routing packets between networks/subnets.
datalink layer frames are transmitted to a router's network-interface identified by it's MAC Address.
It looks up the target IP address network in it's routing table and if the network is reachable,
the packet's frame is replaced with info specific to the new network and sent.
+---------------+ +-----------------+
| network-1 | | network-2 |
|192.168.1.0/24 | | 10.0.0.0/24 |
| | +-----------------+ | |
| datagram | | router | | |
| 10.0.0.5/24 --------> 192.168.1.1/24 | | destination |
| | | 10.0.0.1/24 ------------> 10.0.0.5/24 |
| | | | | |
+---------------+ +-----------------+ +-----------------+
A frame may pass through several routers to reach it's destination.
the routing table determines the gateway router for the next network to pass through.
Tutorials
router in nixos https://francis.begyn.be/blog/nixos-home-router single NIC router https://louwrentius.com/raspberry-pi-as-a-router-using-a-single-network-interface.html
Protocols
gateway protocols
Notes
routing schemes routing tables