2020-04-26, 03:59
(Related question on superuser.com)
I have two Raspberries Pi on my local network - rasrho (which has port 22 forwarded to it from the router, so it can act as an SSH bastion host) and rasnu (which runs an NFSv4 server). Other devices on my local network can use the NFS shares on rasnu as Kodi sources with no issues.
I would like to make those shares available to authorized devices on different networks. I aim to do so by forwarding the relevant ports for NFS (which I believe to be 2049 and 111 for NFSv4) over an SSH tunnel.
I believed that the steps to do so would be:
Are there other ports that I need to forward to make a remote proxy device "look like" a local NFS share?
I have two Raspberries Pi on my local network - rasrho (which has port 22 forwarded to it from the router, so it can act as an SSH bastion host) and rasnu (which runs an NFSv4 server). Other devices on my local network can use the NFS shares on rasnu as Kodi sources with no issues.
I would like to make those shares available to authorized devices on different networks. I aim to do so by forwarding the relevant ports for NFS (which I believe to be 2049 and 111 for NFSv4) over an SSH tunnel.
I believed that the steps to do so would be:
- Set rasnu's /etc/exports to the following (then run sudo exportfs -r to refresh):
Quote:/mnt/drive *(ro,sync,insecure,hide,no_root_squash,fsid=0,no_subtree_check)
/mnt/drive/media *(ro,sync,insecure,hide,no_root_squash,fsid=1,no_subtree_check)
- Forward relevant ports from a proxy device on the remote network, and confirm it's accessible:
Quote:user@proxy_device:~ $ ls /mnt/NFSDirectory
[null]
user@proxy_device:~ $ sudo ssh -fN -L :2049:rasnu.local:2049 -L :111:rasnu.local:111 <user>@<public_IP_of_rasrho>
user@proxy_device:~ $ sudo mount -t nfs localhost:/media /mnt/NFSDirectory
user@proxy_device:~ $ ls /mnt/NFSDirectory
[listing of /mnt/drive/media from NFS Server]
- Confirm that the NFS share tunnelled to proxy is accessible by another device on the same network as proxy_device:
Quote:user@remote_device:~ $ ls /mnt/NFSDirectory
[null]
user@remote_device:~ $ sudo mount -f nfs <local_address_of_proxy_device>:/media /mnt/NFSDirectory
user@remote_device:~ $ ls /mnt/NFSDirectory
[listing of /mnt/drive/media from NFS Server]
- On remote_device, direct Kodi to use an NFS share from the IP Address of proxy_device, with path /media (or media, I'm not sure which)
Are there other ports that I need to forward to make a remote proxy device "look like" a local NFS share?