LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Block Youtube (https) through iptables (https://www.linuxquestions.org/questions/linux-server-73/block-youtube-https-through-iptables-4175499252/)

crackconfig 03-24-2014 05:50 AM

Block Youtube (https) through iptables
 
Hi All,

Currently I 've blocked the https facebook/twitter access through squid and iptables with the following rule for individual ip's-


-A PREROUTING -s 192.168.x.x -m iprange --dst-range xx.xxx.xxx.xxx-xx.xxx.xxx.xxx -i eth1 -p tcp -m tcp --dport 443 -j DNAT --to-destination 192.168.x.x:80

I was wondering to apply the same rule to block the youtube https access. but after dig and nslookup results i found that youtube and google are using the same ip range. i don't want google to be blocked in my network.
Please suggest the best to block youtube https access.



Thanks!

yooy 03-24-2014 06:56 AM

Try costumizing this script, it restarts browser based on browser title.

crackconfig 03-24-2014 07:08 AM

Thanks a lot for the reply yooy. I am sorry. didnt ring any bell. how would i use it on my gateway server. will i have to block the ipaddresses first like i said before running this bash ? :(

yooy 03-24-2014 07:16 AM

Sorry that script is intended to block from certain websites on desktop computer&laptops, not on a gateway server. If youtube and google are using same ip than you need to find the difference and block something that is unique to youtube.

crackconfig 03-24-2014 07:25 AM

Alright. Thanks for your time.


All times are GMT -5. The time now is 01:36 AM.