<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: netstat output and range of free ports in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488455#M652989</link>
    <description>&lt;!--!*#--&gt;&amp;gt; since UNIX domain sockets are not IP&lt;BR /&gt;&amp;gt; sockets , so does the output above implies&lt;BR /&gt;&amp;gt; that port from 42000-43000 are free.&lt;BR /&gt;&lt;BR /&gt;It would seem to, if your script works.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Also how will i free this range of scoket ,&lt;BR /&gt;&amp;gt; kill the PID ?I cannot see any PIDs&lt;BR /&gt;&lt;BR /&gt;If no one is using a socket, then what do you&lt;BR /&gt;want to kill?</description>
    <pubDate>Mon, 31 Aug 2009 12:44:13 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2009-08-31T12:44:13Z</dc:date>
    <item>
      <title>netstat output and range of free ports</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488445#M652979</link>
      <description>Dear Gurus, &lt;BR /&gt;Here's a small programm that i intend to use to find a list of free port:&lt;BR /&gt;# more testport&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;#set -x&lt;BR /&gt;no=$1&lt;BR /&gt;echo $1&lt;BR /&gt;fin=`expr ${no} + 1000`&lt;BR /&gt;echo $fin&lt;BR /&gt;while test $no -le $fin&lt;BR /&gt;do&lt;BR /&gt;#echo $no&lt;BR /&gt;netstat -an | grep $no&lt;BR /&gt;test=`echo $?`&lt;BR /&gt;#if [$test =! 1];then&lt;BR /&gt;#echo "PORT NUMBER $n PORT NOTFREE"&lt;BR /&gt;#fi&lt;BR /&gt;no=`expr $no + 1`&lt;BR /&gt;done&lt;BR /&gt;So , for a range of free ports (required by application) i should not get any o/p.For ports being used it will show o/p:&lt;BR /&gt;&lt;BR /&gt;Active UNIX domain sockets&lt;BR /&gt;Address          Type   Recv-Q Send-Q            Inode             Conn             Refs          Nextref Addr&lt;BR /&gt;e000000536710080 dgram       0      0 e0000004ac3bdc80                0                0                0 /var/spool/sockets/pwgr/client27200&lt;BR /&gt;e0000004e7060080 dgram       0      0 e0000004c420f880                0                0                0 ../wo&lt;BR /&gt;&lt;BR /&gt;1)need help to understand the above netstat  o/p better.How can i know what is the port number in above o/p.pardon my meager knowledge.&lt;BR /&gt;2)Out of 65000 + ports , i am not able to find a continous range of 1000 ports free , any better program.&lt;BR /&gt;lsof is ok but it takes time to scan 1000 ports(after putting that in loop)</description>
      <pubDate>Sun, 30 Aug 2009 13:47:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488445#M652979</guid>
      <dc:creator>DeafFrog</dc:creator>
      <dc:date>2009-08-30T13:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: netstat output and range of free ports</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488446#M652980</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;It's probably easier to use 'lsof' rather than 'netstat' to snapshot the ports currently in use at any time.&lt;BR /&gt;&lt;BR /&gt;That said, what you see is indeed at that moment and might change in another sample interval.&lt;BR /&gt;&lt;BR /&gt;As for 'netstat' you can see inuse ports in the following snippet:&lt;BR /&gt;&lt;BR /&gt;tcp        0     52  10.xxx.xxx.xxx.22       10.xxx.xxx.xxx.1086     ESTABLISHED&lt;BR /&gt;&lt;BR /&gt;Here, port #22 on the server and port #1086 on the client have formed a connection.&lt;BR /&gt;&lt;BR /&gt;I don't quite understand why you think you need "a continous range of 1000 ports free".  Your application (as the server side) should likely need only one.&lt;BR /&gt;&lt;BR /&gt;As background:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.iana.org/assignments/port-numbers" target="_blank"&gt;http://www.iana.org/assignments/port-numbers&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers" target="_blank"&gt;http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;All of the above aside, you could also vastly improve the run time of scripts like you posted by _avoiding_ the use of 'expr' to simply increment a counter.  You are spawning a separate process very time you do and this is quite expensive!&lt;BR /&gt;&lt;BR /&gt;Instead of:&lt;BR /&gt;&lt;BR /&gt;# no=`expr $no + 1`&lt;BR /&gt;&lt;BR /&gt;do:&lt;BR /&gt;&lt;BR /&gt;# ((no+=+1))&lt;BR /&gt;&lt;BR /&gt;The later lets the shell do the arithmetic and therefore eliminates process creation merely to do so.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Sun, 30 Aug 2009 14:16:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488446#M652980</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-08-30T14:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: netstat output and range of free ports</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488447#M652981</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Quality Assurance check.&lt;BR /&gt;&lt;BR /&gt;From outside the system.&lt;BR /&gt;&lt;BR /&gt;nmap hostname (best run from a Linux host)&lt;BR /&gt;&lt;BR /&gt;nmap is a port scanner and you may wish to get permission prior to running it.&lt;BR /&gt;&lt;BR /&gt;Show what ports externally are open, though this will only show ports with active listeners, which can be hidden with firewalls.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Sun, 30 Aug 2009 14:40:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488447#M652981</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-08-30T14:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: netstat output and range of free ports</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488448#M652982</link>
      <description>Thanks James and Steven , &lt;BR /&gt;                          I want to understand this line in the output of netsta -an :&lt;BR /&gt;Address          Type   Recv-Q Send-Q            Inode             Conn             Refs          Nextref Addr&lt;BR /&gt;e000000536710080 dgram       0      0 e0000004ac3bdc80                0                0                0 /var/spool/sockets/pwgr/client27200........how can i  find the port number, from this line, is it refering to any port , if yes whad is that port .&lt;BR /&gt;&lt;BR /&gt;Regards , &lt;BR /&gt;Rahul  &lt;BR /&gt;</description>
      <pubDate>Sun, 30 Aug 2009 16:32:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488448#M652982</guid>
      <dc:creator>DeafFrog</dc:creator>
      <dc:date>2009-08-30T16:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: netstat output and range of free ports</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488449#M652983</link>
      <description>Hi (again) Rahul:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I want to understand this line in the output of netsta -an :&lt;BR /&gt;Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr&lt;BR /&gt;&lt;BR /&gt;See here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/sockets.html" target="_blank"&gt;http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/sockets.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sun, 30 Aug 2009 16:40:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488449#M652983</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-08-30T16:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: netstat output and range of free ports</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488450#M652984</link>
      <description>Many Thanks James , &lt;BR /&gt;In the o/p above the domain socket address is "e000000536710080" which may be used as an IPC for a service in application(frm the URL that you helped me with ).To my understanding socket = ip + port number.can you please let me know how to break up "e000000536710080" in ip + port number fasion( not sure if my understanding is OK).&lt;BR /&gt;&lt;BR /&gt;Regards , &lt;BR /&gt;Rahul</description>
      <pubDate>Sun, 30 Aug 2009 17:05:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488450#M652984</guid>
      <dc:creator>DeafFrog</dc:creator>
      <dc:date>2009-08-30T17:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: netstat output and range of free ports</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488451#M652985</link>
      <description>&amp;gt;can you please let me know how to break up "e000000536710080" in ip + port number fashion&lt;BR /&gt;&lt;BR /&gt;These look like kernel virtual addresses.  Unless you have a memory dump or use adb(1), you can only treat them as IDs/keys.</description>
      <pubDate>Sun, 30 Aug 2009 17:36:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488451#M652985</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-08-30T17:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: netstat output and range of free ports</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488452#M652986</link>
      <description>&lt;!--!*#--&gt;&amp;gt; Active UNIX domain sockets&lt;BR /&gt;&lt;BR /&gt;UNIX domain sockets are not IP sockets, so&lt;BR /&gt;they do not involve IP ports, so they also&lt;BR /&gt;do not involve IP port numbers.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] a range of free ports (required by&lt;BR /&gt;&amp;gt; application) [...]&lt;BR /&gt;&lt;BR /&gt;Why do you think that this (nameless)&lt;BR /&gt;application requires "a range of free ports"?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] i am not able to find a continous&lt;BR /&gt;&amp;gt; range of 1000 ports free&lt;BR /&gt;&lt;BR /&gt;Really?  And even if that were true, then why&lt;BR /&gt;would you care?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] lsof is ok but it takes time to scan&lt;BR /&gt;&amp;gt; 1000 ports(after putting that in loop)&lt;BR /&gt;&lt;BR /&gt;Perhaps running lsof (or netstat) 1000 times&lt;BR /&gt;is not the best way to solve this problem.&lt;BR /&gt;(But I doubt that you really need to solve&lt;BR /&gt;it.)&lt;BR /&gt;&lt;BR /&gt;Is there some actual problem which you are&lt;BR /&gt;trying to solve?  If so, perhaps you should&lt;BR /&gt;ask about that problem, rather than asking&lt;BR /&gt;about how to implement some sub-ideal method&lt;BR /&gt;to solve the wrong problem.</description>
      <pubDate>Mon, 31 Aug 2009 01:13:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488452#M652986</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-08-31T01:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: netstat output and range of free ports</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488453#M652987</link>
      <description>Dear Steven, I have attached a notepad here.It list all ports being used &lt;BR /&gt;with the above testport script(from 2000-65000).Also an Excerpt from application installtion&lt;BR /&gt;manual ...:"Enter the starting port number from which the tool will start configuring rest of the Finacle  Application Services. Make sure that around 1000 port number from the above port are free and that no other application is listening on to this port.".&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;# ./testport 42000&lt;BR /&gt;42000&lt;BR /&gt;43000&lt;BR /&gt;e000000591297680 dgram       0      0 e0000004fc242700                0                0                0 /var/spool/sockets/pwgr/client5069&lt;BR /&gt;e00000046aa00680 dgram       0      0 e0000004ac342800                0                0                0 /var/spool/sockets/pwgr/client1939&lt;BR /&gt;e000000428eee380 stream      0      0 e000000428787580                0                0                0 /etc/useracct/utmpd_read&lt;BR /&gt;e000000429672980 dgram       0      0 e000000428799100                0                0                0 /dev/log.un&lt;BR /&gt;e000000471075680 dgram       0      0 e000000428799e80                0                0                0 /var/spool/sockets/pwgr/client16736&lt;BR /&gt;e00000055f1a7080 dgram       0      0 e000000428817b80                0                0                0 /var/spool/sockets/pwgr/client27140&lt;BR /&gt;e00000053b61d680 dgram       0      0 e000000429164680                0                0                0 /var/spool/sockets/pwgr/client6303&lt;BR /&gt;e000000506a4d380 dgram       0      0 e00000042941e800                0                0                0 /var/spool/sockets/pwgr/client17883&lt;BR /&gt;e000000429460080 stream      0      0                0 e00000042b8c7180                0                0&lt;BR /&gt;e000000429460380 stream      0      0                0 e00000042b8c7100                0                0&lt;BR /&gt;e000000429460680 dgram       0      0 e00000042b86b700                0                0                0 /var/spool/sockets/pwgr/client2198&lt;BR /&gt;e000000429460c80 dgram       0      0 e000000468b86880                0                0                0 /var/spool/sockets/pwgr/client2412&lt;BR /&gt;e000000429672380 stream      0      0 e00000042b718500                0                0                0 /var/evm/sockets/evmd&lt;BR /&gt;e000000429672680 dgram       0      0 e00000042b7b2980                0                0                0 /var/spool/sockets/pwgr/client1530&lt;BR /&gt;e000000429672980 dgram       0      0 e000000428799100                0                0                0 /dev/log.un&lt;BR /&gt;e000000468de3080 stream      0      0                0 e000000429675300                0                0&lt;BR /&gt;e000000468c65400 stream      0      0                0 e000000429675380                0                0&lt;BR /&gt;e000000468c65a00 stream      0      0                0 e000000429675280                0                0 /tmp/.s.PGSQL.10864&lt;BR /&gt;e000000468c65d00 stream      0      0                0 e000000429675200                0                0 /var/evm/sockets/evmd&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;since UNIX domain sockets are not IP sockets , so does the output above implies that port from 42000-43000 are free.&lt;BR /&gt;since in the  output there are no IP socket .Also how will i free this range of scoket , kill the PID ?I cannot see any PIDs&lt;BR /&gt;&lt;BR /&gt;# ps -ef | grep -i "/var/evm/sockets/evmd"&lt;BR /&gt;    root  5533  8896  0 09:46:32 pts/3     0:00 grep -i /var/evm/sockets/evmd&lt;BR /&gt;# ps -ef | grep -i "/var/spool/sockets/pwgr/client2412"&lt;BR /&gt;    root  5537  8896  0 09:48:43 pts/3     0:00 grep -i /var/spool/sockets/pwgr/client2412&lt;BR /&gt;# ps -ef | grep -i "/var/spool/sockets/pwgr/client1530"&lt;BR /&gt;    root  5539  8896  1 09:48:58 pts/3     0:00 grep -i /var/spool/sockets/pwgr/client1530&lt;BR /&gt;&lt;BR /&gt;Thanks and Regards ,&lt;BR /&gt;Rahul</description>
      <pubDate>Mon, 31 Aug 2009 04:54:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488453#M652987</guid>
      <dc:creator>DeafFrog</dc:creator>
      <dc:date>2009-08-31T04:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: netstat output and range of free ports</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488454#M652988</link>
      <description>maybe better approach is to use a Perl port scanner program to find out which port is open or not: also you can add an wrapper to check any range of ports:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;# Port Scanner with PERL&lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt; echo From Port&lt;BR /&gt; read prt1&lt;BR /&gt; echo To Port&lt;BR /&gt; read prt2&lt;BR /&gt; echo IP&lt;BR /&gt; read ip&lt;BR /&gt;&lt;BR /&gt;# Init Log File step&lt;BR /&gt;&amp;gt;/tmp/port_check.$ip &amp;gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;while [ $prt1 -lt $prt2 ]&lt;BR /&gt;  do&lt;BR /&gt;  echo $ip:$prt1 &amp;gt;&amp;gt; /tmp/port_check.$ip&lt;BR /&gt;  /aydin/chk_rem_port $ip $prt1 &amp;gt;&amp;gt; /tmp/port_check.$ip&lt;BR /&gt;  wait&lt;BR /&gt;  prt1=$(($prt1+1))&lt;BR /&gt;  done&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Aug 2009 05:19:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488454#M652988</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2009-08-31T05:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: netstat output and range of free ports</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488455#M652989</link>
      <description>&lt;!--!*#--&gt;&amp;gt; since UNIX domain sockets are not IP&lt;BR /&gt;&amp;gt; sockets , so does the output above implies&lt;BR /&gt;&amp;gt; that port from 42000-43000 are free.&lt;BR /&gt;&lt;BR /&gt;It would seem to, if your script works.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Also how will i free this range of scoket ,&lt;BR /&gt;&amp;gt; kill the PID ?I cannot see any PIDs&lt;BR /&gt;&lt;BR /&gt;If no one is using a socket, then what do you&lt;BR /&gt;want to kill?</description>
      <pubDate>Mon, 31 Aug 2009 12:44:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/netstat-output-and-range-of-free-ports/m-p/4488455#M652989</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-08-31T12:44:13Z</dc:date>
    </item>
  </channel>
</rss>

