Operating System - HP-UX
1755702 Members
2550 Online
108837 Solutions
New Discussion юеВ

Re: routing tables on hpux

 
SOLVED
Go to solution
antonio elder prado
Regular Advisor

routing tables on hpux

Hi, I have some questions on the routing tables, please anybody that can answer would be great. TIA.
1. when I do netstat -rn it shows my routing table. How is decided on what path to go ?, has default precedence over others ?; for example:
default 10.10.80.7
10.10.0.0 10.10.80.7
10.10.50.0 10.10.80.1
10.10.30.22 10.10.70.2 <= localhost IP.
2. when I put a new route into routing tables using route add do I still put the extra 1 (at the end ) as hop or it is not needed.
3. on my netmasks I have all lan cards with 10.10.255.255 is this good or the machine keeps on checking all the packets and this increases the traffic. Is it better to limit the netmask of the subnet of the machine. for example: ifconfig lan3 10.10.60.77 netmask 255.255.0.0 broadcast 10.10.60.255.
thank you once again.
8 REPLIES 8
Mark Greene_1
Honored Contributor
Solution

Re: routing tables on hpux

1. I don't know, good question. My guess is that that default is evaluated last.

2. no, the 1 isn't needed. At least I've never used it and not had a problem with that.

3. With a netmask to include the entire subnet, you're not affecting traffic, as this doesn't affect the number of packets hitting the NIC; what this does is determine how many packets the lan driver lets through to the system. We are using a netmask of 255.255.255.0 on almost all of our systems with no adverse affects.

mark
the future will be a lot like now, only later
Patrick Wallek
Honored Contributor

Re: routing tables on hpux

The netmask basically determines which machines are on the same subnet and which are "remote" (ie. you have to go through a router to get to them.).

If you have an IP address of 10.10.60.77 and a subnet mask of 255.255.0.0, then you are saying that EVERYTHING in the 10.10.*.* range are all on the same subnet (ie. no router needed).

The subnet mask should be determined by your networking staff. It is not an arbitrary number that can be just plucked from the air.
Bill Costigan
Honored Contributor

Re: routing tables on hpux

default is used last. The netmask on the route command should be used to subdivide the networks.

I.e. if you want packets going to 10.10.50.6 to go to router 10.10.80.1, then the netmask on that route should be 255.255.255.0 so that the first 3 octets are looked at to select the network.

[The trailing '1' should be included as that indicates that the route is through a gateway/router.]

Generally, I believe the route that matches with the biggests netmask is the one that is used.

e.g. 10.10.50.0 255.255.255.0 #1
10.10.0.0 255.255.0.0 #2
0.0.0.0 0.0.0.0 #3

10.10.50.6 matches all 3 but the first is the best match
antonio elder prado
Regular Advisor

Re: routing tables on hpux

thank you Mark, Patrick, and Bill. I got very good info from you guys. Thank you once again.
rick jones
Honored Contributor

Re: routing tables on hpux

Closest match (perhaps including source IP if ip_strong_es_model is set) is what is used. That is, a hostroute will be used before a network route will be used before the default route.

You cannot and should not rely on any particular ordering or precedence _within_ those categories. For example, if there are two different host routes for a given destination, you should not rely on one or the other being picked first.

FWIW, I tend to let the system pick the broadcast address based on the subnetmask and IP address. In your example of 10.10.60.77/16 (aka netmask 255.255.0.0) you gave a broadcast of 10.10.60.255, but generally, the broadcast in that case would be 10.10.255.255.

Also, typically, it is best that each physical (from the point of view of the transport) interface is configured in a separate IP subnet. If you want multiple NICs in the same subnet, consider using APA, or perhaps doing stuff with ip_strong_es_model and/or lots of host routes.
there is no rest for the wicked yet the virtuous have no pillows
Gerhard Roets
Esteemed Contributor

Re: routing tables on hpux

Hi Antonio

The last "1" in the end is the key to what you are doing. The lower the metric the higher the prcedence of the route.

So it will get the best match ... but if there is two matches it will try the one with the lower metric. If it does not connect it should try the next route in theory.

If it does not find ANY entries it resorts to the default gateway as a lst resort.

Regards
Gerhard
Muthukumar_5
Honored Contributor

Re: routing tables on hpux

1> netstat -rn will give the whole routing table informations. routing will be done destination / network, gateway, interface, and flags informations.

IF you define one route table for destination that will be directed with that gateway. If it's not in the route table entry then it will try to check default settings there. ( It is like * ( wild card redirection ) )

In your settings,
default 10.10.80.7

wild card routing will use 10.10.80.7 gateway there.

10.10.0.0 10.10.80.7

10.10.0.0 network will be using 10.10.80.7 gateway.

10.10.50.0 10.10.80.1

10.10.50.0 network will be using 10.10.80.1 gateway.

10.10.30.22 10.10.70.2
10.10.30.22 host is using 10.10.70.2
gateway.

Important: Based on the routing table / follow up level only routing done.

Please your full netstat -rn informations.


2> We have to put metric count at the end of new route add to make appropriate settings to behave during routing. It may be remote host / gateway etc.. Based on it Flags information on netstat -rn will be set.

See route man page on Flags part.


3> If you are using big network, routing will take some time to do. If you are having small amount of routing clients, then change the netmask there. But your routing informations seems to be in-adequte to give the view on this. Post full netstat -rn output.
Easy to suggest when don't know about the problem!
antonio elder prado
Regular Advisor

Re: routing tables on hpux

Hi guys, thank you all for the examples and explainations. It was very helpful and I will fix the netmaks, and routing tables . once again thank you all.
./antonio/.