Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.networking > #3012 > unrolled thread

beginner question on route

Started byMagnus Warker <magnux@mailinator.com>
First post2014-07-05 09:09 +0200
Last post2014-07-06 10:34 +0200
Articles 7 — 5 participants

Back to article view | Back to comp.os.linux.networking


Contents

  beginner question on route Magnus Warker <magnux@mailinator.com> - 2014-07-05 09:09 +0200
    Re: beginner question on route detha <detha@foad.co.za> - 2014-07-05 09:38 +0200
      Re: beginner question on route Magnus Warker <magnux@mailinator.com> - 2014-07-07 18:30 +0200
        Re: beginner question on route Tauno Voipio <tauno.voipio@notused.fi.invalid> - 2014-07-07 19:40 +0300
        Re: beginner question on route William Unruh <unruh@invalid.ca> - 2014-07-07 20:34 +0000
    Re: beginner question on route William Unruh <unruh@invalid.ca> - 2014-07-06 04:44 +0000
      Re: beginner question on route Pascal Hambourg <boite-a-spam@plouf.fr.eu.org> - 2014-07-06 10:34 +0200

#3012 — beginner question on route

FromMagnus Warker <magnux@mailinator.com>
Date2014-07-05 09:09 +0200
Subjectbeginner question on route
Message-ID<lp88bk$ucv$1@news.m-online.net>
Hi,

the output of a "route" call on my Linux box looks like this:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use 
Iface
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
localnet        *               255.255.255.0   U     0      0        0 eth0

Questions:

What is this route with destination "localnet" for and what does "*" as 
gateway mean?

Why isn't the default route the last one? I thought that the entries are 
processed from top to bottom and the first one that matches is used?

Thanks
Magnus

[toc] | [next] | [standalone]


#3013

Fromdetha <detha@foad.co.za>
Date2014-07-05 09:38 +0200
Message-ID<53b7ab58$0$63460$862e30e2@ngroups.net>
In reply to#3012
On Sat, 05 Jul 2014 09:09:40 +0200, Magnus Warker wrote:

> Hi,
> 
> the output of a "route" call on my Linux box looks like this:
> 
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use
> Iface
> default         192.168.1.1     0.0.0.0         UG    0      0        0
> eth0 localnet        *               255.255.255.0   U     0      0       
> 0 eth0
> 
> Questions:
> 
> What is this route with destination "localnet" for and what does "*" as
> gateway mean?

localnet is what is directly connected to eth0, probably 192.168.1.0/24 in
your case; the * means no gateway, directly reachable.

If you use 'route -n' (or 'ip route show') things may be a bit clearer.

> 
> Why isn't the default route the last one? I thought that the entries are
> processed from top to bottom and the first one that matches is used?
> 

In what order the routing table is displayed doesn't matter. Routes are
selected on 'closest match', i.e. how many bits match. If you had routes

0.0.0.0/0 gateway 192.168.1.1
10.0.0.0/8 gateway 192.168.1.2
10.3.0.0/16 gateway 192.168.1.3

traffic for 10.3.1.1 would go to 192.168.1.3, traffic for 10.6.1.1 would
go to 192.168.1.2, and anything not in 10.*.*.* to 192.168.1.1

> Thanks
> Magnus

[toc] | [prev] | [next] | [standalone]


#3022

FromMagnus Warker <magnux@mailinator.com>
Date2014-07-07 18:30 +0200
Message-ID<lpehvk$hfi$1@news.m-online.net>
In reply to#3013
On 07/05/2014 09:38 AM, detha wrote:
> On Sat, 05 Jul 2014 09:09:40 +0200, Magnus Warker wrote:

> localnet is what is directly connected to eth0, probably 192.168.1.0/24 in
> your case; the * means no gateway, directly reachable.
>
> If you use 'route -n' (or 'ip route show') things may be a bit clearer.

Ok. What does a destination 0.0.0.0 mean? And what does a gateway 
0.0.0.0 mean?

And BTW: Why does "route" last several seconds until the table is 
printed (while "route -n" prints the table immediately)?

Thanks
Magnus

[toc] | [prev] | [next] | [standalone]


#3023

FromTauno Voipio <tauno.voipio@notused.fi.invalid>
Date2014-07-07 19:40 +0300
Message-ID<lpeiic$vc6$1@dont-email.me>
In reply to#3022
On 7.7.14 19:30, Magnus Warker wrote:

> Ok. What does a destination 0.0.0.0 mean? And what does a gateway
> 0.0.0.0 mean?

Destination 0.0.0.0 is associated with netmask 0.0.0.0, and it means
that all destinations that have come this far in the table match, so
its gateway is the default route to the outside world.

Gateway 0.0.0.0 means that there is none: the destination is reachable
directly on the local network.

> And BTW: Why does "route" last several seconds until the table is
> printed (while "route -n" prints the table immediately)?

The time goes to the name service attempting to reverse resolve the
addresses in the table. A long time means that the resolution timed
out of some reason.

-- 

Tauno Voipio

[toc] | [prev] | [next] | [standalone]


#3024

FromWilliam Unruh <unruh@invalid.ca>
Date2014-07-07 20:34 +0000
Message-ID<lpf07o$6on$1@dont-email.me>
In reply to#3022
On 2014-07-07, Magnus Warker <magnux@mailinator.com> wrote:
> On 07/05/2014 09:38 AM, detha wrote:
>> On Sat, 05 Jul 2014 09:09:40 +0200, Magnus Warker wrote:
>
>> localnet is what is directly connected to eth0, probably 192.168.1.0/24 in
>> your case; the * means no gateway, directly reachable.
>>
>> If you use 'route -n' (or 'ip route show') things may be a bit clearer.
>
> Ok. What does a destination 0.0.0.0 mean? And what does a gateway 
> 0.0.0.0 mean?

It means any destination (default route)
It means thatthe system is just to dump the packets onto the local
network as those addresses are of  computers are attached directly to your computer. 
by your local network. Ie, it is to look up the arp tables and deliver
the messages to mac adresses not ip addresses. 




>
> And BTW: Why does "route" last several seconds until the table is 
> printed (while "route -n" prints the table immediately)?

It has to use dns to figure out what the names associated with the
addresses are. 
In the coputer, the routing is by address, not name, so it needs no time
to figure out what the addresses in the table are, that is how they are
stored there. 

>
> Thanks
> Magnus

[toc] | [prev] | [next] | [standalone]


#3018

FromWilliam Unruh <unruh@invalid.ca>
Date2014-07-06 04:44 +0000
Message-ID<lpak83$2ta$1@dont-email.me>
In reply to#3012
On 2014-07-05, Magnus Warker <magnux@mailinator.com> wrote:
> Hi,
>
> the output of a "route" call on my Linux box looks like this:
>
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use 
> Iface
> default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
> localnet        *               255.255.255.0   U     0      0        0 eth0
>
> Questions:
>
> What is this route with destination "localnet" for and what does "*" as 
> gateway mean?
>
> Why isn't the default route the last one? I thought that the entries are 
> processed from top to bottom and the first one that matches is used?

Nope. More specialised to less specialised. Ie, the route used is the
most specialised route which matches the address. 
Use 
route -n
so it does not give names to the destinations, but rather IP addresses.
I suspect that localnet is 127.0.0.0
Ie, any address that starts with 127.0.0 (see the genmask)
And the * in the gateway is to use
the local network. 

>
> Thanks
> Magnus

[toc] | [prev] | [next] | [standalone]


#3019

FromPascal Hambourg <boite-a-spam@plouf.fr.eu.org>
Date2014-07-06 10:34 +0200
Message-ID<lpb1ng$1esi$1@saria.nerim.net>
In reply to#3018
William Unruh a écrit :
> On 2014-07-05, Magnus Warker <magnux@mailinator.com> wrote:
>>
>> the output of a "route" call on my Linux box looks like this:
>>
>> Kernel IP routing table
>> Destination     Gateway         Genmask         Flags Metric Ref    Use 
>> Iface
>> default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
>> localnet        *               255.255.255.0   U     0      0        0 eth0
>>
>> Questions:
>>
>> What is this route with destination "localnet" for and what does "*" as 
>> gateway mean?
> 
> I suspect that localnet is 127.0.0.0

No. 127.0.0.0 is rather the loopback subnet, its mask would be
255.0.0.0, not 255.255.255.0 and its interface would be the loopback
interface "lo". Besides, the loopback route does not appear in the main
routing table, it is stored in a special "local" table which can be
displayed with "ip route table local".

As detha wrote, localnet is the LAN subnet attached to eth0. Network
names are usually stored in /etc/networks.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.os.linux.networking


csiph-web