# BSD12 NFS problem



## bsd_gkn (Oct 17, 2020)

Hello

I am using FreeBSD 12. I cannot access the NFS share. It gives permission error. But there is no problem with permission.

What could be the problem?

---% server:

```
# freebsd-version
12.1-RELEASE

# cat /etc/rc.conf

nfs_server_enable="YES"
nfs_server_flags="-u -t -n 4"
rpcbind_enable="YES"
mountd_flags="-r"
mountd_enable="YES"


# showmount -e

Exports list on localhost:
/nfsshare       10.151.77.10
```

---% Ubuntu client

```
mount -o vers=2  -t nfs -vvvv 10.151.77.10:/nfsshare   /mnt/nfs 

---% Error:
mount.nfs: timeout set for Sat Oct 17 14:36:06 2020
mount.nfs: trying text-based options 'vers=2,addr=10.151.77.10'
mount.nfs: prog 100003, trying vers=2, prot=6
mount.nfs: trying 10.151.77.10 prog 100003 vers 2 prot TCP port 2049
mount.nfs: prog 100005, trying vers=1, prot=17
mount.nfs: trying 10.151.77.10 prog 100005 vers 1 prot UDP port 797
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 10.151.77.10:nfsshare
```


----------



## T-Daemon (Oct 17, 2020)

bsd_gkn said:


> Exports list on localhost:
> /nfsshare *10.151.77.10
> ...*
> ---% Ubuntu client
> mount -o vers=2  -t nfs -vvvv *10.151.77.10*:/nfsshare   /mnt/nfs



Could it be you have set by mistake the FreeBSD NFS servers IP in /etc/exports instead of the Ubuntu clients? It should be: 
/etc/exports

```
/nfsshare <Ubuntu client IP>
```

Ubuntu client
`mount -o vers=2 -t nfs -vvvv <FreeBSD NFS server IP>:/nfsshare /mnt/nfs`


----------



## SirDice (Oct 19, 2020)

Please don't use NFSv2. Use at least v3, preferably v4.


----------



## bsd_gkn (Oct 19, 2020)

I think there is a problem with the client. (may be network problem) thanks for the answers.


----------



## diizzy (Oct 19, 2020)

Your client might not do NFSv4 which requires a bit more configuration of you want to use NFSv3 (like LibreELEC clients).
Here's a sample from a 12.1 box serving LibreELEC clients (NFS v3), read only and allows all clients on 192.168.22.0/24 to access

/etc/rc.conf

```
nfs_server_enable="YES"
nfsv4_server_enable="YES"
nfsuserd_enable="YES"
```

/etc/sysctl.conf

```
vfs.nfsd.server_min_nfsvers=3
```

/etc/exports

```
/zfsarray/Media/Video -ro -mapall=nobody -alldirs -network 192.168.22.0/24
```


----------

