[SOLVED] How do I specify which port mount (nfs client) uses to tickle my server?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
How do I specify which port mount (nfs client) uses to tickle my server?
I have nfs-server installed and running on my Ubuntu 10.04 server. I have some directories exported. I can connect from my Ubuntu 10.04 PC using the commands
sudo mount taylor10:/data0 /t10/data0
sudo mount taylor10:/data1 /t10/data1
sudo mount taylor10:/data2 /t10/data2
sudo mount taylor10:/data3 /t10/data3
However, when I have my firewall on the PC enabled (Firstarter) I cannot make the mounts. I have ports 111 and 2049 open. If I stop the firewall, do the mounts and then start the firewall I am still mounted to the nfs shares. The connection is on port 2049.
I have observed that when the firewall is enabled and I issue the mount command I get traffic on a random port such as 46694, 37022, etc. I have found instructions regarding editing /etc/default/nfs-common but they seem to control the port the server is listening on, not the port which the client is asking on.
So the question is... how do I lock down the port which mount and/or the nfs client is using to talk to the server to make the initial contact.
I have been to that thread and the links from it a couple or 3 times. It describes what I want to do but only how to do it with a real Linux distro, not Ubuntu. I appreciate the work Canonical has done in making Ubuntu Linux easy to install and use for the average user. However, there is not excuse for breaking things which were already working or changing things just for the sake of change. For example there is no /etc/sysconfig/nfs in Ubuntu. That is where the mountd port is supposed to be specified. I have not found where it is specified in Ubuntu.
I agree with you somewhat in that Ubuntu is a bit 'dumbed-down', but if you feel that way, why are you using it? There are thousands of distros out there to choose from. I personally grew up using a Redhat Linux system, so I usually go with Fedora. Linux is all about freedom, and you (should) be free to choose what you use, no?
So far so good. I added the two ports shown to my allowed ports for nfs in the firewall on the PC. I can now connect to the server. I hope it stays working. Thanks again zootboy. I believe I had already read the links provided but I guess I did not read them "with mathematical understanding" as my math teacher in high school used to say.
If you do go Centos (as your profile implies) you can use nfsv4 (if both ends support it: Centos 5.6 will) which simplifies things as portmap functionality is built into nfsv4 and so portmap on 111 is not needed.
Chap 18 http://www.linuxtopia.org/online_boo...ion/index.html
Again my thanks for all the good information. It finally dawned on me that I should allow my PC, taylor12, to talk to my server, taylor10 regardless of port. I made an outbound rule on the PC to allow it to connect to the server and the random port issue is gone. When/if(?) I migrate to CentOS as the OS on the PC I may rethink the need for the "server". It is simply serving as a large hard drive for data backup over sftp, nfs and samba. I came across a 2 TB USB plugin drive at staples.com this weekend for $80 US. Who needs a power hungry server for 5 TB of storage?