LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-13-2012, 10:02 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
How to block web sites on a specific IP address ?


Hi,
I am using CENTOS 5.1 for squid server. I want to block a some sites like facebook on one specific IP address of my internal network. I know how to block sites but it will impliment on all ip addreses which is not good for top managament.For example to block sites for whole network following i do

Code:
acl banned_sites destdomain facebook.com youtube.com

acl our_networks src 192.168.1.0
http_access deny banned_sites
http_access allow our_networks
but my aim is to block these sites only on the IP address
192.168.1.50

Please guide me how can i block web sites on a specific IP.

thanks,
gardenair
 
Old 01-13-2012, 10:32 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by gardenair View Post
Hi,
I am using CENTOS 5.1 for squid server. I want to block a some sites like facebook on one specific IP address of my internal network. I know how to block sites but it will impliment on all ip addreses which is not good for top managament.For example to block sites for whole network following i do

Code:
acl banned_sites destdomain facebook.com youtube.com
acl our_networks src 192.168.1.0
http_access deny banned_sites
http_access allow our_networks
but my aim is to block these sites only on the IP address 192.168.1.50 Please guide me how can i block web sites on a specific IP.
The same way you block ANY IP in squid, as we've 'guided you' to before:
http://www.linuxquestions.org/questi...s-only-885565/

Create another ACL, put it in Squid, or add the IP address to the banned_sites list. Not much else to it. Again, reference the Squid docs.
 
Old 01-13-2012, 11:03 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
thanks "TB0ne" for the prompt reply. Well as to your reply and my previous post regarding to it if i do it the user can not access even google.com. I want that he should do normal browsing but can not open youtube or facebook.
yes will see Squid docs for more reference.

thanks,
gardenair
 
Old 01-13-2012, 11:27 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by gardenair View Post
thanks "TB0ne" for the prompt reply. Well as to your reply and my previous post regarding to it if i do it the user can not access even google.com. I want that he should do normal browsing but can not open youtube or facebook.
yes will see Squid docs for more reference.
Creating an ACL for banned sites has been VERY well documented. What part are you having problems with? And reading the documentation and doing basic research should be step one for ANY problem:

http://wiki.squid-cache.org/SquidFaq...ork.21__why.3F
 
Old 01-13-2012, 11:58 AM   #5
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
Really good help. Appreciate u.
gardenair
 
Old 01-16-2012, 03:23 PM   #6
baronobeefdip
Senior Member
 
Registered: Jul 2009
Distribution: Debian Squeeze
Posts: 1,267

Rep: Reputation: 32
use a firewall, you can allow traffic from a specific website to pass to certain machines and block it from getting to other machines, the rulesets must be set as such. read up on IPTables or (to me which is easier) is OpenBSD Packet Filter where the ruleset syntax is a little easier, it hasn't been ported to linux but you can create a bridge from FreeBSD or OpenBSD (reccomend FreeBSD since settings are a little easier than OpenBSD)

Unless your users know how to do this you can block their MAC addresses since a DHCP server changes their IP addresses once the lease is expired, many security specialists don't reccomend this since MAC spoofing is possible but most computer users can't do it (requires a lot of work in Windows and some reading to do it in UNIX)

Good Luck
 
Old 02-16-2012, 12:57 AM   #7
kanna411988
LQ Newbie
 
Registered: Feb 2012
Posts: 23
Blog Entries: 1

Rep: Reputation: Disabled
How to block the facebook for the particular ip address in squid.I am new to squid server......
 
Old 02-16-2012, 01:27 AM   #8
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by kanna411988 View Post
How to block the facebook for the particular ip address in squid.I am new to squid server......
You should not be posting here with a new question as the thread doesn't belongs to you

Kindly start a new thread with all the details like your distro and what all you have tried so far.
 
Old 02-16-2012, 09:23 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by kanna411988 View Post
How to block the facebook for the particular ip address in squid.I am new to squid server......
See the replies above. Read the squid documentation, since ACL's for blocking sites are very well documented.
 
  


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
how to block a specific MAC address venkat_eg Linux - General 2 02-05-2011 05:01 PM
[SOLVED] Block URLS/websites or Allow only Specific Sites in a Slack anoopch Slackware 4 10-21-2010 01:22 PM
block access to web sites in linux sr71919 Linux - General 5 04-08-2010 04:52 PM
How do I block web pages/sites? Is squid what I should use? RHLinuxGUY Linux - Networking 3 02-06-2010 12:07 PM
how to block web sites using squid proxy rupalit Ubuntu 1 07-16-2009 07:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:50 PM.

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