PF Port Forward through OpenVPN Tunnel to host behind OpenVPN Client

Hi Everyone,

I know I'm new here, hopefully someone can help. I don't know how to configure pf for the following scenario. We use PFsense for our routers, so I'm a little famillar with pf and its syntax, but I'm not sure how to configure pf in freeBSD 10.3 to accomplish this.

The openVPN setup is all done, and with PF disabled, all devices can access all devices on the subnets, so I know that setup is good and working. (ie. Device01 on 10.30.1.0 can ping the gateway, and device02 on 10.30.2.0, and vice versa)

I'm setting up a gateway server to provide access to services running on devices that reside on remote NAT'd subnets.

So in short, what I need to do is:

Internet -> Gateway -> Port Forward to Remote Device via VPN tunnel

If we take the attached image for example:

I need to forward port 1001 on gateway public interface (1.2.3.4), to remote device01 port 80 with IP 10.30.1.4.

I feel like I need to forward port 1001 on the gateway to client router at 10.30.1.1, and then forward on client router vpn interface to device01... But I can't quite get it working :(

Any help would be great!

Thanks, Carl
 

Attachments

  • vpn_tun.png
    vpn_tun.png
    61.8 KB · Views: 684
Just set up the port forward to the correct IP address. Let the system figure out how to route it there. It'll route through the VPN if that's where it needs to go.
 
Back
Top