1834714 Members
2434 Online
110069 Solutions
New Discussion

Reg port opening

 
SOLVED
Go to solution
boomer_2
Super Advisor

Reg port opening

Hi guys,
I need to open/check atleast 50 ports..for my application .how will i come to know which port is open and how should i open it from o/s i.e HPUX end ? i think ports r to be opened from firewall right ?

my netstat - na|grep LISTEN shows

# netstat -na|grep LISTEN
tcp 0 0 *.3391 *.* LISTEN
tcp 0 0 10.1.4.19.1521 *.* LISTEN
tcp 0 0 *.135 *.* LISTEN
tcp 0 0 127.0.0.1.49169 *.* LISTEN
tcp 0 0 *.2301 *.* LISTEN
tcp 0 0 *.4755 *.* LISTEN
tcp 0 0 *.852 *.* LISTEN
tcp 0 0 *.544 *.* LISTEN
tcp 0 0 *.543 *.* LISTEN
tcp 0 0 *.1234 *.* LISTEN
tcp 0 0 *.6668 *.* LISTEN
tcp 0 0 *.515 *.* LISTEN
tcp 0 0 *.1249 *.* LISTEN
tcp 0 0 *.6667 *.* LISTEN
tcp 0 0 192.168.0.62.5300 *.* LISTEN
tcp 0 0 *.1521 *.* LISTEN
tcp 0 0 *.49348 *.* LISTEN
tcp 0 0 *.643 *.* LISTEN
tcp 0 0 *.49188 *.* LISTEN
tcp 0 0 *.2049 *.* LISTEN
tcp 0 0 *.111 *.* LISTEN
tcp 0 0 *.49156 *.* LISTEN
tcp 0 0 *.4045 *.* LISTEN
tcp 0 0 *.49155 *.* LISTEN
tcp 0 0 *.1508 *.* LISTEN
tcp 0 0 *.6666 *.* LISTEN
tcp 0 0 *.1241 *.* LISTEN
tcp 0 0 *.2148 *.* LISTEN
tcp 0 0 *.991 *.* LISTEN
tcp 0 0 *.1246 *.* LISTEN
tcp 0 0 *.5303 *.* LISTEN
tcp 0 0 *.49172 *.* LISTEN
tcp 0 0 *.2121 *.* LISTEN
tcp 0 0 *.10864 *.* LISTEN
tcp 0 0 *.5302 *.* LISTEN
tcp 0 0 127.0.0.1.1476 *.* LISTEN
tcp 0 0 192.168.0.62.5301 *.* LISTEN
tcp 0 0 *.22 *.* LISTEN
tcp 0 0 *.49157 *.* LISTEN
tcp 0 0 *.5555 *.* LISTEN
tcp 0 0 *.49153 *.* LISTEN
tcp 0 0 127.0.0.1.49163 *.* LISTEN
tcp 0 0 *.49152 *.* LISTEN
tcp 0 0 *.49154 *.* LISTEN
tcp 0 0 *.6112 *.* LISTEN
tcp 0 0 *.7815 *.* LISTEN
tcp 0 0 *.901 *.* LISTEN
tcp 0 0 *.5989 *.* LISTEN
tcp 0 0 127.0.0.1.7161 *.* LISTEN
tcp 0 0 *.49557 *.* LISTEN
tcp 0 0 *.49560 *.* LISTEN
tcp 0 0 *.37 *.* LISTEN
tcp 0 0 *.7 *.* LISTEN
tcp 0 0 *.9 *.* LISTEN
tcp 0 0 *.19 *.* LISTEN
tcp 0 0 *.113 *.* LISTEN
tcp 0 0 *.13 *.* LISTEN
tcp 0 0 *.513 *.* LISTEN
tcp 0 0 *.514 *.* LISTEN
tcp 0 0 *.512 *.* LISTEN
tcp 0 0 *.21 *.* LISTEN
tcp 0 0 *.49924 *.* LISTEN
tcp 0 0 *.56420 *.* LISTEN
tcp 0 0 *.1712 *.* LISTEN
tcp 0 0 *.49352 *.* LISTEN
tcp 0 0 *.22 *.* LISTEN
tcp 0 0 *.10864 *.* LISTEN
tcp 0 0 *.37 *.* LISTEN
tcp 0 0 *.7 *.* LISTEN
tcp 0 0 *.9 *.* LISTEN
tcp 0 0 *.19 *.* LISTEN
tcp 0 0 *.113 *.* LISTEN
tcp 0 0 *.13 *.* LISTEN
tcp 0 0 *.513 *.* LISTEN
tcp 0 0 *.514 *.* LISTEN
tcp 0 0 *.512 *.* LISTEN
tcp 0 0 *.21 *.* LISTEN
tcp 0 0 *.49924 *.* LISTEN
tcp 0 0 *.56420 *.* LISTEN
tcp 0 0 *.1712 *.* LISTEN
tcp 0 0 *.49352 *.* LISTEN
tcp 0 0 *.22 *.* LISTEN
tcp 0 0 *.10864 *.* LISTEN


and i need atleast 50 ports to be free..

h/w rx4640,8gb ram,hpux 11i v2.....
3 REPLIES 3
Sandman!
Honored Contributor
Solution

Re: Reg port opening

lsof is probably a better tool to use for determining whether a range of ports is open for use. netstat can tell you also but is cumbersome to use as there's no way to specify a range of ports:

To find out if ports 40,000 - 40,050 are in use on a particular server:

# lsof -i@hostname:40000-40050
Rasheed Tamton
Honored Contributor

Re: Reg port opening

Hi boomer,

Anything in the "LISTEN" state are the opened ports on the netstat command output you used above.


from the OS side the file for the ports and servicesis /etc/services. Just look it and you can see how the ports and protocol/service are already defined there. To find open ports that are not listed in /etc/services then use the lsof command as Sandman told.


man services


If you have a firewall you have to open the ports from firewall side also.
boomer_2
Super Advisor

Re: Reg port opening

Thanx sandman and rasheed ...i have installed lsof utility