How to make nfs share accessible across subnets?

Bo Berglund bo.berglund at gmail.com
Thu Feb 10 12:02:14 UTC 2022


On my Ubuntu Mint I have an nfs connection to my Ubuntu Server 20.04.3 defined
in fstab as follows:

#NFS video share on ubuntuserv
192.168.119.216:/home/bosse/www/video /mnt/video nfs tcp,noexec,intr 0 0

This worked fine when the Mint device was running on my home LAN.
Now I have moved it over to my remote LAN in the summer cottage, which is
connected to my home LAN using OpenVPN built into the router at the cottage
toward my OpenVPN server at home.

I have full bidirectional access (as far as I have been able to check) between
devices on either LAN.

But now I found that the nfs share used by the Mint machine I moved there
yesterday does not work anymore...

When I run sudo mount -a I get this response:
mount.nfs: access denied by server while mounting
192.168.119.216:/home/bosse/www/video

So I looked at how nfs was set up on my Ubuntu server:

In the file /etc/exports I found this:

/home/bosse/www/video 192.168.119.0/24(rw,sync,no_subtree_check)

So I added another line for the subnet where the Mint machine is now located:

/home/bosse/www/video 192.168.117.0/24(rw,sync,no_subtree_check)

Then I did this:

sudo exportfs -a
sudo systemctl restart nfs-kernel-server

And then I tried the command:
sudo mount -a again

with the same refusal response...

What have I done wrong?

Everything else TCP I have tried work just fine like the two LAN sections was
one.


-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list