squid

Taking care of your Linux box.
Post Reply
venky145
Havaldaar
Posts: 118
Joined: Thu Jan 13, 2005 2:35 pm
Location: qatar
Contact:

squid

Post by venky145 »

hi

i want to block a sites for a particular user. not for entire network .how can i do this.
x2oxen
Major General
Posts: 1114
Joined: Wed Aug 22, 2007 3:17 pm
Location: Faisalabad
Contact:

Post by x2oxen »

There are a lot ways to do so in squid. One of them is

Code: Select all

acl block_user src 0.0.0.0/255.255.255.255 (blocking user ip should be here)
acl block_site url_regex -i yourwebsite.com

http_access deny blokc_site block_user
http_access allow block_user
Muhammad Usman
+92-321-6640501
Chemonics International
http://usmanpk.com
manwerjalil
Lance Naik
Posts: 28
Joined: Wed Apr 30, 2008 10:44 am
Location: Karachi
Contact:

Post by manwerjalil »

hey man

There is very easy way to block webpages for a single user using user computer IP address with IPTABLES and IPCHAIN.

u may create script with iptables and use the following example for blocking single user on specific webpage

iptables -A INPUT -i ethx -p tcp -s useripaddress -d www.yahoo.com --dport 80 -j DROP


if you haven't knowledge on iptables do let me know i'll send you script


Thank you
Anwar
x2oxen
Major General
Posts: 1114
Joined: Wed Aug 22, 2007 3:17 pm
Location: Faisalabad
Contact:

Post by x2oxen »

wat will be the response of this acl if that user type mail.yahoo.com or briefcase.yahoo.com. what if he wants to block whole yahoo websites??
Muhammad Usman
+92-321-6640501
Chemonics International
http://usmanpk.com
Post Reply