1

I have heard that you can block the use of Whatsapp and Facebook on your Wi-Fi network. Please guide me how to do this.

2
  • What kind of Wi-Fi router are you using? What other equipment is it hooked up to? Commented Apr 7, 2015 at 5:51
  • 1
    I am Using TP-Link router. I am planning to allow all employees to use thier phone with WI-fi Commented Apr 7, 2015 at 6:31

1 Answer 1

2

You can just block all facebook IPs in your firewall. The problem is that there are many and they might change over time. In our organization we have a one line script that gives us a list of all facebook IPs that we block in the firewall.

For facebook we use the AS Number. Looks like Facebook has 3 of them AS63293 AS54115 AS32934. Search for facebook at the BGP toolkit of Hurricane Eletric Internet Service

To get all of them we use this command:

{ whois -h whois.radb.net -- '-i origin AS32934' ; whois -h whois.radb.net -- '-i origin AS63293'; whois -h whois.radb.net -- '-i origin AS54115'; } | grep ^route | grep -v route6 | awk '{print $2}' > /var/www/block_lists/facebook.txt

That list is generated once a day and shared over HTTP. The firewall/router (pfsense) reads it and blocks all listed IPs. If you fine with a little bit more manual work you can generate that list periodically yourself and plug it into your router/firewall software. Here is the current list for Facebook (07.04.2015 IPv4):

Whatsapp does not have a AS number so you would have to get the IPs of the domain. e.g.:

{ host -t a whatsapp.com ; host -t a web.whatsapp.com; host -t a www.whatsapp.com; } | awk '{print $4}' > /var/www/block_lists/whatsapp.txt

The problem with that is that you will need to get every domain and sub-domain.

2
  • What about Whatsapp? Commented Apr 7, 2015 at 6:32
  • 1
    I've edited my answer, it does now include also an idea for whatsapp Commented Apr 7, 2015 at 10:15

Not the answer you're looking for? Browse other questions tagged .