LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-07-2016, 03:16 AM   #1
magoretendai
LQ Newbie
 
Registered: Nov 2015
Posts: 3

Rep: Reputation: Disabled
Website Restrictions in Ubuntu


Hi all, was hoping someone could help me. I have an Ubuntu server running a transparent proxy and would like to restrict specific client machines to browsing only one website during work hours and only allow them unlimited browsing during lunch times, how do i do this, and can it be done without removing the transparent proxy.

thanking you in advance
 
Old 09-07-2016, 03:20 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Try including useful information such as what you're using as the transparent proxy.
 
Old 09-07-2016, 03:34 AM   #3
magoretendai
LQ Newbie
 
Registered: Nov 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
thanks for the quick reply, i'm using squid
 
Old 09-07-2016, 03:51 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Ok, so what have you tried so far? A google search for "squid restrict access by time" throws up many, many resources for creating time based ACLs.
 
Old 09-07-2016, 04:05 AM   #5
magoretendai
LQ Newbie
 
Registered: Nov 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
I did find options to restrict by time, which I can do, I also found ways of restricting access to specific websites by creating a file with the list of the restricted sites, what I could not find, however, was how to block all sites (obviously I cant list them all) on specific IPs on a network and only allow access to one website.

I have to say replies on this forum are quite fast, many thanks.

Or maybe, is it possible if using squid would be a bit complicated to redirect all outgoing web traffic on those specific IPs to the particular website thats allowed access by using iptables

Last edited by magoretendai; 09-07-2016 at 04:08 AM. Reason: Had a thought
 
Old 09-07-2016, 04:55 AM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
So you need two ACLs and apply them in the following order:
  1. allow the source machine(s) access to everything but with a time "windows".
  2. allow the source machines(a) access only the specific site (by IP of the site or by dstdomain).

So what will happen is that during "happy hour" the time condition of the first ACL will match, so it'll be "active". When it's outside the "happy hour" the request will fall through to the next ACL where it'll only allow access to the matching IP or dstdomain or whatever other combinations you put in the ACL.

What you may be missing is how to combine conditions. Just give the conditions the same name in the ACL. So the example below creates a "happyhour" ACL that will match between 12:00 and 13:59 (Ok,it's 2 hours, sue me!) AND the client IP is within the given range.

Code:
acl happyhour time 12:00-13:59
acl happyhour src 192.168.1.100-192.168.1.110

Last edited by TenTenths; 09-07-2016 at 04:59 AM.
 
1 members found this post helpful.
  


Reply

Tags
restrictions, squid, squidproxy, ubuntu, website



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
LXer: Michael Geist’s website went dark to protest U.S. restrictions on Internet LXer Syndicated Linux News 0 01-20-2012 07:20 AM
how to block website in ubuntu 9.10 amritpalpathak Linux - Software 3 04-17-2010 08:46 AM
Running alternate ubuntu installer on bsd, old laptop with restrictions ddarz Linux - Newbie 1 12-21-2009 10:06 AM
LXer: Website to Educate on Dangers of Digital Restrictions Management LXer Syndicated Linux News 0 10-21-2006 06:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:55 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