For Solaris 10
On NFS server
Run the below command to share the NFS to specific NFS clients only.
# share -F nfs -o rw=[accesslist] /path/to/share
The -o accesslist is required to limit the share. As shown in example below “client1″ and client2” has only been granted the access to the NFS share /exports :
# share -F nfs -o rw=client1,client2 /export
The access list may contain netgroups, FQDN, IP addresses (of networks or hosts) depending on what name resolution you are using. Typically, share commands are entered in the /etc/dfs/dfstab file for execution at boot.
On NFS client
For Solaris NFS clients, simply execute the mount command as you would normally. If the host, network or domain (whichever you are using for accesslist) matches, the mount will be allowed. If there is no match, access will be denied and the mount will fail.
# mount -F nfs -o [options] [NFS_server]:[mountpoint]
For Soalris 11 without ZFS
On the NFS server
Do not populate /etc/dfs/dfstab, it is deprecated in Solaris 11. Use the share command:
# share -F nfs -d sharetest -o rw=client1,client2 /export # showmount -e export list for nfsserverhost: /export client1,client2
Solaris 11.1 or later – with ZFS version 6 (or later)
Solaris 11 ZFS shares are done in two steps:
1. Create the share, assigning name=[sharename] value to the dataset’s share name property:
# zfs set share=name=myshare,path=/export,prot=nfs mypool/export
2. Publish the share, configuring the access list, via the share.nfs.sec.default.rw (assuming R/W access is to be limited) property.
# zfs set share.nfs.sec.default.rw=client1:client2 mypool/export%myshare
This configures the read/write client access list – for the client1 and client2 hosts in this case.
On the NFS client
Use the mount command:
# mount -F nfs -o [options] [NFS_server]:[mountpoint]