Ssh – How to configure pfsense to allow vpn clients to appear as if they are coming from the PFSense WAN

openvpnpfsensessh

I have a specific host I need to get to via ssh (call it 'work').
I have a static IP at my client location (call it 'client') to enable access to this remote 'work' box.

The people at 'work' then created a firewall rule to allow my 'client', static IP into their network.

This of course means that if I travel, I can NOT get into my 'work' network as I will have a different IP than my static one at my client site.

I have enabled a PFSense 2.2.3 box with OpenVPN (at the client site)

How will I be able to make secure connections routed through my 'client' box (with the static IP) that will allow me to make my secure connection to my 'work' box? (So it will look as if I am coming from the client static IP)

Best Answer

Since you have static IP at 'client'... (which is also the IP of your PFSense I bet?)

Simply set up port forwarding (also called ip masquerading) on your PFSense. Just so you get from the static public socket (public ip and port) of your pfsense to the private socket (LAN ip and port) of the 'client' box.

That way you will be able to connect to 'client' while on the road. Once you can SSH into 'client', you will also be able to SSH into 'work'.

This will also directly work by chaining the connections like this:

ssh -t <client-ip> -p <port-if-not-22> -l <user> ssh <work-ip>

As well you could set up 'client' as a proxy (search man 5 ssh_config for ProxyCommand) in ~/.ssh/config. If the manpage does not suffice, google will.