pfSense: Dual WAN Load Balancing / Fail Over DNS (and possibly more) Issues


Recommended Posts

Hello! So I have been using pfSense for a few years now and have been very happy with it. I recently signed up for a second internet connection at home to have as a backup. After configuring everything, pfSense does indeed switch over to the second connection when the first one fails (simulated by disconnecting the cable), but DNS resolution (or possibly some other issue) doesn't seem to work, and as a result I am not able to browse the internet. I have provided some more information about my setup below. Provided some screenshots as well.

 

WAN1 is a PPPoE connection with a public routable static IPv4 address.

WAN2 is a CGNAT address and a completely locked down modem, so no Bridge Mode. pfSense just gets a private IP on the WAN2 interface.

 

pfSense running in a VM on Proxmox with 2 Ethernet cards available for it. One used for WAN1, other for LAN.

Managed Switch has a VLAN on one of the ports for the WAN2. VLAN configured in pfSense.

DNS handled by 2 Pi-hole instances, 1 is a VM on the same Proxmox host, 2nd is on a Raspberry Pi. Both Pi-holes are on their own VLAN in pfSense and DNS Redirect has been configured for the primary LAN network.

Both Pi-hole addresses specified under System/General Setup/DNS Settings. AdGuard DNS IP's provided for WAN2.

 

 

What am I doing wrong?

 

dns.png

 

gateways.png

lan rules.png

Edited by The Dark Knight
On 17/10/2022 at 07:31, The Dark Knight said:

Both Pi-hole addresses specified under System/General Setup/DNS Settings. AdGuard DNS IP's provided for WAN2.

So you setup the resolver to forward?  Out of the box unbound resolves, putting stuff in dns settings under general doesn't do anything but provide dns that pfsense itself could use.  Unless you told unbound to forward.  Also trying to redirect dot is pretty pointless.. Since the client should validate the cert of the dns its trying to talk to, trying to send that to your pihole - that shouldn't work, even if pihole was listening for dot.  Unless it presented a cert for whatever fqdn the dot client was trying to talk to.

 

So your clients get handed what for their dns, pfsense IP, and then you redirect that to pihole - that goes where then for dns?

 

Your clients should get handed pihole IPs for their dns, now your pihole should forward to where you want, or it should resolve - and it would use whatever failover you have setup for your routing, etc. In that last rule.

 

If you redirecting it?  You could have a loop in how your dns is suppose to work from that setup.

Not using DNS Forwarder, but DNS Resolver. Although I just looked at it properly, the option to forward to the DNS servers under General Setup is unticked.....yet everything works (with just one WAN). It's possible I've done something wrong here. I did this a long time back following a guide on using pfSense with Pi-hole. Maybe the guide I followed was wrong as well. But everything was working, so I didn't go deep into it. I do have both Pi-holes specified under the LAN DHCP Server settings as well.

 

On both Pi-holes I have the Cloudflare DoH service running, so my Upstream is 127.0.0.1#5053.

 

Oh ok, didn't know that redirecting DoT is not useful. But then why is the state table for it so large?

 

 

dns2.jpg

Those IPs in general dns have nothing to do with clients asking unbound, as you show unbound is resolving - not forwarding.. It will walk down from roots, then the gltds then the authoritative ns.. Those settings are only for pfsense to forward to if you it isn't asking itself (127.0.0.1) or that is down or something.

 

They would never be used by unbound (unless you set forwarding in unbound), nor would they get handed to a client to use. 

 

Your 2nd wan might be having a problem resolving? Or dns in general.. I would disable your main wan.. And then try doing some directed dns queries via pfsense.. Or a client to different dns, ask pfsense directly on its IP to look up somethiing new that is not in the cache, etc. Does it work, ask 8.8.8.8, ask cloudflare, ask quad9, etc. query the roots directly..

 

example.

 

[22.05-RELEASE][[email protected]]/root: dig

; <<>> DiG 9.16.26 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4687
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;.                              IN      NS

;; ANSWER SECTION:
.                       26647   IN      NS      d.root-servers.net.
.                       26647   IN      NS      e.root-servers.net.
.                       26647   IN      NS      f.root-servers.net.
.                       26647   IN      NS      g.root-servers.net.
.                       26647   IN      NS      h.root-servers.net.
.                       26647   IN      NS      i.root-servers.net.
.                       26647   IN      NS      j.root-servers.net.
.                       26647   IN      NS      k.root-servers.net.
.                       26647   IN      NS      l.root-servers.net.
.                       26647   IN      NS      m.root-servers.net.
.                       26647   IN      NS      a.root-servers.net.
.                       26647   IN      NS      b.root-servers.net.
.                       26647   IN      NS      c.root-servers.net.

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Oct 18 11:03:32 CDT 2022
;; MSG SIZE  rcvd: 239

[22.05-RELEASE][[email protected]]/root: dig @d.root-servers.net com. NS

; <<>> DiG 9.16.26 <<>> @d.root-servers.net com. NS
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39862
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 13, ADDITIONAL: 27
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1450
;; QUESTION SECTION:
;com.                           IN      NS

;; AUTHORITY SECTION:
com.                    172800  IN      NS      a.gtld-servers.net.
com.                    172800  IN      NS      b.gtld-servers.net.
com.                    172800  IN      NS      c.gtld-servers.net.
com.                    172800  IN      NS      d.gtld-servers.net.
com.                    172800  IN      NS      e.gtld-servers.net.
com.                    172800  IN      NS      f.gtld-servers.net.
com.                    172800  IN      NS      g.gtld-servers.net.
com.                    172800  IN      NS      h.gtld-servers.net.
com.                    172800  IN      NS      i.gtld-servers.net.
com.                    172800  IN      NS      j.gtld-servers.net.
com.                    172800  IN      NS      k.gtld-servers.net.
com.                    172800  IN      NS      l.gtld-servers.net.
com.                    172800  IN      NS      m.gtld-servers.net.

;; ADDITIONAL SECTION:
a.gtld-servers.net.     172800  IN      A       192.5.6.30
b.gtld-servers.net.     172800  IN      A       192.33.14.30
c.gtld-servers.net.     172800  IN      A       192.26.92.30
d.gtld-servers.net.     172800  IN      A       192.31.80.30
e.gtld-servers.net.     172800  IN      A       192.12.94.30
f.gtld-servers.net.     172800  IN      A       192.35.51.30
g.gtld-servers.net.     172800  IN      A       192.42.93.30
h.gtld-servers.net.     172800  IN      A       192.54.112.30
i.gtld-servers.net.     172800  IN      A       192.43.172.30
j.gtld-servers.net.     172800  IN      A       192.48.79.30
k.gtld-servers.net.     172800  IN      A       192.52.178.30
l.gtld-servers.net.     172800  IN      A       192.41.162.30
m.gtld-servers.net.     172800  IN      A       192.55.83.30
a.gtld-servers.net.     172800  IN      AAAA    2001:503:a83e::2:30
b.gtld-servers.net.     172800  IN      AAAA    2001:503:231d::2:30
c.gtld-servers.net.     172800  IN      AAAA    2001:503:83eb::30
d.gtld-servers.net.     172800  IN      AAAA    2001:500:856e::30
e.gtld-servers.net.     172800  IN      AAAA    2001:502:1ca1::30
f.gtld-servers.net.     172800  IN      AAAA    2001:503:d414::30
g.gtld-servers.net.     172800  IN      AAAA    2001:503:eea3::30
h.gtld-servers.net.     172800  IN      AAAA    2001:502:8cc::30
i.gtld-servers.net.     172800  IN      AAAA    2001:503:39c1::30
j.gtld-servers.net.     172800  IN      AAAA    2001:502:7094::30
k.gtld-servers.net.     172800  IN      AAAA    2001:503:d2d::30
l.gtld-servers.net.     172800  IN      AAAA    2001:500:d937::30
m.gtld-servers.net.     172800  IN      AAAA    2001:501:b1f9::30

;; Query time: 223 msec
;; SERVER: 199.7.91.13#53(199.7.91.13)
;; WHEN: Tue Oct 18 11:03:56 CDT 2022
;; MSG SIZE  rcvd: 828

[22.05-RELEASE][[email protected]]/root: 

 

  • Like 1

Ok, so I disabled WAN1 and did a Dig test like you asked.....it fails! So DNS is the issue.....

 

 

dnstest.jpg

dnstest2.jpg

Also, another thing I can't figure out why.....if I have the Fail Over group specified in the Gateway for the LAN outbound rule, even though I am able to browse the web, I can't access my Pi-hole URL's and also can't access my WAN2 modem web page! I have another VLAN with a .20 network, I can access the web servers and services on that perfectly.

 

If I change the Gateway in the outbound rule back to default, everything is accessible again.

 

Edit: I just checked, I actually can't access everything. Some work, some don't. 😵😵

 

