You may be surprised to learn that if you follow the detailed 136 page instructions for setting up an NFS disk server that Apple provides for the OS X server machines, it won't actually work. The problem is the firewall. Unlike the non-server OS, which has an application firewall, the Server OS uses IPFW, which is port-based not application-based.
This means every service that takes inbound connections has to have fixed port range assignments so you can tell IPFW which port to open. NFS required the RPC deamon, and by default, RPC takes whatever ports are free at the moment and does not keep them fixed. You need to fix these to specific ports by hand because the GUI won't do it.
This can be confusing to diagnose because if you start NFS with the firewall down and then put it up, you find the server continues to work for about 30 minutes, because of pre-existing daemon connections.
The fix is simple but undocumented in the Apple manual, and not possible via the Server Admin GUI: you fix the ports permanently, and then add a rule to the firewall to open those ports.
To fix the ports, you need to add the following lines to the /etc/nfs.conf file on the server. If this file does not exist yet, you need to create it.
# The purpose is to allow firewall ports to be open nfs.lockd.port = 1020 nfs.statd.port = 1021 nfs.server.mount.port = 1022 nfs.server.rquota.port = 1019Those four numbers are chosen as an example; you do not need to choose those, they do not need to be consecutive, they do need to be unused by other services and under 1024. On my machine, those ports are free, and it is very likely they are free on your computer too.
$ rpcinfo -p program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100024 1 udp 1021 status 100024 1 tcp 1021 status 100021 0 udp 1020 nlockmgr 100021 1 udp 1020 nlockmgr 100021 3 udp 1020 nlockmgr 100021 4 udp 1020 nlockmgr 100021 0 tcp 1020 nlockmgr 100021 1 tcp 1020 nlockmgr 100021 3 tcp 1020 nlockmgr 100021 4 tcp 1020 nlockmgr 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100005 1 udp 1022 mountd 100005 3 udp 1022 mountd 100005 1 tcp 1022 mountd 100005 3 tcp 1022 mountd 100011 1 udp 1019 rquotad 100011 2 udp 1019 rquotad
Mac OS X Hints
http://hints.macworld.com/article.php?story=20100219094419683