LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices

Reply
 
Search this Thread
Old 07-03-2011, 09:02 AM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,190

Rep: Reputation: 96
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
Quote:
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.

TIA,

Ken
 
Old 07-03-2011, 10:19 AM   #2
zootboy
Member
 
Registered: Nov 2008
Location: In a dumpster, with my laptop.
Distribution: Fedora
Posts: 124

Rep: Reputation: 25
http://www.linuxquestions.org/questions/linux-security-4/firewall-blocking-nfs-even-though-ports-are-open-294069/

Check this thread out. See if out can help you.
 
1 members found this post helpful.
Old 07-03-2011, 12:29 PM   #3
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,190

Original Poster
Rep: Reputation: 96
Thanks zootboy,

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.

Ken
 
Old 07-03-2011, 03:28 PM   #4
zootboy
Member
 
Registered: Nov 2008
Location: In a dumpster, with my laptop.
Distribution: Fedora
Posts: 124

Rep: Reputation: 25
According to this page:
http://www.cyberciti.biz/faq/how-to-...uration-howto/
you need the 'portmap' package installed. Do you?
Also, here's a link I found from an Ubuntu forum:
http://lists.netfilter.org/pipermail...ry/058350.html

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?
 
1 members found this post helpful.
Old 07-03-2011, 04:07 PM   #5
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,190

Original Poster
Rep: Reputation: 96
Yes zootboy, I have those 3 packages installed on my server. From the second link I tried this
Quote:
ken@taylor10:~$ rpcinfo -p localhost|grep "mount"|grep "tcp"|tr ' ' '\n'|grep -v "mount"|tail -n 2|head -n 1
37022
which is th port I had seen in the firewall event list. Expanding that I find
Quote:
ken@taylor10:~$ rpcinfo -p localhost

100005 1 udp 50341 mountd
100005 1 tcp 37022 mountd
100005 2 udp 50341 mountd
100005 2 tcp 37022 mountd
100005 3 udp 50341 mountd
100005 3 tcp 37022 mountd
so perhaps if I allow these ports in the firewall on the PC and see what happens.

Ken
 
Old 07-03-2011, 04:16 PM   #6
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,190

Original Poster
Rep: Reputation: 96
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.

Ken
 
Old 07-03-2011, 07:06 PM   #7
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Basically, for NFS you need to open the privileged ports 111 & 2049 on the server INPUT FW rule set.
See /etc/services.

On the client, it picks a random nonpriv port (>1023) to connect to the server. In this case, this is the OUTPUT FW rule set on the client.

HTH
 
1 members found this post helpful.
Old 07-04-2011, 08:06 AM   #8
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,190

Original Poster
Rep: Reputation: 96
Thanks chrism01. It is those random ports which are causing me the issue. I will just have to keep on top of them each time they change.

Ken
 
Old 07-04-2011, 06:51 PM   #9
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
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
 
1 members found this post helpful.
Old 07-05-2011, 07:09 AM   #10
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6 on my desktop, Ubuntu 12.04 LTS on my server, Ubuntu 12.04 on my netbook and the wife's PC
Posts: 1,190

Original Poster
Rep: Reputation: 96
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?

Ken
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] NFS mount fails (times out): NFS server is in DMZ, NFS client is in intranet Hiroshi Linux - Networking 2 05-24-2010 10:22 AM
Unable to mount NFS share present on server to client vathsan AIX 1 11-10-2008 11:19 PM
nfs client does not mount server-shares automatically on boot rsp Debian 2 07-29-2007 07:26 AM
NFS server - client cannot mount remote file system mikemrh9 Linux - Networking 6 10-12-2006 11:05 PM
how to mount a nfs mount from linux client to AIX nfs server dennyqian AIX 8 09-22-2006 03:34 AM


All times are GMT -5. The time now is 03:19 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration