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

Squid/SquidGuard NONE/409 and DNS issue

Scheduled Pinned Locked Moved Cache/Proxy
69 Posts 9 Posters 20.3k 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.
  • A
    aGeekhere @shawn8888
    last edited by May 1, 2021, 2:44 PM

    @shawn8888
    You can look at squid real time to see if that device comes up

    Never Fear, A Geek is Here!

    S 1 Reply Last reply May 1, 2021, 3:05 PM Reply Quote 0
    • S
      shawn8888 @aGeekhere
      last edited by May 1, 2021, 3:05 PM

      @ageekhere

      Thanks!

      So I did all the below, and the bypass finally works:

      1. setup the rules in LAN like this:

      3a9c56ce-974e-4491-a737-82d802257053-image.png

      1. change the wpad.dat like this:
      function FindProxyForURL(url, host) {
          if (isInNet(myIpAddress(), "192.168.100.159", "255.255.255.0")) ||
            (isInNet(myIpAddress(), "192.168.100.155", "255.255.255.0")) 
          return "DIRECT";
          return "PROXY 192.168.100.1:3128";
      }
      
      1. add Bypass Proxy for These Source IPs

      1070d290-bb7b-4eb5-ba99-b2129c3d0d20-image.png

      K 1 Reply Last reply May 1, 2021, 3:21 PM Reply Quote 0
      • K
        KOM @shawn8888
        last edited by May 1, 2021, 3:21 PM

        @shawn8888 Something is wrong with your config. You don't need WPAD if you're still running transparent mode. It's one or the other.

        A S 2 Replies Last reply May 1, 2021, 4:20 PM Reply Quote 0
        • A
          aGeekhere @KOM
          last edited by May 1, 2021, 4:20 PM

          @kom
          I think if you go direct with the WPAD the transparent proxy will see traffic going directly through port 80/443 and will redirect the traffic through the proxy again. So by adding the bypass in squid it prevents it from being routed through the transparent proxy.

          If you turn off the transparent proxy and just rely on the WPAD some software may have connection issues.

          Never Fear, A Geek is Here!

          1 Reply Last reply Reply Quote 0
          • S
            shawn8888 @KOM
            last edited by May 1, 2021, 4:20 PM

            @kom
            If I disable transparent mode, then all my devices lost Internet. So honestly, at this point, I don't know if WPAD or transparent mode is working.
            However, twitter image/video now works both on my PC and my iPad, and it didn't work before.

            A 1 Reply Last reply May 1, 2021, 4:23 PM Reply Quote 0
            • A
              aGeekhere @shawn8888
              last edited by aGeekhere May 1, 2021, 4:24 PM May 1, 2021, 4:23 PM

              @shawn8888
              A way to test if the WPAD is working is temporary turn off the transparent proxy and make sure autoconfig in turn on. If you internet browser uses the proxy then it is working.

              Never Fear, A Geek is Here!

              S 1 Reply Last reply May 1, 2021, 4:33 PM Reply Quote 0
              • S
                shawn8888 @aGeekhere
                last edited by May 1, 2021, 4:33 PM

                @ageekhere

                What do you mean "autoconfig"?
                I followed the help here:
                81501746-f338-4be6-b651-7ec79dc8a54c-image.png

                If I turn off transparent mode and change firefox network settings:

                24f747f0-429e-4e42-ae0a-fbf316052aff-image.png

                Still no Internet. So I guess WPAD never worked...

                K 1 Reply Last reply May 1, 2021, 7:43 PM Reply Quote 0
                • K
                  KOM @shawn8888
                  last edited by May 1, 2021, 7:43 PM

                  @shawn8888 What happens when you try to resolve 'wpad' or 'wpad.yourdomain.lol' on your network? Does it come back with the IP address of the server holding the wpad.dat file? IIRC your wpad.dat file to live on an http server or a trusted https server. Any cert errors will stop the wpad file from being read.

                  S 1 Reply Last reply May 2, 2021, 12:07 AM Reply Quote 0
                  • S
                    shawn8888 @KOM
                    last edited by shawn8888 May 2, 2021, 12:09 AM May 2, 2021, 12:07 AM

                    @kom
                    I think I have followed all the steps on doc page.
                    Ping/dns is fine, and I can download the wpad.dat file from the browser.

                    One question though:
                    If the transparent mode works, why do you need wpad? Is that because transparent mode is bugy?

                    c2a88bb4-beef-4f4a-94ab-a36babaa43d9-image.png

                    2a46c099-6db4-44ad-a79b-03d0a6b17e5d-image.png

                    e0f97b4b-8c96-4b35-b8d5-d35798a1b121-image.png

                    fe22b9ea-2d79-4173-971c-b2ade0dc4c48-image.png

                    A 1 Reply Last reply May 2, 2021, 2:02 AM Reply Quote 0
                    • A
                      aGeekhere @shawn8888
                      last edited by aGeekhere May 2, 2021, 2:05 AM May 2, 2021, 2:02 AM

                      @shawn8888
                      To set auto config in windows go to
                      Control Panel - Internet Properties - connections - LAN settings and select Automatically detect settings.

                      Make sure programs are set to Use system proxy settings.
                      Test with chrome for now as firefox in the past had an outstanding bug with auto configuring a proxy which i am not sure if it was fixed.

                      "If the transparent mode works, why do you need wpad? Is that because transparent mode is bugy?"

                      From memory transparent proxy can break certificates resulting in a failed connection, though someone with more knowledge would have to confirm the technical details.

                      Also in your WPAD add to the top

                      if (shExpMatch(host, "ENTER YOUR PFSENSE DOMAIN HERE")) return "DIRECT";
                      

                      use https://app.thorsen.pm/proxyforurl for testing the WPAD for errors

                      Never Fear, A Geek is Here!

                      S 1 Reply Last reply May 2, 2021, 2:41 AM Reply Quote 0
                      • S
                        shawn8888 @aGeekhere
                        last edited by May 2, 2021, 2:41 AM

                        @ageekhere

                        Thank you guys for the endless help. I haven't given up because of you!

                        My Internet properties look good.
                        Chrome also points to Auto detect.
                        My wpad.dat now looks like below and the proxy tester didn't complain
                        I also tested on my iPhone, iPad, same as my PC. As soon as I disable transparent mode, Internet drops.
                        I checked my iOS -> wifi -> HTTP PROXY -> Configure Proxy -> Automatic
                        All my devices can download the wpad.dat file from the browser:
                        http://192.168.100.1/wpad.dat

                        function FindProxyForURL(url,host)
                        {
                        if (shExpMatch(host, "pfsense.mydomain.com")) 
                          return "DIRECT";
                        
                        if (isInNet(myIpAddress(), "192.168.100.155", "255.255.255.0")) 
                          return "DIRECT";
                        
                          return "PROXY 192.168.100.1:3128";
                        }
                        

                        bee1a4e7-cc0c-4b47-bef4-10c3c1c65cb7-image.png

                        fe0e698c-9ef3-4fc3-83e6-2f154da8bc27-image.png

                        A 1 Reply Last reply May 2, 2021, 3:56 AM Reply Quote 0
                        • A
                          aGeekhere @shawn8888
                          last edited by aGeekhere May 2, 2021, 4:01 AM May 2, 2021, 3:56 AM

                          @shawn8888
                          I think i see the issue

                          Under Additional BOOTP/DHCP Options change to

                          252 String "http://192.168.1.1/wpad.dat"
                          252 String "http://192.168.1.1/wpad.da"
                          252 String "http://192.168.1.1/proxy.pac"
                          

                          Under DNS ResolverGeneral Settings Host Overrides add

                          wpad	YourPfsenseDomain	192.168.1.1	wpad
                          

                          https://docs.netgate.com/pfsense/en/latest/recipes/http-client-proxy-wpad.html?highlight=wpad

                          "A WPAD host may be supplied via DHCP numbered option 252 (string value containing the entire URL to the WPAD file) or DNS, which is easy to do with the built-in DNS forwarder."

                          Make sure you get the correct YourPfsenseDomaid, something like pfsensedomain.local
                          You can check in windows by using cmd and look for Connection - specific DNS suffix

                          Never Fear, A Geek is Here!

                          S 1 Reply Last reply May 2, 2021, 4:14 AM Reply Quote 0
                          • S
                            shawn8888 @aGeekhere
                            last edited by May 2, 2021, 4:14 AM

                            @ageekhere
                            no luck.
                            From what I read, you only need DHCP or dns resolver. I tried both, and still the same.
                            Even though I am complete newbie about wireshark, I gave it a shot. And I cannot even find string "wpad" in the logs.

                            07192600-66a1-41c5-8a2f-2a8ea55c9368-image.png

                            fbd7ff90-cec7-4895-a029-45a729abfe04-image.png

                            0a89b671-fee8-48bb-b598-64b07fc09702-image.png

                            A K 2 Replies Last reply May 2, 2021, 4:46 AM Reply Quote 0
                            • A
                              aGeekhere @shawn8888
                              last edited by May 2, 2021, 4:46 AM

                              @shawn8888 Try Resetting the States, Diagnostics States Reset States.
                              Also try restarting your pc and router.

                              Never Fear, A Geek is Here!

                              S 1 Reply Last reply May 3, 2021, 12:09 AM Reply Quote 0
                              • K
                                KOM @shawn8888
                                last edited by May 2, 2021, 4:30 PM

                                @shawn8888 Transparent mode isn't buggy per se, it's just that you have to consider other things when using it. You're trying to intercept a data stream that is trying to prevent you from doing so. You either need to install a trusted cert on every device that will use your transparent proxy to void MitM browser errors when using Splice/Bump, or no certs and you use Splice All. If transparent mode works for you then use that but I find explicit mode has less hassles.

                                Are you sure that your proxy works? What happens if you manually set a browser to use it?

                                1 Reply Last reply Reply Quote 0
                                • S
                                  shawn8888 @aGeekhere
                                  last edited by May 3, 2021, 12:09 AM

                                  @ageekhere
                                  I reboot pfSense and client pc. wpad is still not working.

                                  @KOM
                                  "Splice All" is recommended in order to use squidguard, which is the main reason I use squid for.

                                  My proxy ONLY works at Transparent mode.
                                  I have tried turning off Transparent mode and setting proxy manually (set IP and port 3128) on my PC. But it seems that a lot of things are not working. For example, I can open speedteset.net, but when I hit "go" button, it never starts.

                                  K 1 Reply Last reply May 3, 2021, 2:11 AM Reply Quote 0
                                  • K
                                    KOM @shawn8888
                                    last edited by May 3, 2021, 2:11 AM

                                    @shawn8888 When running in explicit mode, how does it not work exactly? What browser error are you getting? Squid normally just works right out of the box.

                                    S 1 Reply Last reply May 3, 2021, 2:31 AM Reply Quote 0
                                    • S
                                      shawn8888 @KOM
                                      last edited by May 3, 2021, 2:31 AM

                                      @kom
                                      What do you mean by "explicit mode"?
                                      Does that mean:
                                      Disable both "Transparent mode" and "Enable SSL filtering.", and manually set clients to use ip:3128 as proxy?

                                      K 1 Reply Last reply May 3, 2021, 3:21 AM Reply Quote 0
                                      • K
                                        KOM @shawn8888
                                        last edited by May 3, 2021, 3:21 AM

                                        @shawn8888 Yes. Explicit means not transparent, no SSL interception. Clients can be manually set or use WPAD once you determine squid is working properly.

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          shawn8888
                                          last edited by shawn8888 May 4, 2021, 5:40 AM May 4, 2021, 5:37 AM

                                          @kom

                                          My proxy now works on explicit mode.
                                          I turned off "Transparent HTTP Proxy" and "HTTPS/SSL Interception".
                                          I also turned off the lan rules, which you suggest for wpad bypass some devices earlier.

                                          d5221e8e-3edb-4e70-bdd6-5b0236204dff-image.png

                                          This allows all LAN devices to go Internet directly by default, right? All my LAN devices can access Internet at this moment.

                                          1. I tested on my iPad to set wifi manually use proxy at IP:3128. It worked. the only thing not working so far is speedtest.net go button. It stays at connecting forever.

                                          bbb6981c-2bfc-4486-8e5c-5cac37f3d0aa-image.png

                                          f331f5d5-448a-4f47-b9ec-dfc51b9fa5af-image.png

                                          1. I tested my PC.
                                            firefox, set proxy in option:

                                          f6ae6639-f7ee-4bd1-a098-28f792691b87-image.png

                                          I find that only http websites get blocked by squidguard. And https blocked websites can passthrough. Is it because https websites are bypassed due to "HTTPS/SSL Interception" being off?

                                          I also tried Chrome and set the proxy like this:
                                          c550de9b-baec-46f6-98bc-dfcadbfe072a-image.png

                                          It's funny that Chrome can not only see squidguard blocks http websites, but also https ones!
                                          speedtest.net go button still not working.
                                          Another thing doesn't work is the local websites. It gives me Access Denied error:

                                          fd39ca15-264d-461c-9da1-fc9aa9acf660-image.png

                                          So I guess the explicit mode works, but I still need wpad or transparent working so I don't have to deal with the clients...

                                          K 1 Reply Last reply May 4, 2021, 1:23 PM Reply Quote 0
                                          41 out of 69
                                          • First post
                                            41/69
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received