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

    Issues with VPN and dual NIC

    Scheduled Pinned Locked Moved Routing and Multi WAN
    7 Posts 2 Posters 866 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.
    • R
      rsherga
      last edited by

      I am running bare metal pfsense, and the box is configured with one WAN interface and 2 LAN, each on their own /24 subnet as pictured here:

      398fb9c7-09fe-47d7-ad34-4da60ebd71fe-image.png

      I am connected physically from one pc using two NICs to each eth port.

      I want only one interface to use the VPN client, and I have all the policy rules in place how I believe they should be. However, it only works when I add a static route to my VPN interface. That'd be fine I guess, and it all seems hunky dory, except that when I use just the ISP interface on my computer (other unplugged), some websites report my public IP (which is what I expect) but others report the VPN IP address.

      c052d7b2-874b-405f-876f-e921bda2fdf5-image.png


      c3b77972-1f03-482f-8884-c05538f58f8e-image.png


      ba026832-69db-4142-8fce-6f5cf3df0fba-image.png


      1cc1f895-8810-4372-a0e7-80c883a60263-image.png

      What's going on? And is there a better way than static routing like I'm having to do, because that seems to be the culprit.

      Here are all my settings.

      a628d7ab-34b8-4835-9a62-4ce5b9d7f9c3-image.png


      c1e7d4d1-9a57-4c37-9204-66fcbe436cd5-image.png

      NOTE: If I put the block rule above the allow rule on LAN2DEFAULTLAN, all traffic stops on that interface.


      a75b2899-f2ac-48bc-91d8-f33f390971c3-image.png


      4ceeb2d1-e072-448c-9803-f0a7cac02b7d-image.png


      69879a0f-11d8-4a98-a9ba-b4357704ad82-image.png


      d3a13255-d8d6-4a8a-9ca1-ffd688984a39-image.png
      88722e01-7db0-4987-872f-828acfe0105b-image.png
      9f7511d1-27af-4ec3-a241-fb62f4958202-image.png

      Thanks in advance

      KOMK 1 Reply Last reply Reply Quote 0
      • KOMK
        KOM @rsherga
        last edited by

        @rsherga You need to create a gateway based on the OpenVPN interface and then add a LAN rule that directs all traffic from your specific NIC's IP address to the OpenVPN gateway.

        R 1 Reply Last reply Reply Quote 0
        • R
          rsherga @KOM
          last edited by

          @kom thanks for the reply.. Take a look at the firewall rule for LAN1VPNLAN. I am already doing as you suggest. "Expressvpninterface_v4" is the gateway for the vpn.

          KOMK 1 Reply Last reply Reply Quote 0
          • KOMK
            KOM @rsherga
            last edited by

            @rsherga I don't know how I missed that.

            How does the client PC know which NIC to send traffic out? Is it possible to bind an application to a specific network interface?

            R 1 Reply Last reply Reply Quote 0
            • R
              rsherga @KOM
              last edited by

              @kom man you rock for working with me here. I appreciate the input even if we can't end up figuring it out.

              To answer your question, I just manually set the metric for each interface in windows so the one to ISP is at I think 2, while the one to VPN is at 35.

              I have only one application I send over VPN interface, and it lets me bind it so it doesn't work unless I have it plugged in.

              Also, the issue of seeing either of the public IPs using different websites still occurs if I have the interface to VPN LAN unplugged. And it happens on my laptop when I also connect under the ISP- routed subnet, and that doesn't even have another interface.

              And this is all at once, so I can open 4 tabs at the same time and only certain ones report the public ISP IP address, and others the VPN. Each one is consistently the case though. So the same sites will always report the VPN IP in this situation. I am assuming maybe it is how they determine the information that differs. Like one uses ICMP, and another will use my DNS or something random. I know nothing really about how that could work aside from basic ICMP.

              So anyway, it's gotta be an issue on the pfsense side, right?

              KOMK 1 Reply Last reply Reply Quote 0
              • KOMK
                KOM @rsherga
                last edited by

                @rsherga I've never worked with a multihomed client so I don't have a lot to add. I don't see anything that jumps out. Like you, I"m not sure why external sites sometimes see your VPN IP when you have that interface disabled.

                R 1 Reply Last reply Reply Quote 0
                • R
                  rsherga @KOM
                  last edited by

                  @kom Hey I just wanted to follow up and let you know for posterity that I discovered the solution.
                  Simply setting each subnet/interface's allowed gateway on the firewall wasn't enough. The traffic MUST BE TAGGED in a floating rule.

                  So basically here is a summary for anyone who might be searching for this:

                  Goal: Route different traffic to specific gateways, only allowing in/out on specific interfaces or subnets. I have one WAN interface and two LAN interfaces: one of which should ONLY be to VPN (can be single gateway or gateway group), and the other should ONLY be through ISP.

                  1. Add firewall allow rules on each interface.
                  • LAN to ISP only
                    45624255-c3b2-4e88-b5de-0670de19f825-image.png

                  • LAN to VPN gateways only
                    4e7095d3-3ae7-4768-abae-33aee2e46f3b-image.png

                  1. In each rule, tag the traffic with a name you choose:

                  1bbbdcd6-e3ef-4738-a9a6-7c89ae21ac2f-image.png

                  7757ab98-6727-4c3a-9385-e434b2a85d82-image.png

                  1. Add two floating BLOCK rules.

                  bb7d5327-6a24-47c2-9d1d-f5c5866008c7-image.png

                  When you set the block rules for each inbound interface (WAN and VPN), set the opposite tag in the "tagged" field.
                  This will refuse any packets that have matching tags.

                  This is what finally stopped any detection of incorrect traffic on either gateway.

                  Thanks for your help though.

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