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

    How to let ONLY ONE interface use VPN?

    OpenVPN
    2
    32
    12.2k
    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
      pfBasic Banned
      last edited by

      How can I change that to get my other interface to not use the VPN at all?

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

        Don't set up gateway groups and policy route one interface to 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

          Could you tell me specifically how to do that? I don't know what I'm doing.

          Under System>Routing>Gateway Groups, I don't have anything configured.

          I don't know what you mean by policy route one interface to the VPN? What does this mean and how do I do it?

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

            Try using those as search terms first. Really not in the mood to explain it again.

            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 and from what I gather under my firewall rules I open the advanced options and select a specific gateway. I've selected WAN as the gateway for the firewall rules that I want to bypass the VPN, but it doesn't work, as soon as I do this the internet no longer works on that interface. When I change the Gateway back to default then it works again.

              I've also read to select "Don't Pull Routes" in my OpenVPN client configuration, but this also kills my internet.

              Is this what you were suggesting? If not I'm at a loss. If so… I'm still at a loss as it doesn't seem to work, any other suggestions or am I simply doing it wrong?

              1 Reply Last reply Reply Quote 0
              • 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
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.