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

    How to let ONLY ONE interface use VPN?

    OpenVPN
    2
    32
    12.1k
    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.
    • DerelictD
      Derelict LAYER 8 Netgate
      last edited by

      Post what you have done. Far easier than trying to guess.

      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
      • P
        pfBasic Banned
        last edited by

        Also, under Outbound NAT rules, if I disable my manual rules "PIAVPN - 192.168.16.0/24 - * - * - (* & 500) - PIAVPN address - *" or change the interface to WAN (Auto rules already include it under WAN interface) then it kills the internet on that interface. If I re-enable those rules then the interface works (provided I'm still routing traffic through the VPN).

        I don't know if this is helpful but those outbound NAT rules are definitely affecting my connection and are only working when configured for the VPN interface.

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

          If you disable outbound NAT on an interface you disable outbound NAT on an interface. If you need outbound NAT on that interface that breaks it. Why is this surprising?

          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
          • P
            pfBasic Banned
            last edited by

            @Derelict:

            Post what you have done. Far easier than trying to guess.

            As my configuration is now, I have an OpenVPN client configured per the link in the original post.

            I have hybrid outbound NAT rules (manual rules configured for VPN interface).

            My firewall rules on the interface do not currently specify a gateway as it was not working when I specified WAN gateway.

            I have no gateway groups configured and do not have "don't pull routes" selected.

            In this configuration all interfaces work but all interfaces also route all traffic through the VPN.

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

              Screen shots. Real data. Not interested in what you think you have done. Interested in what you have done.

              Get your stuff into a mode where you THINK it should be working and post it.

              Oh, and this: https://forum.pfsense.org/index.php?topic=120295.0

              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
              • P
                pfBasic Banned
                last edited by

                @Derelict:

                If you disable outbound NAT on an interface you disable outbound NAT on an interface. If you need outbound NAT on that interface that breaks it. Why is this surprising?

                Well this is all new to me but it surprised me because the automatic outbound NAT rules still included the subnet on the WAN interface, all I was doing was disabling the outbound NAT rule for the VPN interface (since I don't want that subnet to use the VPN). So I thought that by doing that it would simply use the WAN and skip the VPN.

                I posted a picture as to what I'm talking about. I blacked out everything but the rules for the subnet I'm trying to bypass the VPN with. The top rules under mappings are the ones I was disabling. I thought that since the subnet was included under the bottom automatic rules that it would still NAT over the WAN interface?

                Untitled.png
                Untitled.png_thumb

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

                  It DOES NOT MATTER what subnets are included in outbound NAT rules. They only have an effect when traffic IS ROUTED OUT THAT INTERFACE by policy routing or the routing table. They DO NOT have ANY bearing on what traffic goes where. Only what NAT is performed when traffic flows that way.

                  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
                  • P
                    pfBasic Banned
                    last edited by

                    @Derelict:

                    Screen shots. Real data. Not interested in what you think you have done. Interested in what you have done.

                    Get your stuff into a mode where you THINK it should be working and post it.

                    Oh, and this: https://forum.pfsense.org/index.php?topic=120295.0

                    Here are some more screens of what I have. The Outbound NAT rules in the top mappings section of the other screenshot I posted are currently disabled.

                    This is what I thought would work, but no internet routes on the interface that I want to bypass the VPN in this configuration. I get a "this site took too long to respond error".

                    Untitled.png
                    Untitled.png_thumb
                    un1.png
                    un1.png_thumb
                    un2.png
                    un2.png_thumb

                    1 Reply Last reply Reply Quote 0
                    • P
                      pfBasic Banned
                      last edited by

                      @Derelict:

                      It DOES NOT MATTER what subnets are included in outbound NAT rules. They only have an effect when traffic IS ROUTED OUT THAT INTERFACE by policy routing or the routing table. They DO NOT have ANY bearing on what traffic goes where. Only what NAT is performed when traffic flows that way.

                      So woul this mean that I can disable those manual outbound NAT rules safely (as they aren't ever going to do anything that I want). And then policy route all traffic on the interface I wan to bypass the VPN to my WAN interface (and the automatic outbound NAT rules would handle the NAT through WAN)?

                      If I understood that correctly then it sounds like my issue is that I'm not correctly doing policy routing? I've tried adding my WAN interface as the gateway on all of my rules on my "GUEST" interface (the one I want to bypass VPN), but then the internet simply doesn't work.

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

                        Your pass rule passing traffic to NETWAN is TCP-only. That is almost certainly not what you want. Try protocol any there.

                        I see nothing that policy routes traffic out PIAVPN_GW. What traffic do you expect to be routed that way?

                        Traffic to your Outgoing Ports will go out the default gateway, not the VPN.

                        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
                        • P
                          pfBasic Banned
                          last edited by

                          @Derelict:

                          Your pass rule passing traffic to NETWAN is TCP-only. That is almost certainly not what you want. Try protocol any there.

                          I see nothing that policy routes traffic out PIAVPN_GW. What traffic do you expect to be routed that way?

                          Traffic to your Outgoing Ports will go out the default gateway, not the VPN.

                          I rearranged it like this applied and reset state tables but am still getting the same error?

                          un2.png
                          un2.png_thumb

                          1 Reply Last reply Reply Quote 0
                          • P
                            pfBasic Banned
                            last edited by

                            @Derelict:

                            I see nothing that policy routes traffic out PIAVPN_GW. What traffic do you expect to be routed that way?

                            I don't want anything on this interface to go through the PIAVPN gateway, I want everything on this interface to completely bypass the VPN.

                            Currently everything goes through PIAVPN Gateway (or doesn't work at all). I haven't needed to use any policy routing for it to work that way, everything just goes through the VPN.

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

                              Be more specific. What error? Exactly what are you trying to connect to from where?

                              It matters what DNS servers your clients are being told to use.

                              Enable DON'T PULL ROUTES in the OpenVPN Client Config.

                              It is usually better to route the traffic you want to go over the VPN over the VPN, not route the traffic you don't the other way.

                              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
                              • P
                                pfBasic Banned
                                last edited by

                                @Derelict:

                                Be more specific. What error? Exactly what are you trying to connect to from where?

                                It matters what DNS servers your clients are being told to use.

                                Enable DON'T PULL ROUTES in the OpenVPN Client Config.

                                It is usually better to route the traffic you want to go over the VPN over the VPN, not route the traffic you don't the other way.

                                I tried enabling don't pull routes. That kills the internet on both of my interfaces. It gives an identical "too long to respond" error on both interfaces.

                                I attached pictures of the error and the DNS server settings.

                                un1.png
                                un1.png_thumb
                                un2.png
                                un2.png_thumb

                                1 Reply Last reply Reply Quote 0
                                • P
                                  pfBasic Banned
                                  last edited by

                                  @Derelict:

                                  It is usually better to route the traffic you want to go over the VPN over the VPN, not route the traffic you don't the other way.

                                  I would prefer that as well. The guide that I used to configure my VPN on pfsense just routes everything through the VPN.

                                  1 Reply Last reply Reply Quote 0
                                  • P
                                    pfBasic Banned
                                    last edited by

                                    @Derelict:

                                    Be more specific. What error? Exactly what are you trying to connect to from where?

                                    On the "networkGUEST" interface there is a Wifi AP. I'm just testing connectivity using a laptop connected to that wifi network by going to websites and checking to see if programs are able to use the internet (i.e. cloud programs, AV, etc.).

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

                                      I tried enabling don't pull routes. That kills the internet on both of my interfaces. It gives an identical "too long to respond" error on both interfaces.

                                      No idea what you've done then. Your WAN_GW should be marked as the default gateway. Disabling redirect gateway on the VPN client should not impact WAN at all.

                                      Love these internet walkthroughs.

                                      Learn how to troubleshoot exactly what is broken using ping, dig/drill, telnet, etc. If you can identify exactly what is failing, maybe there's a chance at getting some forum help.

                                      https://doc.pfsense.org/index.php/Connectivity_Troubleshooting

                                      Oh, and again, there's a hangout on Connectivity Troubleshooting too: https://portal.pfsense.org/webcasts/index.php?video=172174964

                                      Wired, wireless, doesn't matter. Those aren't specifics.

                                      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
                                      • P
                                        pfBasic Banned
                                        last edited by

                                        WAN Gateway is marked as default.

                                        I don't have a membership for that video.

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

                                          Maybe that should be remedied. They really do cover everything you're trying to do.

                                          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
                                          • P
                                            pfBasic Banned
                                            last edited by

                                            I have posted a Bounty for this https://forum.pfsense.org/index.php?topic=120371.msg665710#msg665710, so I'm willing to pay for the solution. But would prefer to pay someone that can remedy my problem specifically, instead of paying for access to a video that may or may not help solve my specific problem.

                                            If you're willing let me know what you feel a reasonable price is and I would be happy to open up a TeamViewer screenshare for you or provide you screenshots of whatever you like to solve the problem (if I can afford you).

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