0

I have two Linux NFS servers on two locations (two different networks), each providing at least one NFS share.

Those servers are connected through VPN and each other NFS is mounted to folder on each other (per example below SrvA's /foo folder is mounted on SrvB:/mnt/foo and vice versa).

SrvA:/foo (Ubuntu 20.04, a.a.a.1, v.v.v.1) <-> SrvB:/bar (CentOS 8.5.2111, b.b.b.1, v.v.v.2)

LAN1: a.a.a.0/24
LAN2: b.b.b.0/24
VPN: v.v.v.0/24

What I need is Clients on LAN1 network to mount both NFS (using fstab) and also access the remote server with SMB (for windows clients that don't have NFS).
For example ClientAA has IP a.a.a.2 and has no access to specified VPN bridge, but wants to mount both /foo and /bar folders.

What I've found so far:

Is this NFS re-export possible? Are there any risks? Is it possible (and safe) to combine it with SMB? Or should I scrap the NFS re-export idea an use only SMB for the "behind the VPN" folder?

hemmond
  • 1
  • 1
  • Why not provide a route between the networks...? – vidarlo Dec 26 '22 at 22:21
  • Because then I would have to modify routing of all clients I want to access that NFS folders with in either network. Since clients will be mostly laptops roaming between both sites (and other locations without access to any server), I want to mostly limit modifications to fstab (with noauto option), since both networks have DHCP (and therefore usually using same NetworkManager profile). – hemmond Dec 26 '22 at 22:29

1 Answers1

0

Based on what I've seen on the mailing list recently, NFS re-export of NFS mounts is supported by the Linux NFS developers (including re-exporting a v4 share to v3 clients), but you'll want to use a fairly recent kernel on the "proxy" machine – looks like v5.11 at minimum, with v5.15 being recommended.

The various caveats are documented at https://linux-nfs.org/wiki/index.php/NFS_re-export.

user1686
  • 10,162
  • 1
  • 26
  • 42