How to redirect public traffic to openvpn connected client

  • Hello Community!

    I have pfsense router in datacenter and some static IPs available.
    I have FreeBSD host somwhere in the Internet, behind a NAT, that establishes connection via openvpn to my PFSense router.
    If I establish another VPN connection I can reach that FreeBSD host over vpn tunnel via IP (static assignment).

    I'd like to start web server on the FreeBSD host (running OpenVPN client) and have this web server visible via the IP of the pf sense router from the Internet side. I thought I could achieve that by NAT port forward on pfsense, forwarding port eg. 80 to the vpn client IP address, but it doesn't work and I don't know how to fix that.

    Could you point me to the right direction?
    I will appreciate any help in configuring that.

    Thank you


  • In addition to the port forwarding you will need an outbound NAT rule for the OpenVPN interface.
    In Firewall: NAT: Outbound try to add a rule like this:
    Interface=OpenVPN, Source=any, Destination=any (or your vpn clients IP), Translation=Interface address

  • It worked, after I restarted the pfsense box.

    Thank you :-)

Log in to reply