How to make nfs share accessible across subnets?
Bo Berglund
bo.berglund at gmail.com
Thu Feb 10 14:00:16 UTC 2022
On Thu, 10 Feb 2022 13:02:14 +0100, Bo Berglund <bo.berglund at gmail.com> wrote:
>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.
UPDATE
------
I have now tested a mount of my Synology NAS on my home LAN from the remote
location:
sudo mount 192.168.119.138:/volume1/VIDEO /mnt/nas
This *succeeds* even across the LAN sections so now remains to understand what
is the problem with my Ubuntu Server nas export since it replies like this on
manual mount command:
sudo mount 192.168.119.216:/home/bosse/www/VIDEO /mnt/video
mount.nfs: access denied by server while mounting
192.168.119.216:/home/bosse/www/VIDEO
My config in /etc/exports is this:
/home/bosse/www/VIDEO 192.168.119.0/24(rw,sync,no_subtree_check)
/home/bosse/www/VIDEO 192.168.117.0/24(rw,sync,no_subtree_check)
So the complete subnet 192.168.119.0/24 is allowed as client, but when I added
the cottage subnet 192.168.117.0/24 as another set of allowed clients then it
does not work, how come???
I see no difference really....
And as I indicated above, I reatarted the nfs service after modifying the
exports file.
Any ideas?
--
Bo Berglund
Developer in Sweden
More information about the ubuntu-users
mailing list