4

I have an nfs export on computer A that I need to mount on a computer B in a different network. I have a multihome computer C, that can provide the connectivity between A & B. All computers are Redhat based. I've tried mounting and re-exporting it with no success. I am assuming exportfs refuses to share nfs mounted filesystems. But before I give up, I thought I ask.

Maybe there is a better solution? forwarding nfs/nfslock requests from C to A maybe?

2 Answers 2

3

No you cannot re-share NFS mounts.

excerpt from: Re: Can we export one NFS share again through NFS server running on some other linux server

The short answer: it is not possible.

For at least nine years now, the Linux kernel has contained code to guarantee that directories which are NFS exported are "physically" present on the host providing the NFS service. "physically" present can mean that the disk is present via iSCSI or fibre channel or any number of other network layers, but that's at the block level, not the file system level. The kernel will refuse to export an NFS mounted directory.

About 14 years ago, the user-space NFS server implementation did allow this, but I only used it for a weird one-off situation for a couple days (definitely non-production).

I can imagine a number of use-cases where re-exporting an NFS mounted directory would be appropriate (I have a wild imagination), but it won't be easy to get it to work. Specifically, it appears that in recent kernels, fuse file systems may be NFS exported (http://lwn.net/Articles/281793/), so you may be able to put a fuse layer between the NFS mounted directory and the export. If you succeed, I'd love to hear about it.

2

You cannot re-share NFS mounts, but there's little reason to. You can use C to forward requests between A and B.

For direct forwarding, you'll need to forward TCP port 111 (portmap) as well as all the UDP and TCP ports used by NFS (nfsd itself, mountd and lockd). This may be unwieldy.

It will probably be easier to use C to set up a VPN between A and B. This way, you can establish a route between A and B and solve the application-level issues completely separately from the network routing issues.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .