I have to use NFS behind a NAT so I decided to try NFSv4 since traversing NAT with NFSv3 is not possible. On the server I have the following configuration in /etc/exports:
Code:
/export *(rw,fsid=root,insecure,no_subtree_check,async,all_squash)
/export/test *(rw,nohide,insecure,async,no_subtree_check)
On the client I give
Code:
mount -t nfs4 -o tcp nfs4_server:/test /mnt/test
The problem is that the above command works just fine when the client is directly connected in the same network as the server, but it doesn't work when the client is connected via NAT (the configuration of client is otherwise the same). It fails with the following error:
Code:
mount.nfs4: Operation not permitted
So the problem seems to be caused by NAT.
This seems strange to me: in NFSv4, the client establishes a single outbound tcp connection to the server (on the remote port 2049). Why is NAT causing a problem to that? After all, I can successfully establish this tcp connection using netcat.