金子邦彦研究室インストールFreeBSDNFS サーバ

NFS サーバ

設定のポイント

/etc/rc.conf

portmap_enable="YES"
nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
nfs_reserved_port_only="YES"
rpc_statd_enable="YES"
rpc_lockd_enable="YES"

nfs_server_flags の「-u -t」は 「UDP, TCP の両方」という意味.「-n 4」は 「nfsd を4つ」という意味。 「rpc_statd_enable」 は、「run rpc.statd(8) at boot time」. 「rpc_lockd_enable」 は 「run rpc.lockd(8) at boot time」です.

詳しくは、man rc.conf, man mountd など。

/etc/exports

設定例を次に書いています.ネットワークアドレス、ネットマスクを適切に設 定する必要がある.詳しくは man exports

/export      -network aaa.xxx.yyy.0 -mask 255.255.255.0

/etc/hosts.allow

次のように書きました。

ALL: localhost 127.0.0.1 : allow
ALL : hogehoge.domainname : allow
# IPv6
# ALL : [fe80::%fxp0]/10 : allow
# ALL : [::1] : allow
# sshd : ALL : allow
portmap : aaa.xxx.yyy.160/255.255.255.240 : allow
portmap : aaa.xxx.yyy.176/255.255.255.240 : allow
portmap : aaa.xxx.yyy.192/255.255.255.240 : allow
portmap : ALL : deny
# Rpcbid is used for all RPC services: protect your NFS!
rpcbind : aaa.xxx.yyy.160/255.255.255.240 : allow
rpcbind : aaa.xxx.yyy.176/255.255.255.240 : allow
rpcbind : aaa.xxx.yyy.192/255.255.255.240 : allow
rpcbind : ALL : deny
# Provide a small amount of protection for ftpd
ftpd : ALL : deny
ALL : PARANOID : RFC931 20 : deny
ALL : ALL : deny

詳しくは、man hosts_options を参照されたし。

NFS クライアント側の設定

/etc/rc.conf

FreeBSD だと、次のようになると思います.

portmap_enable="YES"
nfs_client_enable="YES"
rpc_statd_enable="YES"
rpc_lockd_enable="YES"