LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-04-2003, 11:39 AM   #1
secrets
LQ Newbie
 
Registered: Jun 2003
Location: Pakistan
Distribution: Redhat Linux
Posts: 4

Rep: Reputation: 0
Exclamation Squid IP BLOCKING


Hi, I want to block some of my users to access the net i have added a acl in linux squid:
acl ban 192.168.42.1-192.168.42.11
http_access deny !ban
but this does not work.
Help Me.
 
Old 07-04-2003, 02:02 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
If you use iptables try:
iptables -A INPUT -s IP_OF_BAD_MACHINE -j DROP
 
Old 07-04-2003, 02:19 PM   #3
born4linux
Senior Member
 
Registered: Sep 2002
Location: Philippines
Distribution: Slackware, RHEL&variants, AIX, SuSE
Posts: 1,127

Rep: Reputation: 49
Quote:
Originally posted by david_ross
If you use iptables try:
iptables -A INPUT -s IP_OF_BAD_MACHINE -j DROP
why would u do that? he only asks for squid access control. your suggestion will drop all connections (incoming and active) from IP_OF_BAD_MACHINE (not just squid).

this should be the syntax:

acl banned_ips src 192.168.42.1-192.168.42.11/255.255.255.0

http_access deny banned_ips

u can also try tcpwrappers - /etc/hosts.allow, /etc/hosts.deny

hth.

Last edited by born4linux; 07-06-2003 at 08:17 PM.
 
Old 06-13-2007, 06:43 AM   #4
helpmeforlinux
LQ Newbie
 
Registered: Aug 2006
Posts: 11

Rep: Reputation: 0
Talking how to block any site using squid as well as iptables

hi friends i want to block suppose yahoo.com then how can i block this site in squid as well as in iptables becasue suppose i don't user squid proxy i directly user gateway so now i wanto block sites from gateway so as many people are using internet through gateway will not be able to visit site.
 
Old 06-14-2007, 10:36 AM   #5
Peeyush Maurya
Member
 
Registered: Apr 2004
Location: Delhi, India
Distribution: Red Hat , WhiteBox
Posts: 31

Rep: Reputation: 15
Quote:
Originally Posted by secrets
Hi, I want to block some of my users to access the net i have added a acl in linux squid:
acl ban 192.168.42.1-192.168.42.11
http_access deny !ban
but this does not work.
Help Me.
Your ACL is incomplete

### src is source IP
acl ban src 192.168.42.1

### here we deny access to ban(with source IP 192.168.42.1). If you use '!' it will deny all but 'ban'
http_access deny ban

## now lets make it complicated
## We want to allow linuxquestions.org and linux-faqs.com from 192.168.42.2 but deny all other websites

# creating ACL for 192.168.42.2
acl LinuxIP src 192.168.42.2

# creating ACL for websites
acl LinuxSite url_regex -i linuxquestions.org
acl LinuxSite url_regex -i linux-faqs.com

# Building the List
http_access allow LinuxIP LinuxSite
http_access deny LinuxIP
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SQUID for blocking yahoo and msn [inc squid.conf] chrisfirestar Linux - Security 10 03-03-2008 08:33 AM
SQUID - Blocking port 80 tekquest Linux - Software 2 08-27-2005 06:05 AM
Blocking squid through iptables jomy Linux - Networking 1 12-20-2004 09:24 AM
squid website blocking? belkens Linux - Networking 2 12-11-2004 07:34 AM
Squid is blocking me out of one particular website. danielw Linux - Software 0 07-02-2004 11:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration