Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-20-2009, 11:42 AM
|
#1
|
|
LQ Newbie
Registered: Feb 2009
Posts: 8
Rep:
|
how to block sites like megaupload / rapidshare
Hi,
I'm the admin in my hostel's computer lab. The problem is, some folks use the lab machines to download big files ( 100 mb and above ) almost all the time , thereby using up almost all the bandwidth allocated to the hostel. I want to ensure that people can't open certain sites like megaupload / rapidshare from the lab...Is there any way to do that ?
The machines all have Ubuntu (Hardy Heron) installed...i googled the problem, only to find solutions to block certain particular ips/sites...but i want to block a generic class of sites, say all links containing the word "megaupload" . If someone has any idea, pls help...
|
|
|
|
02-20-2009, 11:50 AM
|
#2
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
you can use squid and squidguard as proxy.
|
|
|
|
02-20-2009, 11:55 AM
|
#3
|
|
LQ Newbie
Registered: Feb 2009
Posts: 8
Original Poster
Rep:
|
Quote:
Originally Posted by repo
you can use squid and squidguard as proxy.
|
I'm basically looking for a solution where i could ideally block an outgoing connection to all links having a particular word ( or regular expression !! ) in them... Is it possible to do so using squid ? If so,would u pls give an example ?
Thanks
|
|
|
|
02-20-2009, 12:03 PM
|
#4
|
|
Member
Registered: Aug 2007
Distribution: FreeBSD 8.0 xubuntu
Posts: 49
Rep:
|
Use Dansguardian on the firewall. It will block all the "bad" sites but you can open it up.
http://dansguardian.org/
Last edited by netman4ttm; 02-20-2009 at 12:07 PM.
Reason: adding content
|
|
|
|
02-20-2009, 12:12 PM
|
#5
|
|
LQ Newbie
Registered: Feb 2009
Posts: 8
Original Poster
Rep:
|
Quote:
Originally Posted by netman4ttm
|
I'm sorry , but it isnt very clear to me... what do u mean by using Dansguardian "on the firewall" ? I'm not using any firewall rite now, but i can enable ufw in ubuntu... so u mean i shud use Dansguardian in conjunction with ufw ?
Also, u can understand it wont really do if all users could undo what I block .... so i'm looking for a solution that would require a user to have sudo privilege to modify it....
I'll look into the website link u gave...but it would help me if u were a bit more elaborate.
|
|
|
|
02-20-2009, 12:18 PM
|
#6
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
You need a central server, which will act as firewall/proxy for all the other computers.
so all configuration will happen at 1 place.
otherwise they will always change the settings on their own machine.
Last edited by repo; 02-20-2009 at 12:19 PM.
|
|
|
|
02-20-2009, 12:29 PM
|
#7
|
|
LQ Newbie
Registered: Feb 2009
Posts: 8
Original Poster
Rep:
|
Quote:
Originally Posted by repo
You need a central server, which will act as firewall/proxy for all the other computers.
so all configuration will happen at 1 place.
otherwise they will always change the settings on their own machine.
|
Apparently, the problem is more complicated than i thought it is
I initially thought i could add a rule in iptables that would drop a connection having a specific word in the link...Then noone can modify the permissions w/o sudo access...But apparently, its not possible it seems....
But in my case, all the m/cs are standalone machines...i want them to individually block the said sites...else some1 will just shutdown the proxy server itself , to bypass it , as it wont be possible to deny physical access to the server !!
|
|
|
|
02-20-2009, 12:36 PM
|
#8
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
You could add the sites in the /etc/hosts file
127.0.0.1 whateversite.com
so they will be redirected to 127.0.0.1
they need root rights to change them.
there are sample hostsfiles on the net, so you can also block porn, ebay......
Last edited by repo; 02-20-2009 at 12:37 PM.
|
|
|
|
02-20-2009, 12:49 PM
|
#9
|
|
LQ Newbie
Registered: Feb 2009
Posts: 8
Original Poster
Rep:
|
Quote:
Originally Posted by repo
You could add the sites in the /etc/hosts file
127.0.0.1 whateversite.com
so they will be redirected to 127.0.0.1
they need root rights to change them.
there are sample hostsfiles on the net, so you can also block porn, ebay......
|
Yes, i had got that solution when i used google...but the catch is, this will only work when it one particular site/sites i want to block...but will this approach work when trying to block all links containing the word "megaupload" ? I'm not sure it will... and i possibly cant add all megaupload links ever posted on the net to the /etc/hosts file 
|
|
|
|
02-20-2009, 01:10 PM
|
#10
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
Quote:
|
but will this approach work when trying to block all links containing the word "megaupload"
|
No wildcards are allowed and only the main domain name is a valid entry.
Seems to me the best thing to do is to setup a server, and then use squid and squidguard or dansguardian.
And when you are at it, you can use it as a firewall.
|
|
|
|
02-20-2009, 01:24 PM
|
#11
|
|
LQ Newbie
Registered: Feb 2009
Posts: 8
Original Poster
Rep:
|
Quote:
Originally Posted by repo
No wildcards are allowed and only the main domain name is a valid entry.
Seems to me the best thing to do is to setup a server, and then use squid and squidguard or dansguardian.
And when you are at it, you can use it as a firewall.
|
Hehe...i'm installing dansguardian as i type on all machines in the lab...
Is it possible for each machine to act as its own server , where i would then use dansguardian / squid etc ? If its a dumb thing to ask, pls bear with me...but as i said , setting up a single server for all machines in the lab is not an option, since shutting it down would either disable the firewall or worse, disable internet access on all the other machines...as the old saying goes, who guards the guard(s) ? 
|
|
|
|
02-20-2009, 01:30 PM
|
#12
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
They just need to disabke proxy in the browser to use rapidshare
Code:
since shutting it down would either disable the firewall or worse, disable internet access on all the other machines
why would they shut it down?
Then they have no internet....
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 12:40 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|