block HTTP HTTPS Facebook pfSense

Facebook works on HTTPS and there are some tutorials that help you to install “Squid3” Development Package on pfSense to configure pfSense for blocking some of websites but I found issues with it and it wasn’t worthy for my work environment along with “blocking Facebook with pfSense”. I have tried many of tutorials to block Facebook on pfSense box and some of them works but these also blocks some other HTTPS services. Finally, I block Facebook on pfSense with Facebook IP Addresses. I know, it might be quite funny or awkward but it’s the solution that leaves no stone to your efforts and users cannot access it with IP Address, HTTP or HTTPS or with other Facebook TLDs. Let’s get started;

Solution:

  1. Find OriginAS or ASN number of Facebook IP registration – I found it and its “AS32934” , can also be confirmed here https://www.facebook.com/peering/
  2. Use below Command on any internet connected Linux Box / Terminal to get all IPs;
    1. whois -h whois.radb.net '!gAS32934'
  3. Access your pfSense and create New Alias with any distinguished name like “FacebookBlock”;
  4. Type of Alias
    1. – Network(s) , do mention all IPs that you get from above command;
    2. – URL, do create a txt file containing all IPs and upload to some webserver and give that path in pfSense.
  5. Go to Firewall
  6. Click on Rules
  7. Click on LAN to create a new Rule.
  8. Create and Move on Top (where you like to block for all users) to all Rules.
  9. Select - Block/Reject all
  10. In the section “Instead IP Address” , Simple put FacebookBlock
  11. Save and Save Changes

It’s done, you can check it now and there must be no Facebook for all applicable users.

.

Get Socially Engaged with IP Address and Host Team !