Routing in Linux

From docwiki
Revision as of 16:03, 27 March 2020 by Mond (talk | contribs) (How packets find their way)
Jump to: navigation, search


Motivation

We have already seen that IP packages do not only exist on your local network but are routed between networks around the world. How does routing in Linux work? Who do the package know which way to travel? What if you want to build your own router using a Linux system? Here you will learn the basics of how to do this.

How packets find their way

Let's assume you share your house with another family. You life on the first floor and the other family lives on the 2nd floor. You only have one Internet connection abut you want to share it with the other family. Yet you do not completely trust them so you want them on their own network segment.

In between the networks you an old PC that should work as a router. This could be the setup displayed below:

For the 1st floor you use: 192.168.1.0/24 and for the 2nd floor you use 192.168.2.0/24 addresses. The vertical bars symbolize the network. In the drawing we have only drawn one computer in the first network and one in the 2nd and one computer that has legs in both networks that should work as a router.


Route.png