:: Re: [DNG] routing tables.
Góra strony
Delete this message
Reply to this message
Autor: Hector Gonzalez Jaime
Data:  
Dla: dng
Temat: Re: [DNG] routing tables.

On 5/17/21 1:35 PM, Hendrik Boom wrote:
> I have found several authoritative-looking web pages on instructions to
> display and edit the routing tables.
>
> But none of them explains what the routing tabe entries *mean*.


The routing table entries show the way your host can find other
networks, local or remote.  Each entry describes how to reach every
connected network, and what it considers to be local to your
connection.  A special route, the default route, shows how to reach
networks outside of your local scope.

Other routing table entries may show how to reach other networks.

When you configure your interface ethv0, a route to its local network
will be shown, for example:

with "ip route":

192.168.1.0/24 dev ethv0 proto kernel scope link src 192.168.1.10

with "netstat -rn" :

Destination     Gateway         Genmask         Flags   MSS Window  irtt
Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0
ethv0

They both describe the same route, to network 192.168.1.0, with a 24 bit
netmask (meaning you have 8 bits left for hosts in your network, from
192.168.1.1 to 192.168.1.254, with 192.168.1.0 being used to reference
the network itself, and 192.168.1.255 as the broadcast address, where
you would send data meant for every host in your network).

If you want to reach say network 192.168.90.0/24 which is reacheable via
host 192.168.1.2, you could add a route like this:

ip route add 192.168.90.0/24 via 192.168.1.2

A special route to network 0.0.0.0/0 is the default route, which is used
to reach any network of which your host has no knowledge. With ip show
it looks like this:

default via 192.168.1.1 dev ethv0 onlink

with netstat -rn it looks like this:

Destination     Gateway         Genmask         Flags   MSS Window  irtt
Iface
0.0.0.0         192.168.1.1   0.0.0.0         UG        0 0          0 ethv0

With route it can be added as:

route add -net default gw 192.168.1.1

once you have your interface configured.

--
Hector Gonzalez
cacho@???