sudo mount -t nfs -o nfsvers=3 -vvvv 172.31.0.1:/mnt/pool/var_VM_docker /mnt/test
I get:
mount.nfs: timeout set for Mon Apr 15 19:07:11 2024
mount.nfs: trying text-based options 'nfsvers=3,addr=172.31.0.1'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 172.31.0.1 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 172.31.0.1 prog 100005 vers 3 prot UDP port 41067
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 172.31.0.1:/mnt/pool/var_VM_docker
I don't have iptables enabled, nor SELinux.
I've tried exporting it on 127.0.0.1 and connecting it to 127.0.0.1, but the problem persist.
What am I doing wrong?
Did you have NFS working before ? For NFS version 3 and below you will need to have rpcbind running, and years ago that changed the default to listening on 127.0.0.1 on some Linux distributions. Here's a quick search result for NFS4 : https://www.suse.com/support/kb/doc/?id=000019530 And from the best Linux wiki of late : https://wiki.archlinux.org/title/NFS
As an aside, these are the client logs, check the /var/log/ auth.log or secure files or journalctl to see if the server logged why the access was denied.
nfsvers=2 or nfsvers=3 — Specifies which version of the NFS protocol to use. This is useful for hosts that run multiple NFS servers. If no version is specified, NFS uses the highest supported version by the kernel and mount command. This option is not supported with NFSv4 and should not be used.