What services and ports are required for NFSv4?

I've been trying to find the definitive answer to this question, but I'm getting conflicting results due to various NFS versions out there.

I've configured NFSv4 by following https://help.ubuntu.com/community/NFSv4Howto and currently have the following services running on my machine:

  • rpc.mountd
  • rpcbind
  • nfsd
  • lockd

Which of these are required to run an NFS server in v4 only? How do I disable the rest? Consequently, which ports should I open on my firewall?

PS: I'm on Ubuntu 18.04


Solution 1:

Only rpc.mountd and nfsd are required to be running for NFSv4.

NFSv4 runs on TCP port 2049. The NFS server must accept incoming connections on this port. Unlike previous versions of NFS, this is the only port that is required.