site Search:


 
   
story category
Managing Network Content With a DIY Linux Router
Web Proxy, Content Filter and Access Control
by ryan711 Tuesday 10-Apr-2012 tags: business · wireless · hardware · networking · wireless
Part two of my series of articles detailing some of the more useful features of DIY Linux Routers (also see Exploring QoS for Home Routers) is going to focus on the content filtering and the controlling of traffic on your network. In this article, I’ll be using ClearOS, formerly ClarkConnect, to explain and display the features associated with content filtering traffic and users on your network. I do this not only because I like to show off various distributions of Linux routers so that people have many choices, but also because I just discovered ClearOS and it’s looking like a really, really good Linux router.

Web Proxy

Click for full size
The first thing we’re going to look at is the web proxy. This is because all of the other more advanced content features rely on the web proxy in order to function. The web proxy essentially takes all HTTP, FTP, and a few other protocols’ traffic, caches it, and tracks it.

When the web proxy caches traffic, it stores that data locally on the router, and anytime up to when it is overwritten, it will send that data to a local machine if it requests that data from a website. In other words, it will cache certain aspects of websites or any small files you download so that you don’t have to reload them again. This not only saves bandwidth, but also speeds up web browsing.

Most web proxy settings will look similar to the picture to the right because most of them use Squid-Cache. You specify your maximum cache size, maximum object size, and on ClearOS, you can specify a maximum download size. So for example if you don’t want anyone downloading a file larger than 2GB on your network, you can block that by setting it as such.

The maximum cache size, upon filling up, will start to overwrite old data from itself. So for example, if you watched 10 Youtube videos that equaled 500MB, and you then downloaded a 500MB file, those videos would no longer be available in the cache. The maximum object size is the maximum size of the file you want to be cached. Anything over that limit will not be stored locally on the router.

If you want to take absolute advantage of the web proxy, I would suggest buying a sub-$100 SSD and installing the entire OS on it. You can buy a 30GB one for around $60 or a 60GB one for close to $100. Using an SSD will not only give you super-fast read/write speeds, but will also give you those equally fast sub-1ms access times that will really make the difference when being used to retrieve stored objects from the cache.

There are two modes that you can use to enable the web proxy. One is called transparent mode and the other is user authentication mode. Transparent mode is the simplest to set up and maintain because all you need to do is enable it and all local machines will be cached and logged. The downside to this is that transparent mode will not cache or log HTTPS sessions.

The other, user authentication, requires usernames and passwords to be entered before any web browsing can occur. The disadvantage to this is that is makes things a little more complicated for the users on your network, but the advantages are that all traffic, including HTTPS, will flow through the web proxy and you can maintain more control over the users on your network using access control and content filtering options.

Content Filter

Click for full size
The content filter is a nice piece of kit if you have kids or employees that you don’t want visiting certain websites. You can run the content filter without any users defined, but the disadvantage to that is that the entire network will have to abide by the rules you set in the content filter. By requiring usernames and passwords, you can create groups and specify what each group is allowed/not allowed to do. For example, “kids” in the screenshot to the right.

If I were to have any users specified on this machine, they would be visible in the users box, and you would be able to select which ones you want to belong to the group “Kids”. The default options are usually good for most users. You can also specify banned extension lists. Don’t want the kids downloading .EXEs? Specify so under the extension/MIME options.

More useful, you can specify what types of sites you want blocked based on blacklists with millions of sites categorized automatically for you. All that is needed is to specify the categories of sites you want blocked under the Blacklists menu. Below is just a small portion of the number of categories you can specify. These blocks lists are also constantly updated automatically for you, so as new sites spring up, they will be added to the lists.

You can also specify specific sites that you want blocked under Site Lists.

Access Control

Access control limits access to the web during specified periods to specified users, ip addresses, or MAC addresses. The first thing you must do is define a time period. Continuing with the concerned parent theme, let’s assume that you want to block access to the web during “Homework Time” from 3:00PM to 5:00PM. Just create a name, select the days and time then save it.

Click for full size
After that, you can go to the Add Access Control page and configure the appropriate options. If you’re using usernames and passwords, it is as simple as selecting them from the list. If you are not, you can also use IP addresses if you have static DHCP leases, but if you are not using static DHCP leases, you can also specify the MAC addresses of the machines you want to block. Here I am using IP addresses for simplicity.

That about sums up the content filtering options. Most of these things are available on the more feature-rich Linux router distributions.

view: topics flat text 
Post a:
bdnhsv

join:2012-01-20
Huntsville, AL

Nice article

Another nice article. I'm glad to hear you're exploring COS - I've been using it for a while and I think it's great. They are inching closer to a new release and from some of the posts I've read on their forum it sounds like it'll have some pretty nice new features as well.
DrData
Premium
join:2004-12-31
Longwood, FL

DIY router

ClearOS looks nice, but found it was unstable when I used it. So I found pfSense and haven’t looked back. pfSense is reliable and has many more features. Makes for a great DIY router.
Gdadkins

join:2009-05-11
Mantachie, MS

Re: DIY router

+1 for pfSense. We replaced an ill bought $20,000 firewall with a pfSense box and never looked back.

SimbaTLK1
Rawrrr

join:2001-09-07
Pittsburgh, PA

Re: DIY router

said by Gdadkins:

+1 for pfSense. We replaced an ill bought $20,000 firewall with a pfSense box and never looked back.

+2 for pfsense
blackkanto

join:2008-04-10
South Range, WI

DIY Router

