- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to find a free port to use
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2004 11:47 PM
тАО12-06-2004 11:47 PM
how to find a free port to use
Im trying to help a customer to use an application that want to use port 10000.
I looked in /etc/services and find that the port is busy. How should i find a port that are free to use for an application?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2004 11:51 PM
тАО12-06-2004 11:51 PM
Re: how to find a free port to use
Use
# netstat -a
To see which port are in use.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2004 11:55 PM
тАО12-06-2004 11:55 PM
Re: how to find a free port to use
Maybe a dumb question but is it free to use any port that are not in netstat -a?
How do i lock that port to the application?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2004 01:06 AM
тАО12-07-2004 01:06 AM
Re: how to find a free port to use
netstat -a will give you used ports.
Once your program is launched, it opens the port. No other program will then be able to open the port. It is a kind of lock.
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2004 01:56 AM
тАО12-07-2004 01:56 AM
Re: how to find a free port to use
and thanks for your explanation.
The application wanted port 10000 and its not in use when i look in netstat -a.
But still its give a error message.
I tried to telnet to port 10000 and 10001 and it gives connection refused. Shouldnt that work?
//Anders
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2004 02:12 AM
тАО12-07-2004 02:12 AM
Re: how to find a free port to use
http://www.iana.org/assignments/port-numbers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2004 02:33 AM
тАО12-07-2004 02:33 AM
Re: how to find a free port to use
Don't your application offers you a way to configure which port it is listening to ?
Isn't there a log to see why it does not listen on 10000 once launched ?
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2004 03:00 AM
тАО12-07-2004 03:00 AM
Re: how to find a free port to use
"lsof" will also show ports used, if you have it. You can get it from one of the "porting centers" (I could look it up for you...)
You should use "netstat -a" to identify the "generally used" ports on your system, then pick a port that is:
a. Not used in netstat -a
b. Not listed in /etc/services.
Then, after testing, you should edit /etc/services to put your new port in it, so the next SA will know what is going on.
Ports below 1024 are reserved for hp-ux.
Many programs, such as ftp and nfs, pick random unused ports to use for short periods, and then release them. They may have ranges within which they pick.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-07-2004 07:36 AM
тАО12-07-2004 07:36 AM
Re: how to find a free port to use
The Well Known Ports are those from 0 through 1023.
The Registered Ports are those from 1024 through 49151
The Dynamic and/or Private Ports are those from 49152 through 65535
Your vendor should make use of an open port on your system above 49151.
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2004 01:03 AM
тАО12-08-2004 01:03 AM
Re: how to find a free port to use
For your explanation, its more clear to me now!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2004 01:28 AM
тАО12-08-2004 01:28 AM
Re: how to find a free port to use
http://www.iana.org/assignments/port-numbers
for uses other than listed.
That being said webmin uses 10000 by default
but it is now registered for other uses.
Oracle traditionally uses port 1521, which
is registered otherwise.
If you are sure the registered service won't
be installed on the server. Then there is
no strong reason not to use that port.
However, it is good practice to avoid using
ports assigned to well-known services such
as WWW, HTTPS, SMTP, and other services
covered by the RFCs for services other than
intended. Likewise, these services should
be run on their assigned ports.
On unix ports 0-1024 are restricted to use by
programs started by root. This are generally
trusted ports. Windows and other OSs don't
follow this restriction, so you can no longer
count on connections on these ports being
blessed by a sys admin.
As noted add the port usage to your
/etc/services file. You may also want to
have an extra .local or .patch file to retain
the changes if the file gets upgraded.
Comment out the original assignment if reusing the port.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2004 03:27 AM
тАО12-08-2004 03:27 AM
Re: how to find a free port to use
If you get a connection refused when you try to telnet to those port numbers on the server, it suggests one or more of:
*) application is not actually running
*) application's attempt to create the listen endpoint failed
*) inetd.sec isn't allowing the connection
*) someother nasty firewall hasn't had those ports opened
*) whatever else I've forgotten
The official port ranges have been given - some of the historical was that the anonymous/ephemperal ports started at 5000 (or was it 5001). Either way, your app vendor should have a mechanism for you to choose the port, and they should obtain a registered port number.