0

I configured the NFS server to allow connections from a /24 subnet.

When I run the showmount -e <nfs-server-ip> on a client the configuration is printed.

When I run rpcinfo -p <nfs-server-ip on a client the following is printed:

program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  45198  status
    100024    1   tcp  60403  status
    100005    1   udp  20048  mountd
    100005    1   tcp  20048  mountd
    100005    2   udp  20048  mountd
    100005    2   tcp  20048  mountd
    100005    3   udp  20048  mountd
    100005    3   tcp  20048  mountd
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    3   tcp   2049  nfs_acl
    100021    1   udp  56117  nlockmgr
    100021    3   udp  56117  nlockmgr
    100021    4   udp  56117  nlockmgr
    100021    1   tcp  46521  nlockmgr
    100021    3   tcp  46521  nlockmgr
    100021    4   tcp  46521  nlockmgr

However, when I try making a temporary mount of the /nfs/myshare on the client I get a mount.nfs: Connection refused error

I have tried enabling the rpcbind on the clients then verifying and discovered this in one of the clients rpcbind.service: Referenced but unset environment variable evaluates to an empty string: RPCBIND_OPTIONS

I have tried experimenting with autofs but feel that my playtime is over...

How can I get the temporary mount to work as expected?

7
  • I am running fedora 39 for the client on linux kernel 6.6
    – Parsa Loi
    Commented Apr 24 at 18:36
  • What version of NFS is the client connecting with? Is the firewall allowing the connection through? Commented Apr 24 at 18:41
  • 2.6.4-1 version, I disabled the firewall
    – Parsa Loi
    Commented Apr 24 at 18:50
  • I was looking for the version of the NFS protocol you are attempting to connect with. This should be either NFSv3 or NFSv4. NFSv4 has simplified the connection and does not require all the RPC services. Since you have disabled the firewall, you should post the NFS export configuration to be able to troubleshoot further. Also post any available NFS logs from the client and the server. Commented Apr 24 at 18:58
  • Export list for <nfs-server-ip>: /nfs/exports/parsazshare 10.130.138.1/24 is the export configuration
    – Parsa Loi
    Commented Apr 24 at 19:41

1 Answer 1

0

on the nfs server:

  • service firewalld stop
  • /etc/exports :
    • /data *(rw,no_root_squash) syntax spacing is important here
    • get it working with * first then get fancy with restricting ip addresses
    • make sure everything is commented out in /etc/nfs.conf; use the default setup, my experience has been when you start tweaking is when it is most prone to failure.
    • exportfs -s to confirm export

on the nfs client:

  • service firewalld stop
  • /etc/nfs.conf and /etc/nfsmount.conf is all commented out, use the default setup.
  • mount 192.168.1.1:/data /nfsshare/data
    • you don't need an entry in /etc/fstab to mount
    • *with a successful mount, reference /etc/mtab for the correct syntax to put into /etc/fstab to make the mount happen on boot.

I'm not familiar with Fedora versions, but if it corresponds to RHEL-7 or later then all you need for firewalld is this in the xml file:

<port protocol="tcp" port="2049"/>

For RHEL-7 it will connect as nfs vers=4.1 and for RHEL-8 as vers=4.2, and proto=tcp. I have found nfs to be reliable and easy with RHEL-8 when not modifying anything in /etc/nfs.conf and attempting to use different port numbers.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .