# Setting up NFS shares over Internet using ssh [SOLVED vpn]

## dufeu

I maintain several small networks {personal - not business related}. I want to get away from my current approach of running each PC independently when it comes to 'emerge'. i.e. I want to centralize /usr/portage/distfiles and /usr/portage/packages onto a single system.

I know how to set up NFS shares on a local network so this is not a problem for me. However, I want to do something I haven't done before. Basically, I expect to be traveling soon and I expect to have the PC which will be host to /usr/portage/distfiles and /usr/portage/packages to be traveling with me. The reason for this is that this PC is my spare backup workstation. It's also the PC I use to build my binary packages on.

Each of the local networks I maintain has Internet service via cable modems. Each local network has a secured router {with up-to-date firmware and WPA2 security if their respective wireless is activated with all Internet facing admin turned off}. Each secured router has a sshd active {but not port 22} which is passed through to one of the computers on the respective local network.

The fundamental requirement is to be able to run 'emerge --sync && emerge -guND world' remotely. The added caveat is that 'distfiles' and 'packages' directories will be with me.

I can already remotely ssh into each network. Once in, I can ssh into each of the local PCs on the network. I can also run 'emerge --sync && emerge -uND' world.

What I can't figure out is how to set up getting the PCs to 'see' the remote {to them} NFS shares. What I believe I want is for the NFS Host (me) PC to appear as if it's on the local network.

The physical links basically look like this:

```
NFS Host (me) PC <---NAT---> router <---Internet---> router <---NAT---> SHH Responder PC <--- (remaining local network PCs)
```

Could someone point me documentation or give me guidance on how to do this?

For what it's worth, it's perfectly fine to manually define the connections and NFS shares each time. I don't have a need for automatic detection of current IP addresses or anything like that. A step by step manual guide would be terrific.

Thanks!

----------

## jerann

 *dufeu wrote:*   

> What I believe I want is for the NFS Host (me) PC to appear as if it's on the local network. 

 

Would a VPN do what you need? I've used OpenVPN with success in the past, although not in the situation you described. It's been a while, but I think when I set mine up I just Googled some howtos. There's obviously an official site: http://openvpn.net/ and an entry on the Gentoo wiki: http://en.gentoo-wiki.com/wiki/OpenVPN.

----------

## mokia

try sshfs instead of NFS mount, maybe it works.

----------

## maxime1986

 *jerann wrote:*   

> Would a VPN do what you need?

 

+1 for the VPN

----------

## Hu

Since you have OpenSSH on both ends, you can also use its ad-hoc VPN support.  This would avoid the need to configure OpenVPN on top of your additional setup.  Look at man ssh_config for the options Tunnel and TunnelDevice and man sshd_config for the option PermitTunnel.

----------

## dufeu

I completely forgot that this is the kind of thing VPN is designed for! 

Thanks for the links and pointers. And thanks for reminding me vpn exists. Usually, I either just ssh with xterms from one system to another or I use nxclient {usually to try and figure out what my mother is complaining about .. }.

Now that I'm reminded, I can do some more googling with these pointers in hand and then decide what kind of set up I want.

Thanks again!

----------

## dufeu

I completely forgot that this is the kind of thing VPN is designed for! 

Thanks for the links and pointers. And thanks for reminding me vpn exists. Usually, I either just ssh with xterms from one system to another or I use nxclient {usually to try and figure out what my mother is complaining about .. }.

Now that I'm reminded, I can do some more googling with these pointers in hand and then decide what kind of set up I want.

Thanks again!

----------

