Solved

Can I reserve a port in Linux

Posted on 2011-09-28
6
1,020 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to specify rdns for multi-homed mail server 5 79
Linux FTP Error 5 44
python - find anything after $ question. 9 46
mounting drive a in a linux 14 35
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

740 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