Mounting an NFS volume on RHEL 5 Thru the Firewall
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Mounting an NFS volume on RHEL 5 Thru the Firewall
I'm running two RHEL 5 Servers both have firewall enabled. I'm trying to mount a NFS volume from one server to the other thru the firewall. I've created and entry in the iptables opening up port 2049 for TCP access only. The documentation for RHEL 5 server states that NFSv4 no longer uses port mapper but uses tcp thru port 2049.
Below the results of "exportfs -v":
/var/DownLoads <world>(rw,nohide,insecure,no_root_squash,no_subtree_check, fsid=0,anonuid=65534,anongid-65534)
Below in the mount command that I used:
mount -t nfs4 -v 192.168.10.7:/var/DownLoads testmount
Results of the above command:
mount: pinging: prog 100003 vers 4 prot tcp port 2049
mount.nfs4: mount point /root/testmount does not exist
I don't understand why the message is appearing because I'm logged on as "root" and the mount point/directory does exist. I've re-created it several times and continue to get the same results.
I've drop the firewall on the server that I'm trying to peform the mount on and the results are the same. "SELinux" is disabled on both systems.
well with nfs versions before version 4 you need both allowed thru firewall
nfs :TCP port 2049
nfs :UDP port 2049
port mapper :TCP port 111
port mapper :UDP port 111
So for CentOS/Redhat/Fedora something like: (you might want to filter source IP's)
in /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp --dport 2049 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp --dport 2049 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp --dport 111 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp --dport 111 -j ACCEPT
I believe UDP is the default protocol NFS will use
You can run tcpdump on the server then try mounting to give you some info
That should work.....
I still want to figure out this nfsv4 issue though.
I've drop the firewall on the server that I'm trying to peform the mount on and the results are the same. "SELinux" is disabled on both systems.
Does anyone have any ideas?
Thanks
Don't know if you got the answer yet but NFS4 is not like 2 or 3. It will provide service as a root filesystem. So in your mount line, simply remove the path information past the first "/"
mount -t nfs4 <address>:/ /dev/testmount or whatever and it will mount.
The error messages that mount issues are confusing.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.