Re: How do I read/interpret a (netstat) routing table ?



On Jul 27, 4:23 pm, tho...@xxxxxxxxx (Thommy Kanther) wrote:
After entering a command

netstat -rn

on my computer I am getting the following information (see bottom).

Ok, I know this routing table is used to direct TCP/IP packets to their destination.

But how do I interpret this table ?

For example has a routing command line higher priority the lower it is listed in
the table ?

Assume on local computer 192.168.0.14 a TCP-IP packet is arriving with the destination
192.168.0.32

Starting with the last entry line and going higher step by step the first line which
matches
the destination mask of the two first columns is

192.168.0.0 255.255.255.0 192.168.0.14 192.168.0.14 30

Hmm, from my point of view the routing table says the following: Forward the
packet to computer 192.168.0.14 over interface 192.168.0.14. But what makes this for
a sense? This is the local computer. Why should the packet be forward to itself ?

Shouldn't be a the entry line as follows:

192.168.0.0 255.255.255.0 192.168.0.31 192.168.0.1 30

I am a bit confused.

Could someone give me a good explanation or direct my to a web pages with
good sample evaluations ?

Thank ypu
Thomas

Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.14 30
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.0.0 255.255.255.0 192.168.0.14 192.168.0.14 30
192.168.0.14 255.255.255.255 127.0.0.1 127.0.0.1 30
192.168.0.255 255.255.255.255 192.168.0.10 192.168.0.14 30
224.0.0.0 240.0.0.0 192.168.0.10 192.168.0.14 30
255.255.255.255 255.255.255.255 192.168.0.10 192.168.0.14 1
Default Gateway: 192.168.0.1
===========================================================================
Persistent Routes:
None



Probably, the routing table what ever you see, I think is not
configured properly.
I would like to explain the fields first,
Network Destination --> The one which is outside your subnet,
basically it has different subnet mask compared to local.
NetMask --> Makes it easier for the Router (layer 3 device, which
isolates 2 subnets). This is used to identify which subnet the packet
must go to.
Gateway --> There could be more than one gateway within a network, so
to reach the destination we configure which could be the best possible
gateway
Interface --> Assuming that we could have more number of interfaces
(ethernet interfaces, eth0, eth1, eth2...) and each interface would be
assigned an IPAddress,
so this information is required, on how to reach
the gateway and through which interface it needs to push the packet.
Metric --> Provides the path cost, basically for static routing the
value would be 1 (default, but we can change it) and for dynamic
routing (RIP, IGRP, OSPF) it varies.


Assume that we have a packet with destination IP address as w.x.y.z
arrives to Router, so now the router checks the Routing table and if
it identifies that w.x.y.0/24 is present in the table then it will try
to reach the concerned gateway by pushing through the respective
interface. Assume that there were two entries of the same with metrics
different, then the router has to choose the one which has a lower
value. Assume the router did not find any entries in the routing table
then it would go to default gateway.
Now assume the other scenario, a packet with the destination IP
address k.l.m.n arrives to router, and k.l.m.0/24 is default mask of
the router, then it implies that the packet is destined to same
network and it does not push to outside subnet.

if for further queries search "routing algorithm" in google. you could
find many doc's.



.



Relevant Pages

  • Re: The banding problem, or Pretend Youre a Router
    ... >destination. ... The router is directly connected to N other nodes. ... table to describe the routing. ... Coaching, problem solving, economical contract programming. ...
    (comp.lang.java.programmer)
  • Re: Iptables question on forwarded port with a router
    ... I'm connecting from my pc (let'a call its ip adress ip_1) to a linksys ... I can connect through ssh on port xxx to this destination pc but if I ... The blocked packet is an ICMP type 3, code 4 packet, being sent from ... the router to the destination pc. ...
    (comp.os.linux.networking)
  • Re: Strange MTU Problem
    ... Does the router know how to forward the ICMP ... On the local side, a packet has real source address and destination, ...
    (comp.os.linux.networking)
  • Re: How do I read/interpret a (netstat) routing table ?
    ... This article describes TCP connection states and how to read Netstat ... I know this routing table is used to direct TCP/IP packets to their ... destination. ... Assume on local computer 192.168.0.14 a TCP-IP packet is arriving with the ...
    (microsoft.public.windowsxp.network_web)
  • Re: Question: Iptables -- 127.0.0.1
    ... An IP destination address is invalid if it is among those defined as ... A router SHOULD NOT forward any packet that has an invalid IP source ... address or a source address on network 0. ...
    (comp.os.linux.security)