How to set NFS export to allow 192.168.1.x

Hi, I'm doing performing an NFS mount via ZFS:
zfs set sharenfs="-mapall=daniel 192.168.1.5" zroot/work

However, what if I want all machines on the 192.168.1.x network to be able to mount it as opposed to just .5?

I've tried the following:

zfs set sharenfs="-mapall=daniel 192.168.1.1 -network=255.255.255.0" zroot/work
zfs set sharenfs="-mapall=daniel 192.168.1.3/255.255.255.0" zroot/work
 
Last edited by a moderator:
In case you did not understand what tobik was saying,
It makes absolutely no difference (performance or otherwise) whether the entry is placed by "zfs set" or in /etc/exports

The ZFS entries append to the exports line anyway, and NFS performance does not benefit from ZFS.
 
Hi and thanks tobik. It didn't work for me, alas

zfs set sharenfs="-mapall=daniel 192.168.1/24" zroot/work

resulted in

[~/sync]$ mount -t nfs luffy:/usr/home/daniel/work work
Code:
mount_nfs: can't mount /usr/home/daniel/work from luffy onto /Users/daniel/sync/work: Permission denied
I did just get it to work with this:

zfs set sharenfs="-mapall=daniel -network 192.168.1.0 -mask=255.255.255.0" zroot/work

Thanks
 
Last edited by a moderator:
OK. Just my opinion but for NFS I always use /etc/exports even with ZFS. I have seen a lot of problems with using the sharenfs property under FreeBSD.
 
OK. Just my opinion but for NFS I always use /etc/exports even with ZFS. I have seen a lot of problems with using the sharenfs property under FreeBSD.

I agree. I'm still new to ZFS myself, but I haven't bothered setting the NFS properties via zfs set / zfs get itself simply because it would be too tedious to set each property individually, then track down every property individually for troubleshooting. It's pretty hard to track down a typo if you're looking at one entry at a time, and the more times you need to type out similar lines the more likely you are to make a mistake. Even with a single NFS share, though, you'd need to type multiple commands and re-type the entire property every time you wanted to correct something. Much better to write a single line in a text editor, copy-paste it and edit as necessary, then have a complete list of adjacent lines in front of you to make sure everything's written out properly.
 
Last edited by a moderator:
When you set sharenfs the value is written to /etc/zfs/exports, so you can look there for typos.

Of course this does not safe you from typing multiple commands to fix a typo or correct something...
 
Back
Top