Solved

Can I reserve a port in Linux

Posted on 2011-09-28
6
967 Views
Last Modified: 2012-05-12
Can I reserve a port for a application so other application should ignore it?

Let me tell you the scenerio:
On few Linux server an application is not listening on port 1002 because we are mounting 50+ nfs shares through the fstab file and one remote connection is using this port.

netstat -natp | grep "1002"
tcp        0      0 xx.xx.xx.xx:1002            xx.xx.xx.xx:2049            ESTABLISHED -

Could anybody suggest me a way through remote nfs share can ignore the 1002 so that my application work perfectly.

0
Comment
Question by:upanwar
6 Comments
 
LVL 23

Expert Comment

by:savone
ID: 36718025
I am guessing you can start the application BEFORE you mount the nfs shares and that should do it.

0
 
LVL 12

Author Comment

by:upanwar
ID: 36718071
Hey savone,

Thanks for your reply. While rebooting It will read the fstab file fisrt and then will start the services for selected run level.

Any other way to reserve port. I guess I can define in /etc/services but will it work? Have anybody tried before?

0
 
LVL 8

Expert Comment

by:eager
ID: 36816098
Do you need all NFS mounts to happen at boot-up?  If not, you might look at using automount to mount the NFS file systems when you access them.  See info on "autofs".  
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 34

Accepted Solution

by:
Duncan Roe earned 500 total points
ID: 37005562
You cannot do this. Ports above 1000 are up for grabs, and assigned sequentially. Either make your application privileged so it can use a port below 1000 or have it use a much higher port number. Many high port numbers are in fact reserved - see assigned numbers but for the most part you can ignore these.
0
 
LVL 12

Author Comment

by:upanwar
ID: 37006128
Hi Duncan,

I already gave it a try... but I will try it again and let you know... the way you suggested is something what which I was looking.

I appriciate it.

0
 
LVL 12

Author Closing Comment

by:upanwar
ID: 37466283
This solution given me a idea but I couldn't implement it. I have opened a case with HP for the same.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question