Solved

Can I reserve a port in Linux

Posted on 2011-09-28
6
768 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now