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

    Access only specific sites through OVPN

    Scheduled Pinned Locked Moved OpenVPN
    9 Posts 5 Posters 1.4k 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.
    • P
      paulheu
      last edited by

      Hi and apologies if this has been asked before (probably is) but there is so much information here.. ;)

      I successfully set up openVPN but really only need it for a few specific websites, I'd prefer to let normal traffic g  though the normal WAN gateway and only use VPN for those few sites. I am guessing I need to set up NAT rules to use the gateway I need but could use a bit of help. I'll be happy to puzzle it together if I could get some pointers ..

      Oh, would it be correct to assume that if I would need say a VPN to a Dutch gateway for some and an US gateway for others I would just set up two clients with two interfaces and the appropriate routing and gateways?

      I think I get the basic idea, but can and would appreciate some help in figuring this all out..

      thanks!
      Paul

      1 Reply Last reply Reply Quote 0
      • P
        paulheu
        last edited by

        I've been fiddling around with this a bit and found out how I can basically make connection using VPN or WAN. Now I need to create rules so that two IP ranges where te IP address starts with either 145.85.x.x or 77.72.x.x are routed through the VPN.

        I tried setting up a rule in firewall LAN as:

        Proto  Source Port Destination Port Gateway Queue
        IPv4 TCP * * 145.85.0.0/16 * VPN_VPNV4 none
        IPv4 TCP * * 77.72.0.0/16 * VPN_VPNV4 none

        but that does not work. I could be completely misunderstanding, but I though that entering an IP A.B.C.D/16 would match any IP from A.B.C.D - A.B.255.254

        I have a rule

        IPv4 * LAN net * * * WAN_DHCP none

        where I get access through VPN, when I change the gateway to  WAN (obv also changes in this rule then) it uses my WAN. So that works as I expected..

        Any help appreciated here..

        1 Reply Last reply Reply Quote 0
        • B
          boowii
          last edited by

          yeah i would like to know how to do this as well. have you had any success yet?

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

            @paulheu:

            I've been fiddling around with this a bit and found out how I can basically make connection using VPN or WAN. Now I need to create rules so that two IP ranges where te IP address starts with either 145.85.x.x or 77.72.x.x are routed through the VPN.

            I tried setting up a rule in firewall LAN as:

            Proto  Source Port Destination Port Gateway Queue
            IPv4 TCP * * 145.85.0.0/16 * VPN_VPNV4 none
            IPv4 TCP * * 77.72.0.0/16 * VPN_VPNV4 none

            but that does not work.

            Please define does not work.

            Looks like it should work to me as long as those rules are above more general rules and the traffic is actually TCP traffic.

            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
            • V
              viragomann
              last edited by

              You have to put your rule into this order:

              
              IPv4 TCP   *   *   145.85.0.0/16   *   VPN_VPNV4   none   
              IPv4 TCP   *   *   77.72.0.0/16   *   VPN_VPNV4   none
              IPv4 *   LAN net   *   *   *   WAN_DHCP   none
              
              
              1 Reply Last reply Reply Quote 0
              • S
                strikeshield
                last edited by

                Can anyone confirm that an OpenVPN VPN connection will "Draw" all the traffic through the VPN unless a command such as ROUTE-NOPULL is used on the client side ?

                I have a funcitonal VPN connection which I am trying to use ONLY for certain IP destinations. It works fine, but after a while ALL my traffic is going through the VPN and kills my VOIP connection which is not permitted from another country.

                I have set up an Alias with the destination networks I wish to funnel through the VPN witht he appropriate Firewall rules, however eventuall ALL traffic ends up going through the VPN.

                What am I missing ?

                Thanks

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

                  Without route-nopull the provider can push whatever routes it wants to you and they will be honored.  This might include a default route that will tell your system to send all traffic through the VPN.  If you add route-nopull your system will ignore pushed routes and it's up to you to tell your system what traffic to send to the tunnel.

                  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
                  • S
                    strikeshield
                    last edited by

                    Thanks for that, I'll try that and see what happens…stay tuned !

                    1 Reply Last reply Reply Quote 0
                    • S
                      strikeshield
                      last edited by

                      OK good news, the ROUTE-NOPULL command resolved the issue for me. Now firewall rules work and the VPN static connection to the Server does NOT override the router and pull all the traffic into it.
                      thanks for all your help.

                      Christian Laf

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