- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- configuring the starting port number in UX
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
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
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
02-26-2004 08:51 AM
02-26-2004 08:51 AM
Is there a way to configure/specify the starting TCP port number in UX? I'm assuming the programmer wants this configured/specified at the UX level, or maybe he can specify in his code.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2004 08:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2004 09:00 AM
02-26-2004 09:00 AM
Re: configuring the starting port number in UX
I am not sure if I understood your requirement correctly. You can see all the registered ports on the system in /etc/services file.
For user access, the smallest port is 1024. You can get this information from ndd.
ndd -get /dev/tcp tcp_smallest_nonpriv_port
For arbitrary ports, it is
ndd -get /dev/tcp tcp_smallest_anon_port
Use udp instead of tcp in the above for UDP ports.
I wouldn't suggest to reconfigure nonpriv_port to further low. You may play around with the anon-port if you want. But make sure you don't have any ports falling in that range that are being used by your applications before you make the change.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2004 09:04 AM
02-26-2004 09:04 AM
Re: configuring the starting port number in UX
Actually, nowadays there is actually little reason to write socket stuff in C because Perl does it so well and is almost as fast.
Perl's IO::Socket Module works extrememly well.
I attach a small Perl script that sets up a port and calls getservbyname(). Its actually a multi-host semaphore server but it should
illustrate how this works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2004 09:07 AM
02-26-2004 09:07 AM
Re: configuring the starting port number in UX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2004 09:08 AM
02-26-2004 09:08 AM
Re: configuring the starting port number in UX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2004 10:06 AM
02-26-2004 10:06 AM
Re: configuring the starting port number in UX
http://www.fortunecity.com/skyscraper/arpanet/6/cc.htm
If you do not specify the port in your code then on the newer HPUX systems the source port will be selected randomly from the range given in
ndd -get /dev/tcp tcp_smallest_anon_port
and
ndd -get /dev/tcp tcp_largest_anon_port
Older HPUX systems used to start at something like 1025 and use them sequentially but this was thought to make life too easy for hackers so they changed it. For other UNIX versions see:
http://www.ncftpd.com/ncftpd/doc/misc/ephemeral_ports.html
Ron