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

Guide to filtering web content (http and https) with pfsense 2.3

Scheduled Pinned Locked Moved Documentation
190 Posts 54 Posters 222.8k 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.
  • M
    maverik1
    last edited by Aug 17, 2016, 5:03 AM

    Lots of good info! Thanks!!

    Any clue as how to get android phones to be able to receive push notifications when using wifi via router connected to a pfsense box?  I've enabled that particular vlans firewall to any any and the wan is any any as well. No filtering going on for that vlan via squid or squidguard.  Cannot for the life of me understand what is blocking notifications. Very annoying.

    1 Reply Last reply Reply Quote 0
    • C
      chris4916
      last edited by Aug 17, 2016, 5:31 AM

      @maverik1:

      Any clue as how to get android phones to be able to receive push notifications when using wifi via router connected to a pfsense box?  I've enabled that particular vlans firewall to any any and the wan is any any as well. No filtering going on for that vlan via squid or squidguard.  Cannot for the life of me understand what is blocking notifications. Very annoying.

      What "notification" are you speaking about?
      I'm confused  :-[

      Jah Olela Wembo: Les mots se muent en maux quand ils indisposent, agressent ou blessent.

      1 Reply Last reply Reply Quote 0
      • M
        maverik1
        last edited by Aug 18, 2016, 12:36 AM

        I was speaking about push notifications on android and iOS based phones. I think I've got it working..hopefully.

        1 Reply Last reply Reply Quote 0
        • M
          maverik1
          last edited by Aug 18, 2016, 12:39 AM

          @aGeekHere:

          Update Youtube safe mode
          Click add under Host overrides
          Host = www
          Domain = youtube.com
          IP =  216.239.38.120
          Description = youtube
          Save
          NOTE: Safe search for youtube is not as advanced as google safe search, which results in a lot of safe content be filtered out.

          How can we get this working with mobile devices Android and iOS that use the youtube mobile app or m.youtube.com?

          1 Reply Last reply Reply Quote 0
          • C
            chris4916
            last edited by Aug 18, 2016, 7:49 AM

            @maverik1:

            I was speaking about push notifications on android and iOS based phones. I think I've got it working..hopefully.

            Sorry but I still don't understand what "notification" means here and if you managed to make this working, you could at least share it (i.e. what did you do?) with other forum members  ;)

            Jah Olela Wembo: Les mots se muent en maux quand ils indisposent, agressent ou blessent.

            1 Reply Last reply Reply Quote 0
            • M
              maverik1
              last edited by Aug 18, 2016, 5:01 PM

              @chris4916:

              Sorry but I still don't understand what "notification" means here and if you managed to make this working, you could at least share it (i.e. what did you do?) with other forum members  ;)

              Push notifications are alerts that are received by cellular phones;mostly smart phones, for different types of apps such as social media, email, games and whatnot. I have no issues receiving these alerts when using data only. However, when I was on my wifi network they were not coming through. I spend a few weeks working with the firewall rules and proxy settings trying everything I could think of to troubleshoot the issue. Turns out the problem was with the phone and not pfsense.

              1 Reply Last reply Reply Quote 0
              • K
                kpa
                last edited by Aug 25, 2016, 6:39 PM

                I'd be very surprised if all those "push" system weren't all emulated by polling a server periodically, that kind of set up needs absolutely nothing else but an outgoing connection from the device to the server. The other option would be a service running on the device and the notifications would be then really pushed on the device by an incoming connection from the server to the device. I don't think you'd want implement it like that however  ;)

                1 Reply Last reply Reply Quote 0
                • L
                  laurenzzo
                  last edited by Aug 30, 2016, 8:11 AM Aug 27, 2016, 12:43 PM

                  @aGeekHere:

                  […]

                  First we are going to setup squidguard
                  Update
                  In squidguard under General settings
                  Tic enable
                  Tic Enable log
                  Tic Enable log rotation
                  Tic enable blacklist
                  Under Blacklist URL add http://www.shallalist.de/Downloads/shallalist.tar.gz
                  Save
                  apply (you must always hit apply for any changes you made to squidguard).

                  In Package/Proxy filter SquidGuard: General settings/General settings
                  click blacklist
                  enter http://www.shallalist.de/Downloads/shallalist.tar.gz
                  download
                  wait to finish

                  […]

                  Hi aGeekHere,

                  Thanks a lot for your guide !
                  ~~I tried to follow your steps to get my blacklist downloaded but without success.

                  Could you please have a look on my post for more details ?~~
                  https://forum.pfsense.org/index.php?topic=117314.msg649961#msg649961

                  I really don't understand why the download doesn't work…

                  Thanks in advance for any help !

                  EDIT : SOLVED !
                  this was an issue with Firefox…
                  Could you please update your nice guide with a small note ? (e.g. "don't use Firefox to download the blacklist, IE do the job correctly")

                  Thanks !

                  Kind regards,
                  Laurenzzo

                  1 Reply Last reply Reply Quote 0
                  • J
                    jadog
                    last edited by Sep 2, 2016, 1:21 PM

                    Thanks for taking the time to post this excellent guide! Just a few additions I would recommend adding.

                    YouTube mobile still allows unrestricted access. Including the below corrected it for me.

                    
                    Click add under Host overrides
                    Host = m
                    Domain = youtube.com
                    IP =  216.239.38.120
                    Description = youtube mobile
                    Save
                    

                    Also when using vi after you ssh into your router, using wq does not allow saving. You need to use ":wq" (without the quotes). All working perfectly for me!

                    1 Reply Last reply Reply Quote 1
                    • E
                      eixel05
                      last edited by Sep 7, 2016, 2:03 AM Sep 6, 2016, 6:06 AM

                      Hi,

                      First of all thank you so much for this guide, just what I've been looking for!

                      Before this guide I was using Transparent+MITM approach but because some HTTPS sites doesn't load as they should (I'm not sure if the cause was indeed MITM but after turning it off the sites loads fine)

                      I followed this guide thoroughly, HTTP filtering works fine but I don't know if HTTPS filtering is working? Before, I am using the tail command (/var/squid/logs/access.log) and while MITM is on, https site access is being logged but now with this approach, not a single HTTPS is being logged.

                      Is there another way to check if indeed this approach is working for HTTPS?

                      Out-of-topic question, since my main purpose for this Proxy server is local cache, Are HTTPS objects being cache as well? or only HTTP?

                      Update (09/07/2016): NVM, I figured it out :D all is working great, thank you so much for this guide!

                      I'M REALLY SORRY FOR BEING NOOB, I just started my way to "Networking", please be patient with me.

                      1 Reply Last reply Reply Quote 0
                      • M
                        Maxim_Al
                        last edited by Oct 28, 2016, 1:25 AM Sep 16, 2016, 3:58 AM

                        Can anybody help me?
                        I test  pfsense for gateway/proxy for a company. But I have one strange trouble:
                        The pfsense is installed and work but if I use it for access (through proxy) to https://code.getmdl.io/1.2.1/material.grey-orange.min.css  I have in proxy log:
                        Date IP Status Address User Destination
                        16.09.2016 14:37:28 192.168.1.222 TAG_NONE/503 code.getmdl.io:443 - -
                        What is it an how I must to do that resolve it?

                        UPDATE 28/10/2016 - This was provider :) not pfsense!

                        1 Reply Last reply Reply Quote 0
                        • K
                          klmiciano
                          last edited by Oct 28, 2016, 1:20 AM

                          Which rule should be above between these two?

                          FIRST – 
                          "Now we are going to create a rule that will force the network to use our route as the DNS server.
                          In Firewall/NAT/Port forward
                          add a new rule

                          Interface = LAN
                          Protocol = TCP/UDP
                          Source ports = *
                          Dest address = *
                          Dest ports = 53
                          NAT IP = 127.0.0.1
                          NAT Ports = 53
                          Description = Redirect DNS
                          LAN TCP/UDP * * * 53 127.0.0.1 53 Redirect DNS
                          Save"

                          SECOND --
                          "To stop users from bypassing your proxy setup a new firewall lan rule and block port 80 and 443
                          IPv4 TCP * * * 80 - 443 * none.
                          Save"

                          1 Reply Last reply Reply Quote 0
                          • K
                            klmiciano
                            last edited by Oct 28, 2016, 1:36 AM

                            @aGeekHere:

                            I found this post and I am researching to see how well it will work.

                            https://forum.pfsense.org/index.php?topic=106016.0

                            The idea is to use the wpad for https content and have a transperrent proxy for http traffic. This could remove the bypass rules for programs with no proxy settings and need to use port 80.

                            Update
                            OK it looks to be working fine, now all the traffic that was block on port 80 is now using the transperrent proxy, you will still need a pass rule for port 443 but not for port 80.

                            So you can use the wpad for http and https filtering (or for just https) and enable the transperrent proxy to catch the leftovers.

                            How to do this?

                            1 Reply Last reply Reply Quote 0
                            • A
                              aGeekhere
                              last edited by Oct 29, 2016, 8:21 AM

                              @klmiciano:

                              Which rule should be above between these two?

                              FIRST – 
                              "Now we are going to create a rule that will force the network to use our route as the DNS server.
                              In Firewall/NAT/Port forward
                              add a new rule

                              Interface = LAN
                              Protocol = TCP/UDP
                              Source ports = *
                              Dest address = *
                              Dest ports = 53
                              NAT IP = 127.0.0.1
                              NAT Ports = 53
                              Description = Redirect DNS
                              LAN TCP/UDP * * * 53 127.0.0.1 53 Redirect DNS
                              Save"

                              SECOND --
                              "To stop users from bypassing your proxy setup a new firewall lan rule and block port 80 and 443
                              IPv4 TCP * * * 80 - 443 * none.
                              Save"

                              first one on top

                              @klmiciano:

                              @aGeekHere:

                              I found this post and I am researching to see how well it will work.

                              https://forum.pfsense.org/index.php?topic=106016.0

                              The idea is to use the wpad for https content and have a transperrent proxy for http traffic. This could remove the bypass rules for programs with no proxy settings and need to use port 80.

                              Update
                              OK it looks to be working fine, now all the traffic that was block on port 80 is now using the transperrent proxy, you will still need a pass rule for port 443 but not for port 80.

                              So you can use the wpad for http and https filtering (or for just https) and enable the transperrent proxy to catch the leftovers.

                              How to do this?

                              after you have the wpad setup and working enable transperrent proxy in squid

                              Never Fear, A Geek is Here!

                              1 Reply Last reply Reply Quote 0
                              • P
                                phunni
                                last edited by Nov 24, 2016, 5:08 PM

                                If I configure a VPN, I assume this will all still work? i.e. the filtering is done post decryption?

                                I'm not using the wpad portion of this, so I've ignore d what it says about VPNs in there…

                                1 Reply Last reply Reply Quote 0
                                • J
                                  jbourn1907
                                  last edited by Nov 25, 2016, 8:45 AM

                                  Sorry I'm new in pfsense.

                                  I have an internal DNS server windows server 2008. How can I blocked internal computers to direct access to http. I want to filter it through pfsense firewall. Can you give me some screen shots or sample of rules and where can I put this?

                                  I want all computers to go first in pfsense proxy before connecting to internet. I already configure transparent proxy.

                                  Thanks for the help.

                                  1 Reply Last reply Reply Quote 0
                                  • A
                                    aGeekhere
                                    last edited by Nov 26, 2016, 1:04 AM

                                    "How can I blocked internal computers to direct access to http"
                                    read the part in the guide about blocking port 80 and 443 and instead of using pfsense as your DNS server use your internal one, (for more help on this issue ask in the Cache/Proxy forum).

                                    "If I configure a VPN, I assume this will all still work? i.e. the filtering is done post decryption?….I'm not using the wpad portion of this, so I've ignore d what it says about VPNs in there..."
                                    If the transparent proxy has issue with the vpn you may need to bypass it.

                                    Never Fear, A Geek is Here!

                                    1 Reply Last reply Reply Quote 0
                                    • G
                                      genesislubrigas
                                      last edited by Dec 16, 2016, 12:19 PM

                                      thanks for this tutorial.  i am not using dns resolver but bind.  can you also show how to configure bind.

                                      1 Reply Last reply Reply Quote 0
                                      • A
                                        aGeekhere
                                        last edited by Dec 21, 2016, 3:39 AM

                                        Have not used bind, but after a quick google try http://blog.muhammadattique.com/configuring-bind-dns-server-on-pfsense-firewall/

                                        If it does not help ask in the main forum

                                        Never Fear, A Geek is Here!

                                        1 Reply Last reply Reply Quote 0
                                        • N
                                          nib01
                                          last edited by Dec 23, 2016, 8:46 PM

                                          "To stop users from bypassing your proxy setup a new firewall lan rule and block port 80 and 443
                                          IPv4 TCP * * * 80 - 443 * none.
                                          Save

                                          Set your system to automatically detect settings (for windows it is in internet options connections lan settings).

                                          You also have to set up the proxy setting for each program that cant connect (firefox, graphics drive software, vlc etc)

                                          If you have programs that cannot connect and have no proxy setting you need to setup a firewall aliases
                                           Firewall/Aliases/IP
                                          and add the destination server ip (use wire shark to help find the blocked Ips or in your firewall block rule enable Log packets that are handled by this rule, use http://ip-lookup.net/index.php to check what it is and add to the Aliases. If it is part of a domain add the domain)
                                          now create a new firewall lan rule
                                          IPv4 TCP * * * passAliases 80- 443 * pass rule.

                                          Save"

                                          Not sure where to setup/configure above firewall lan rule.

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            [[user:consent.lead]]
                                            [[user:consent.not_received]]