Operating System - HP-UX
1825759 Members
2138 Online
109687 Solutions
New Discussion

question about netstat (ore traceroute)

 
F Verschuren
Esteemed Contributor

question about netstat (ore traceroute)

Hi when I do a trace route (whitout this -i optoin) it always goes to the first IP adress of netstat -in.
Now We have a tool (I2) that is doing the same ting only the tool does not have the -i option :(
My question is how can I change the sequence
of netstat -in?
so lan901 ore lan 1 in on top...

[]# netstat -in
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan3 1500 192.168.144.0 192.168.144.199 170 0 0 0 0
lan0 1500 130.139.2.0 130.139.2.209 18290 0 0 0 0
lo0 4136 127.0.0.0 127.0.0.1 3046274 0 3046274 0 0
lan900 1500 130.139.1.0 130.139.1.48 1119 0 10 0 0
8 REPLIES 8
Peter Godron
Honored Contributor

Re: question about netstat (ore traceroute)

Hi,
netstat -inI lan1
F Verschuren
Esteemed Contributor

Re: question about netstat (ore traceroute)

hi this doesnot works... The
sequence stays the same...
logging from my "test" system:
[nlscux80:/]# netstat -in
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan3 1500 192.168.144.0 192.168.144.199 5807 0 3 0 0
lan0 1500 130.139.2.0 130.139.2.209 655484 0 12 0 0
lo0 4136 127.0.0.0 127.0.0.1 3052162 0 3052162 0 0
lan900 1500 130.139.1.0 130.139.1.48 37883 0 318 0 0
[nlscux80:/]# netstat -inI lan1
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
[nlscux80:/]# netstat -in
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan3 1500 192.168.144.0 192.168.144.199 5831 0 3 0 0
lan0 1500 130.139.2.0 130.139.2.209 657654 0 12 0 0
lo0 4136 127.0.0.0 127.0.0.1 3052198 0 3052198 0 0
lan900 1500 130.139.1.0 130.139.1.48 38037 0 319 0 0
[nlscux80:/]# netstat -inI lan0
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan0 1500 130.139.2.0 130.139.2.209 658809 0 12 0 0
[nlscux80:/]# netstat -in
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan3 1500 192.168.144.0 192.168.144.199 5846 0 3 0 0
lan0 1500 130.139.2.0 130.139.2.209 659714 0 12 0 0
lo0 4136 127.0.0.0 127.0.0.1 3052198 0 3052198 0 0
lan900 1500 130.139.1.0 130.139.1.48 38171 0 319 0 0
[nlscux80:/]#
spex
Honored Contributor

Re: question about netstat (ore traceroute)

Hi,

# cat ns_reorder.sh

#!/usr/bin/sh

for i in ${@}
do
netstat -in | sed -n "${i}p"
done
exit 0

# ./ns_reorder.sh 1 2 3 4 5
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan3 1500 192.168.144.0 192.168.144.199 170 0 0 0 0
lan0 1500 130.139.2.0 130.139.2.209 18290 0 0 0 0
lo0 4136 127.0.0.0 127.0.0.1 3046274 0 3046274 0 0
lan900 1500 130.139.1.0 130.139.1.48 1119 0 10 0 0

# ./ns_reorder.sh 1 5 3 2 4
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan900 1500 130.139.1.0 130.139.1.48 1119 0 10 0 0
lan0 1500 130.139.2.0 130.139.2.209 18290 0 0 0 0
lan3 1500 192.168.144.0 192.168.144.199 170 0 0 0 0
lo0 4136 127.0.0.0 127.0.0.1 3046274 0 3046274 0 0

PCS
F Verschuren
Esteemed Contributor

Re: question about netstat (ore traceroute)

sorry this is not what I neet, I do not wat the output on my screen,
I neet to make sure that the I2 aplication is using the right lan (and for some resaon it is the same lan that traceroute is using (the top lan of netstat -in.)
I have now checked some systems and it looks like there is a standart sequence.

does anny body know what the sequence is?
lan17??
lan16??
lan3
lan10??
lan2
lan9
lan1
lan8
loO
lan7
lan22 ??
lan21 ??
lan13 ??
lan6
lan5
lan4
spex
Honored Contributor

Re: question about netstat (ore traceroute)

Did you check if your tool is able to take a network interface as an optional argument?

PCS
F Verschuren
Esteemed Contributor

Re: question about netstat (ore traceroute)

jep but no reaction jet...
ps I alsow like to know how apa luns get in the sequence.
rick jones
Honored Contributor

Re: question about netstat (ore traceroute)

IIRC, applications cannot rely on the order of the routing tables. Any that do so are broken. The only thing on which an application can count is that:

matching host routes will take precedence over network routes

and

network routes will take precedence over the default route

An application might be able to influence the interface selected by routing by first binding to a local source IP, and possibly by having the ndd setting ip_strong_es_model set to a value of one or two.

Or by emulating what traceroute does with its -i option.
there is no rest for the wicked yet the virtuous have no pillows
F Verschuren
Esteemed Contributor

Re: question about netstat (ore traceroute)

closed, still waiting on i2...