Edit 2: If I try to access directly with the IP on the .20 network, it doesn't work. Only accessible with the domain that I have reverse proxied for those web servers. This is all when the Fail Over is specified on the LAN Outbound.

Edited by The Dark Knight

did you do that from pfsense?  That is just asking loopback, itself you didn't direct that to 8.8.8.8 you asked 127 for 8.8.8.8 you need to use the @ to tell dig where to ask.

On 18/10/2022 at 22:18, BudMan said:

did you do that from pfsense?  That is just asking loopback, itself you didn't direct that to 8.8.8.8 you asked 127 for 8.8.8.8 you need to use the @ to tell dig where to ask.

Yes, logged in via SSH to pfSense and ran the Dig command.

 

Edit: Logged in again after disabling WAN1 and ran dig @8.8.8.8. No response.

well then if you can not talk to 8.8.8.8 from pfsense, or the roots can you talk to the dns of of that connection.  It is possible for ISP to only allow dns to their dns servers.  You might see that on say a sat connection, or even cell - did you mention this was a cell sort of backup link?

I actually suspected this ISP must be forcing their DNS....but I tried just now, doesn't work either. No, this is an optical fibre connection. But locked down like hell! I had another thought.....this ISP prioritises IPv6. Could it be possible I'm facing problems because I'm trying only IPv4 in pfSense?

 

 

dnstest3.jpg

Sorry, late over here, need to go to sleep. 😄

 

Thanks for all your help so far BudMan! 😎👍

 

Want to really get this working....otherwise worst case scenario, I dump this ISP and get another connection from a not so restricted provider. I signed up with these guys because they bundle in streaming subscriptions with the internet plan, and is a damn good deal.....provided you use everything they way they want you to. Their supplied Android TV box for my TV....freaking HELL....insanely locked down!

 

that you get a timeout is odd, I actually get a refused which is more like what should happen when you try and talk to a ISP dns, but not from ISP network.

 

22.05-RELEASE][[email protected]]/root: dig @49.45.0.3

; <<>> DiG 9.16.26 <<>> @49.45.0.3
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 51706
;; flags: qr rd ad; QUERY: 0, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; Query time: 266 msec
;; SERVER: 49.45.0.3#53(49.45.0.3)
;; WHEN: Tue Oct 18 13:04:22 CDT 2022
;; MSG SIZE  rcvd: 12

[22.05-RELEASE][[email protected]]/root: dig @49.45.0.3 www.google.com

; <<>> DiG 9.16.26 <<>> @49.45.0.3 www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 26050
;; flags: qr rd ad; QUERY: 0, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; Query time: 265 msec
;; SERVER: 49.45.0.3#53(49.45.0.3)
;; WHEN: Tue Oct 18 13:05:18 CDT 2022
;; MSG SIZE  rcvd: 12

[22.05-RELEASE][[email protected]]/root: 

 

But yeah if you can not do dns over this connection - what is the point of it??  It useless connection.

On 18/10/2022 at 23:36, BudMan said:

that you get a timeout is odd, I actually get a refused which is more like what should happen when you try and talk to a ISP dns, but not from ISP network.

 

But yeah if you can not do dns over this connection - what is the point of it??  It useless connection.

Ok. Yes, true, it is useless in pfSense. I can still use the connection with just their device directly via Ethernet or WiFi. Not ideal of course.

 

But what I don't understand is.....however locked down it is, since pfSense is just seen as a DHCP client by their device, shouldn't it just work?

My computers do, if I connect them to ther device. 🫤

Dns should work - kind of hard to use the internet if dns doesn't work..  When you plug your device into their device - what does it give you for dns, the IP of their device? You can set pfsense to use that for dns.

On 20/10/2022 at 04:52, BudMan said:

Dns should work - kind of hard to use the internet if dns doesn't work..  When you plug your device into their device - what does it give you for dns, the IP of their device? You can set pfsense to use that for dns.

Ok, so here's something important. There is definitely something in my configuration that is blocking pfSense from getting DNS resolution on WAN2. I created a brand new VM and setup a fresh install of pfSense. I then configured only the second connection as my primary WAN. pfSense is pulling a private IP from their device, and everything is working!

 

So it definitely works, just not in my current setup. I'm sure it has something to do with the way I am using Pi-hole for DNS resolution and also probably because of my redirect rule so that clients are forced to use my Pi-holes.

Ok. But then that still leaves the question....why isn't it working?

It's not an absolute deal breaker if it doesn't, but would be nice to be able to take advantage of automatic dual WAN functionality.

