Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Seamless connection to website through OpenVPN

    Scheduled Pinned Locked Moved OpenVPN
    5 Posts 3 Posters 977 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      gobzter
      last edited by

      Good day, everybody!

      I have to apologize in advance for my terrbile english.

      So I've got to make this VPN connection to PFSense where gateway on client stays by default (so they would use their internet connection) but all traffic to 8.8.8.8 (for example) should be routed through VPN.
      I've tried to use push route and iroute commands, but to no avail.

      Maybe you can help me out?

      1 Reply Last reply Reply Quote 0
      • V
        viragomann
        last edited by

        So you have set up an access server?

        Is pfSense the default gateway in the network you want to access via vpn?

        Have you added firewall rules to OpenVPN interface to allow access?

        1 Reply Last reply Reply Quote 0
        • G
          gobzter
          last edited by

          Yes the OpenVPN itself is setup and working, PFSense is default gateway and I've added rules that deny any connection besides IP-address I wanted.
          If I turn on "redirect gateway" option then everything works perfectly but I have no access to web besides the host I selected and if I turn that option off then I have no connection to my host.

          1 Reply Last reply Reply Quote 0
          • V
            viragomann
            last edited by

            If it works when you activate "Redirect gateway" there are presumable only missing the routes when it is not activated.
            To push the routes to the client, you must enter the hosts or networks the client should be able to access in "Local Networks" box in the server settings in CIDR notation, meaning if it is only a single host use e.g. 8.8.8.8/32. Multiple hosts or subnets have to be separated by commas.

            1 Reply Last reply Reply Quote 0
            • DerelictD
              Derelict LAYER 8 Netgate
              last edited by

              That is a use case for policy routing. See the many, many threads about only sending traffic from certain hosts to, for instance, PIA. You will just need to alter the rules to match certain destinations instead.

              Chattanooga, Tennessee, USA
              A comprehensive network diagram is worth 10,000 words and 15 conference calls.
              DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
              Do Not Chat For Help! NO_WAN_EGRESS(TM)

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.