A good read although one thing stands out. Using MLC based SSDs in a setting where you want some form of reliability is asking for trouble. I personally would go for a SLC based SSD for reliability. More expensive, yes but at least the peace of mind is there. Or at the very least look for an eMLC based SSD.

Lets not forget about trim support as well. Linux had initial support for trim (wear leveling for SSDs) in the 2.6.28 kernel, and full support in 2.6.33. However, you would need to verify that it is enabled by whatever file system is in use as it seems most have it disable by default unless the setup wizard would detect that your using an SSD.

I've used a router distro call Vyatta for some time, it uses a customized version of the Debian distro. Has a paid and open source edition. The OSE is strictly CLI (command line interface) based which might turn some people off to it but if you know your way around DOS/Terminal, it's pretty easy to pick up.

It has a similar command structure to the Cisco CLI including tab completion. The CLI is very well documented in the PDF manuals, showing examples on how one might implement a said feature.

Some notable differences to some router distros is full IPv6 support along with a firewall, support for virtualization through templates (VMware ESX, Citrix XenServer), enterprise routing protocols (BGP, OSPF) and high availability (RAID 1, WAN Load Balancing etc.)

All in all, a reliable open source routing solution that I've had good experience with.

axiomatic

join:2006-08-23
Tomball, TX

ClearOS and uPnP

I really liked ClearOS until I tried to bring my second and third XBOX 360 online in my household. The standard Linux linuxigd (uPnP) doesn't seem to support multiple console gaming systems. So ClearOS has come up with a miniupnpd feature but since its very early code it is not reliable yet.

pfSense running on a VMWare ESXi 5 hypervisor was the solution I used. Honestly like this solution better as I can run FreeNAS in another VM on the same box and use a QNAP NAS box for all the storage.

ClearOS just needs to complete the 6.x community build and I will sure give them another try.
BiggA

join:2005-11-23
EARTH

Re: ClearOS and uPnP

UPnP is a security risk. You should do static DHCP and manually forward the necessary ports.

mix

join:2002-03-19
Utica, MI

Re: ClearOS and uPnP

I love this myth. I've heard it thousands of times it seems like. Yet, where are all the reports of trojans, viruses, malware, etc. using it? I don't believe I have ever read about a single one exploiting some UPnP vulnerability to do something malicious. Someone will hopefully prove me wrong.
BiggA

join:2005-11-23
EARTH

Re: ClearOS and uPnP

It's such a fundamental risk, and it serves no purpose that static DHCP plus port forwarding can't that there is no reason to have it enabled.

mix

join:2002-03-19
Utica, MI
Doesn't seem like "very early code" to me:

»miniupnp.free.fr/updatehistory.html

Also, if you are running some flavor of OpenWRT, you are probably using miniupnpd for upnp.

axiomatic

join:2006-08-23
Tomball, TX

Re: ClearOS and uPnP

Well I guess I meant more new to ClearOS than new in general. i.e. its a little difficult to implement in ClearOS right now and worse I had to download it from an unfamiliar Yum server.

Thanks for the link though. I had not found that page yet.
BiggA

join:2005-11-23
EARTH

Access control

I get blocking porn, but these days, the internet is so critical to doing anything, even homework, that it's unrealistic to block it.
blackkanto

join:2008-04-10
South Range, WI

1 edit

Re: Access control

said by BiggA:

I get blocking porn, but these days, the internet is so critical to doing anything, even homework, that it's unrealistic to block it.

That, and a simple proxy site can bypass it if there crafty enough.

I remember back in high school, they had this x-stop proxy, it blocked legitimate research sites yet allow stuff that should have been clearly blocked.

People figured out that it was just a local proxy so they disabled it in IE. When they locked that down, they hacked it through the registry. And when that failed they use a portable version of Firefox, Opera etc and got past it.

I will also add that content filtering will more than likely put considerable load on the hardware, since it employs some form of deep packet inspection. An endpoint solution might be better suited if you have a considerable amount of browsing going on and don't have dedicated hardware up to the task.
BiggA

join:2005-11-23
EARTH

Re: Access control

Yeah, we used to play that game in high school. I don't think the kids there do it anymore, as they just go on their iPhones/Droids now that everyone has smartphones and they added a tower that works indoors at the school.

RR Conductor
NWP RR Inc.,serving NW CA
Premium
join:2002-04-02
Redwood Valley, CA
kudos:1
said by blackkanto:

said by BiggA:

I get blocking porn, but these days, the internet is so critical to doing anything, even homework, that it's unrealistic to block it.

I remember back in high school, they had this x-stop proxy, it blocked legitimate research sites yet allow stuff that should have been clearly blocked.

I remember back in High School the Internet, at least as it is now didn't even exist. I graduated High School in 1990, so SLOW dial-up and BBS was all there was in the 70s and 80s, well, except for Universities, the US Government and the US Military who had fast (for the time) connections.

jimm

@rr.com

astaro

The Astaro home version does all of this as well. I'm using v8.301 on an old Dell P4 2.8 GHz machine. Overkill really, but I had it lying around. Currently it has an 80 gig SATA drive (spinning), but I'm going to install an SSD when v9 comes out of beta. It will have full support for SSDs. Sophos just bought them so the new version will be Sophos UTM 9. I may try it out on my mini-itx 1.5ghz VIA box with the SSD to see how it does with load. You mentioned Astaro in another article, yes it's a little daunting at first, but it's a swiss army knife of functionality.

Saturday, 25-May 12:51:35 Terms of Use & Privacy | feedback | contact | Hosting by nac.net - DSL,Hosting & Co-lo
over 13.5 years online © 1999-2013 dslreports.com.