首先修改 /etc/rc.conf:
1 2 3 |
nfs_server_enable="YES" nfsv4_server_enable="YES" nfsuserd_enable="YES" |
啟動 nfsd:
1 |
/etc/rc.d/nfsd start |
修改 /etc/exports:
1 2 3 4 5 6 |
#這裡首先要指定 NFS v4 的根目錄(注意 V4 必須是大寫) V4: /nfsv4 -network=10.0.0.0 -mask=255.255.255.192 # 接著就跟原本的 NFS 設定一樣 /nfsv4/user -mapall=user -network=10.0.0.0 -mask=255.255.255.192 # 或是加上 kerberos 驗證, -sec 只在 v4 有作用 /nfsv4/user -mapall=user -sec=krb5i |
參考資料:
http://www.blissfulidiot.com/2013/06/configuring-nfsv4-on-freebsd.html
https://www.freebsd.org/cgi/man.cgi?query=nfsv4&sektion=4
https://www.freebsd.org/cgi/man.cgi?query=exports&sektion=5
http://www.jasonvanpatten.com/2015/11/26/freebsd-as-my-network-storage-server-part-2/