unnecessary route entry?

Good day :slight_smile:

I recently checked some stuff on my gateway and discovered what I believe is an unneeded route entry.

# route -n
Kernel IP routing table
Destination Gateway Genmask ... Iface
287.265.45.0 0.0.0.0 255.255.255.0 ... eth0
192.168.0.0 0.0.0.0 255.255.255.0 ... eth1
127.0.0.0 0.0.0.0 255.0.0.0 ... lo
0.0.0.0 287.265.45.1 0.0.0.0 ... eth0

The first entry sends packets targeted for the 287.265.45-network directly right (not through another gateway)?

But is this really necessary? Since...

$ traceroute 287.265.45.133
traceroute to 287.265.45.133 (287.265.45.133), 30 hops max, 40 byte packets
1 287.265.45.1 (287.265.45.1) 227.574 ms 12.567 ms 12.8 ms
2 blabla.example.com (287.265.45.133) 2222.17 ms 2719.7 ms 3233.03 ms

... shows that the packets travel through 287.265.45.1 anyway.

[Yes, the ip-adress 287... is invalid, I changed it :stuck_out_tongue: ]

You probably need it. Here is an explaination from SUN - ( I know you aren't running Solaris (the route -n command does not give the information you showed)).

Q: What routes are automatically set up?

A: A few routes automatically get set up every time your machine is
booted.

First, all machines will always have a localhost route back to
themselves:

Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
127.0.0.1 127.0.0.1 UH 0 591 lo0

This is standard and increases the efficiency of packets that a
machine sends to itself.

Second, Solaris machines have a special multicast route:

224.0.0.0 150.101.16.28 U 3 0 le0

Multicast routes are used by certain programs that broadcast to a
group of machines rather than to the subnet in general.

Finally, all machines will always set up one route for each of their
interfaces. The route will be a simple one which says that all packets
which go to the interface's network should be routed through the
interface.

For example, I have one interface, le0, with an IP address of
150.101.16.28. Since I use a netmask of 255.255.255.0, this means that
my local network is 150.101.16.0, and the route looks like this:

150.101.16.0 150.101.16.28 U 3 951 le0

(It should be noted that machines which use point-to-point interfaces,
such as PPP, will have slightly different routes consult the PPP Tip
Sheet for more info on these.)

aha, thanks for the reply :slight_smile:

I have also seen route entries that has a route to itself (not the 127.0.0.1 adress). Say my IP-adress on the Internet is 123.45.67.89, a route will then look like this:

Destination Gateway Netmask Interface

123.45.67.89 - 0.0.0.0 - 255.255.255.255 - eth0

Any ideas why this is used? Is it even 'necessary'?

/J.P

Here is the link to the whole document on Sunsolve:
explaination of routes

Simply, ask yourself the following:

  1. Is it working?
    Yes - don't mess with it
    No - go to 2
  2. Did it work before?
    Yes - go to 3
    No - call support
  3. Did someone change something?
    Yes - go to 4
    No - call support
  4. Can you change it back?
    Yes - should be fixed - if not call support
    No - go to 5
  5. Will you be blamed?
    Yes - update resume
    No - don't worry about it

If you are just experimenting - insure it is on a box that won't matter if it dies - then, change what you want, reboot, see what happens. You never posted your OS so I can't give you more than this - your OS may have different ways of doing things than Solaris so I can't give you more than this. Read the document.