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

    Youtube Blocking in pfblocker via IP

    pfBlockerNG
    4
    14
    576
    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.
    • antgallaA
      antgalla @Gertjan
      last edited by

      @SteveITS
      I need to block website with specific device only. I can't used domain overrides because its blocking all devices.πŸ˜•

      S antgallaA 2 Replies Last reply Reply Quote 0
      • S
        SteveITS Galactic Empire @antgalla
        last edited by

        @antgalla I have excellent news for you. :) In DNS Resolver settings try:

        661a2e61-d7ce-4fb6-9813-07aeefbd9161-image.png

        Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
        When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
        Upvote πŸ‘ helpful posts!

        1 Reply Last reply Reply Quote 1
        • antgallaA
          antgalla @antgalla
          last edited by

          @SteveITS
          Niceee, I will try it later! Can I put alias instead of IP?

          S GertjanG 2 Replies Last reply Reply Quote 0
          • S
            SteveITS Galactic Empire @antgalla
            last edited by

            @antgalla said in Youtube Blocking in pfblocker via IP:

            @SteveITS
            Niceee, I will try it later! Can I put alias instead of IP?

            It’s raw unbound config so I doubt it knows about pfSense aliases.

            Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
            When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
            Upvote πŸ‘ helpful posts!

            antgallaA 1 Reply Last reply Reply Quote 0
            • GertjanG
              Gertjan @antgalla
              last edited by Gertjan

              @antgalla said in Youtube Blocking in pfblocker via IP:

              Can I put alias instead of IP?

              Alias ?
              Recall : aliases can't be used by firewall rule, they have to be resolved first. Aliases are by default re resolved every 5 minutes.
              You still have to put in the host overrides in the DNS config, what @SteveITS showed is a good method, so it points to a non usable IP like 127.0.0.2.
              If you don't put the host overrides in place, you'll get back the 'real' IPs - the ones that can change every 300 seconds.
              300 seconds ? yes : check for yourself :

              98851cfd-878b-4989-a0b4-ef3effce55c1-image.png

              that list change all the time !
              More details :

              [25.03-BETA][root@pfSense.bhf.tld]/root: dig www.youtube.com
              .....
              ;; QUESTION SECTION:
              ;www.youtube.com.               IN      A
              
              ;; ANSWER SECTION:
              www.youtube.com.        237     IN      CNAME   youtube-ui.l.google.com.
              youtube-ui.l.google.com. 237    IN      A       172.217.20.206
              youtube-ui.l.google.com. 237    IN      A       216.58.215.46
              youtube-ui.l.google.com. 237    IN      A       216.58.213.78
              youtube-ui.l.google.com. 237    IN      A       142.250.179.78
              youtube-ui.l.google.com. 237    IN      A       142.250.179.110
              youtube-ui.l.google.com. 237    IN      A       142.250.178.142
              youtube-ui.l.google.com. 237    IN      A       142.250.201.174
              youtube-ui.l.google.com. 237    IN      A       172.217.18.206
              youtube-ui.l.google.com. 237    IN      A       216.58.214.78
              youtube-ui.l.google.com. 237    IN      A       142.250.74.238
              youtube-ui.l.google.com. 237    IN      A       142.250.75.238
              youtube-ui.l.google.com. 237    IN      A       216.58.214.174
              youtube-ui.l.google.com. 237    IN      A       172.217.20.174
              ....
              

              so 237 seconds left before the list changes ...

              So chances exist that the firewall, your rule, blocks IPs that aren't used anymore, and new will pop up, the one you don't block (yet) .... to be take in account 300 seconds later, (and around we go) .... etc ...

              Anyway, try things out for yourself.

              No "help me" PM's please. Use the forum, the community will thank you.
              Edit : and where are the logs ??

              1 Reply Last reply Reply Quote 0
              • antgallaA
                antgalla @SteveITS
                last edited by antgalla

                @SteveITS
                Appreciate your response on this matter.
                But the main problem here is still included our ISP when Im blocking the youtube or netflix via Pfblocker IP.

                I do your suggestion to edit the /var/db/aliastables/Netflix or YT comment out the ISP, it works but when I reload the pfblockerNg IP the problem returns.

                GertjanG P antgallaA 3 Replies Last reply Reply Quote 0
                • GertjanG
                  Gertjan @antgalla
                  last edited by

                  @antgalla said in Youtube Blocking in pfblocker via IP:

                  But the main problem here is still included our ISP when Im blocking the youtube or netflix via Pfblocker IP.

                  I do your suggestion to edit the /var/db/aliastables/Netflix or YT comment out the ISP, it works but when I reload the pfblockerNg IP the problem returns.

                  pfBlockerng creates these files with the info you (?)'ve entered in the pfBlockerng GUI.
                  Can you show with image how you've set up these 'YT' and 'Netflix' IP lists so I can reproduce this ?

                  No "help me" PM's please. Use the forum, the community will thank you.
                  Edit : and where are the logs ??

                  1 Reply Last reply Reply Quote 0
                  • P
                    Patch @antgalla
                    last edited by Patch

                    @antgalla said in Youtube Blocking in pfblocker via IP:

                    But the main problem here is still included our ISP when Im blocking the youtube or netflix

                    You can easily white list particular IP address such as a range within that used by your ISP. Create alias containing the white list and add a rule to allow these addresses which is evaluated prior to the pfblocker rule.

                    If your ISP sources netflix/youtube data you will need to ensure the white list does not include the addresses your ISP uses for that.

                    @Gertjan said in Youtube Blocking in pfblocker via IP:

                    he 'real' IPs - the ones that can change every 300 seconds.

                    I agree data scraping by the very big USA companies is annoying.
                    For devices using pfsense DNS, adding host over-rides / DNS blocking is an excellent idea.

                    Where that does not achieve the desired results IP blocking could still be used however doing so requires an IP alias which support persistence (old IP addresses kept in the alias for a configurable time). Doing so exploits the fact google/facebook/amazon can change where new lookups will go, but they have to keep all old addresses active till all normal user applications stop using them (otherwise their application randomly stops working for normal users). By far the majority of relevant transmissions would then be caught as pfsense could then be configured to update the alias more often than most user devices DNS updates.

                    Unfortunately pfsense has not yet added this alias option. Doing so would require maintaining an IP list with last DNS lookup time, then deleting only those past the expiry time.

                    1 Reply Last reply Reply Quote 0
                    • GertjanG Gertjan referenced this topic on
                    • antgallaA
                      antgalla @antgalla
                      last edited by

                      @Gertjan
                      please see imgs below. As you can see in the second img there is no ISP IP(..113.67) included.

                      pfb dashboard.png

                      pfbs.png

                      GertjanG 1 Reply Last reply Reply Quote 0
                      • GertjanG
                        Gertjan @antgalla
                        last edited by

                        @antgalla

                        Above, I though the YT (Youtube) list introduced your WAN IP.
                        Now it's the Netflix list ?

                        Btw :

                        f1cc7fa5-e58d-4502-98d9-9293e29abe39-image.png

                        I'm not sure what this tells me : you get a list with IPv4 to block from netflix itself ( 😊 ) (and as soon as it is blocked, how could pfBlocker resolve and access https://www.netflix.com/... to get an update of this list ?)

                        I've an idea :
                        Knowing that pfBlockerng doesn't do anything when you've installed it.
                        Knowing that your WAN IP isn't part of any list that you've not created yourself,
                        I really presume you didn't add manually your WAN IP 'somewhere' in a file yourself to be used by pfSense.
                        Get a backup (export) of the config of pfSense, open it with a text editor (Notepad++) and look where your WAN IP is mentioned - in a pfBlockerng section. That will give you the place in what part of the GUI it has been set.

                        No "help me" PM's please. Use the forum, the community will thank you.
                        Edit : and where are the logs ??

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