so when your connected directly to this isp device, what does your client use for dns?

 

Your saying when you redid your pfsense its now all working.. So your saying the directed queries you did before are now working?

DNS IP is showing their router IP - 192.168.29.1

 

Yes, I tested dig @8.8.8.8 and dig @d.root-servers.net com. NS like in your screenshots, works perfectly.

 

 

dnstest4.jpg

dnstest5.jpg

On 21/10/2022 at 07:49, BudMan said:

Well add your other line now..  But if dns isn't working, then yeah hard to get anywhere even if you have connectivity.

Yes, will try adding it soon. Not at home currently, so will do it tonight and test. I think I also enabled the option to let DNS be overriden by what the WAN interface gives. Not sure, can only check later today.

 

But if I do have to keep that enabled for WAN2 to work, pfSense will do that for my primary connection as well. Can I still have my Pi-hole handle DNS instead of the WAN1 DNS (they use Google DNS)?

 

 

On 21/10/2022 at 08:07, binaryzero said:

What's the gateway set to on your pi-hole, does it have internet connectivity when you failover to your secondary connection? If you've set your DNS forwarders to use pi-hole, and it can't get out..well...rip.

When I simulate WAN1 being down, WAN2 has no DNS resolution and my Pi-holes are not accessible.

 

My Pi-holes are on a seperate VLAN, and no Gateway was specified under the Interface settings on pfSense. On both Pi-holes, Upstream is Cloudflare DoH using the Cloudflared service.

What? The Pi-Holes will need a gateway to communicate to the internet...

 

If you disconnect WAN1 and DNS stops, its probably because the pi-holes have lost internet connection?

 

