2

On FreeBSD 10.1 REL (for both client and server), I'm trying to share certain directories (/etc and /root) via NFSv4 with a specific client.

My /etc/exports -

/etc /root  -ro   -maproot=nobody:nogroup   -network   10.0.200.100/32
V4: /

...this gives two unexpected results: 1) the entire filesystem is mountable 2) from any IP. A similar point was made here for linux but doesn't seem to have been specifically answered.

My [apparently incorrect] understanding was that other directories, e.g. /boot, would not be shared when using this /etc/exports file, and that only a client with IP 10.0.200.100 would be able to mount the share. However, I can mount any directory under the server's root filesystem from any IP that I've tried using this /etc/exports. When running showmount -e, both directories are listed as exported, and running

service nfsd restart
service mountd onereload

...outputs no error messages to /var/log/messages on the server.

EDIT: I got it working based on what I learned here and here. My /etc/exports file layout (above) was incorrect (and what you see above still is incorrect) and some errors were not turning up likely because nfsuserd_flags was not set to -verbose. Also worth mentioning here is the freebsd exports(5) documentation for NFSv4 is sorely lacking and appears to be, in some cases, incorrect.

hotkarl
  • 155
  • 1
  • 10

1 Answers1

1

You have a typo in the first export line. There is a dash in front of the argument after -network. Also check if the network argument makes sense at all. It does not look like a network specification to me.