On the FreeBSD 11.1-RELEASE (x86-64) file server in my LAN I have in
/etc/exports:
Code:
/usr/ports -mapall=root -alldirs -network 192.168.1.0 -mask 255.255.255.0
/usr/src -mapall=root -alldirs -network 192.168.1.0 -mask 255.255.255.0
V4: /
... and in
/etc/rc.conf
Code:
...
## NFS with listening IP nailed down to the LAN IP of the file server and fixed ports
rpcbind_flags="-h 192.168.1.1"
rpc_lockd_flags="-h 192.168.1.1 -p 997"
rpc_statd_flags="-h 192.168.1.1 -p 998"
mountd_flags="-r -h 192.168.1.1 -p 999"
nfs_server_flags="-t -h 192.168.1.1"
rpcbind_enable="YES"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
mountd_enable="YES"
nfs_client_enable="YES"
nfs_server_enable="YES"
nfsv4_server_enable="YES"
nfsuserd_enable="YES"
...
On my Beaglebone Black FreeBSD 11.1-RELEASE (ARM) I have in
/etc/rc.conf:
Code:
...
### NFS Client
nfs_client_enable="YES"
nfsuserd_enable="YES"
...
... and in
/etc/fstab:
Code:
...
192.168.1.1:/usr/ports /usr/ports nfs rw,noatime,readahead=4,intr,soft,nfsv4 0 0
192.168.1.1:/usr/src /usr/src nfs rw,noatime,readahead=4,intr,soft,nfsv4 0 0
...
Of course, you need to make sure that the mount points
/usr/ports and
/usr/src do exist on the client system and that both are empty.
Of course, you need to restart the file server first, and only once it is up, restart the client.
When building ports in the shared ports tree make sure that
make clean is always executed afterwards, either implicitly --
portmaster(8) does it automatically if not told otherwise -- or explicitly in the respective port directory. Otherwise you would have a completed build in the respective
/usr/ports/*/*/work directory which may confuse a client with another architecture.
Occasionally, you might want to run
rm -r /usr/ports/*/*/work
on the file server, in order to keep the ports tree clean.
Regarding
/usr/src, this is only the same for exactly the same FreeBSD version and patch level.