You can specify whatever you want as DNS servers on your LAN, use DHCP to hand out the pi-hole IPs for DNS.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Posts

    • This is about the EU given consumers options, Apple is all about not giving options and locking you into its own services, this hurts Apple far more than it hurts the EU market because it makes Apple products look less appealing by Apple refusing to offer its own service because they have to give options to rivals, the end results are consumers might look at alternatives like Android. It's a game Apple can't really win when there are alternatives and Apple will in time change course on this, until then, let Apple hurt themselves in the EU market.
    • Microsoft unveils new Surface Laptop with improved trackpad, Snapdragon X2, and more by Taras Buria Microsoft's new Surface Laptop Ultra generated a lot of buzz earlier this month, but in addition to its most powerful laptop with an NVIDIA chip, Microsoft also has a more affordable laptop lineup, which has been waiting for an update for quite a while. Today, Microsoft announced the eighth-generation Surface Laptop. The new Surface Laptop is powered by the Snapdragon X2 Plus and X2 Elite processors. These chips offer faster CPU performance, up to 58% faster graphics, and 80 TOPS Neural Processing Units (NPUs) for on-device AI processing. Like the previous models, these chips retain their great energy efficiency, and Microsoft says that buyers can expect up to 20 hours of work on a single charge. The laptop is available in two sizes: 13.8-inch and 15-inch. You will have a hard time finding visual differences between the new and previous models, as Microsoft is not taking any major design leaps, except for the new Jade color, which may look familiar to Surface Laptop 5 owners. Other colors include Platinum, Black, and Dune. The 15-inch variant got a higher-resolution display. It is a 3,270 x 2,180 resolution screen with a pixel density of 262 ppi (the 13-inch model has a 201 ppi density) and a maximum brightness of 600 nits SDR and HDR. Unlike the Surface Pro 12th-gen, which is available with optional OLED displays, the Surface Laptop sticks with IPS, a 1,300:1 contrast ratio, a 120Hz refresh rate, and a 3:2 aspect ratio. Another notable change in the Surface Laptop 8 is its trackpad. It now provides haptic feedback when you perform various actions in apps and the operating system. It is a relatively new feature that Microsoft brought to Windows 11 in recent updates, and it is only available on certain devices, such as the Logitech MX Master 4, Surface Slim Pen 2, the upcoming Surface Laptop Ultra, and now the Surface Laptop 8. The new Surface Laptop with the new Surface Pro Like its tablet-shaped sibling, the new Surface Laptop is notably more expensive. It starts at a $1,599 for a 13.8-inch configuration with a 256GB SSD and 16GB of RAM. However, in the US, the base model has double the storage while keeping the same price. Available configurations include up to 64GB of memory and up to 2TB SSD (user-removable PCIe Gen4). The Surface Laptop 8 is now available for purchase on the official Microsoft website.
    • Microsoft announces 12th-gen Surface Pro with Snapdragon X2 processors by Taras Buria So far, 2026 has been rich in Surface announcements. Microsoft started with a fresh lineup of Surface for Business devices powered by Intel's new Core Ultra 300 processors. Then the company revealed the Surface Laptop Ultra, its most powerful laptop with NVIDIA's RTX Spark processor. Now, it is time for new Surface Pro and Surface Laptop models with Qualcomm processors. Microsoft's original Copilot+ PCs with Snapdragon X1 chips debuted in late May 2024. Two years later, Microsoft is finally updating the lineup with new models featuring Snapdragon X2 processors. The 12th-gen Surface Pro continues the well-established formula of Microsoft's flagship tablet, and Microsoft is not even changing colors, as the tablet will be available in three colors: Dune, Black, and Platinum. The most important changes are mostly hidden inside. Microsoft switched from the Snapdragon X1 to the new Snapdragon X2, which promises up to 53% faster graphics performance than the previous generation and up to 15.5 hours of battery life. The built-in NPU is also much more powerful, and it can run at up to 80 TOPS for on-device AI processing. Like before, the new Surface Pro is available with a 13-inch IPS display, and Microsoft is still offering OLED as a separate, more expensive configuration. Speaking of configurations, the Surface Pro will be available with a 10-core Snapdragon X2 Plus or a 12-core Snapdragon X2 Elite. Microsoft expanded the available RAM configurations to 64GB (previously 32GB was the maximum), while storage remains unchanged at 256GB, 512GB, or 1TB of user-replaceable PCIe Gen4 SSDs. The new Surface Pro and the Surface Laptop Other specs remain mostly unchanged. The computer has the same 1440p Windows Hello webcam, two USB4 ports for charging, data, and display output, Wi-Fi 7 and Bluetooth 5.4 support, dual speakers, and compatibility with Surface Pro Signature and Flex keyboards. With that said, there is one very important aspect of the Surface Pro that changed significantly, and it is the price. While the previous-gen Surface Pro launched at $999 for the base configuration, in 2026, the entry-level Surface Pro with Snapdragon X2, 16GB of memory, and 256GB will set you back an eye-watering $1,499. To sweeten the pill, Microsoft is running a limited-time promotion where Surface Pro buyers can get a free Surface Pro 13-inch Keyboard. The promo runs from June 16 through June 30. The new Surface Pro is available now on the official Microsoft Store website.
    • MakeMKV 1.18.4 Beta by Razvan Serea MakeMKV is a format converter, otherwise called "transcoder". It converts the video clips from proprietary (and usually encrypted) disc into a set of MKV files, preserving most information but not changing it in any way. The MKV format can store multiple video/audio tracks with all meta-information and preserve chapters. There are many players that can play MKV files nearly on all platforms, and there are tools to convert MKV files to many formats, including DVD and Blu-ray discs. Additionally MakeMKV can instantly stream decrypted video without intermediate conversion to wide range of players, so you may watch Blu-ray and DVD discs with your favorite player on your favorite OS or on your favorite device. Reads DVD and Blu-ray discs Reads Blu-ray discs protected with latest versions of AACS and BD+ Preserves all video and audio tracks, including HD audio Preserves chapters information Preserves all meta-information (track language, audio type) Fast conversion - converts as fast as your drive can read data. No additional software is required for conversion or decryption. Available for Windows, Mac OS X and Linux Functionality to open DVD discs is free and will always stay free. All features (including Blu-ray decryption and processing) are free during BETA. MakeMKV 1.18.4 changelog: Small improvements and bugfixes Notable bug fixes: Fixed linux armhf binary crash on certain architectures Download: MakeMKV 1.18.4 Beta | 15.7 MB (Free, paid upgrade available) Download: MakeMKV for Mac OS X | 41.9 MB Links: MakeMKV Website | MakeMKV for Linux | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Year In
      Console General earned a badge
      One Year In
    • One Year In
      Twozo Technologies earned a badge
      One Year In
    • One Month Later
      Twozo Technologies earned a badge
      One Month Later
    • Week One Done
      Twozo Technologies earned a badge
      Week One Done
    • Veteran
      branfont went up a rank
      Veteran
  • Popular Contributors

    1. 1
      +primortal
      523
    2. 2
      +Edouard
      209
    3. 3
      PsYcHoKiLLa
      113
    4. 4
      Steven P.
      90
    5. 5
      Nick H.
      71
  • Tell a friend

    Love Neowin? Tell a friend!