From Klaus' wiki
Revision as of 10:26, 23 August 2018 by Klaus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Basically routing is about telling your network part of the kernel where to send a packet to.

If you perform this command:

]$ ip route

you'll get the settings for your local computer.

From my home laptop it looks like this:

default via dev enp0s25 proto static metric 100 
default via dev wlp3s0 proto static metric 600 dev enp0s25 proto kernel scope link src metric 100 dev wlp3s0 proto kernel scope link src metric 600 dev virbr0 proto kernel scope link src linkdown 

The list tells us the if a IP-packet is destined for something else than this scmputer send it to the computer/router.

On another computer this result will appear:

default via dev enp6s0 proto static metric 100 dev docker0 proto kernel scope link src dev br-0186fd2cabd8 proto kernel scope link src dev enp6s0 proto kernel scope link src metric 100

From this we can see that the default gateway to send packages to is, but for packages to and should go through the bridges created by the docker container handler.

Add a new route

Some times we need to telle a computer to make a new route. For instance if we would like to reach the computer residing in a container on from we need to tell the router at where to send the packages. Perform this command:

]$ ip route add via

This tells the router at the send packages destined for the network to the gateway - and from which we have learned from the above knows how to reach the network.