Introduction

So you have a nice shiny Edubuntu server install and everything is well. You have an internet connection, but your want to restrict your users access to certain content on the internet, and you want to be able to do it without installing a second machine as a proxy/filtering server.

Well here is how I did it.

These instructions are based on gutsy and have limited testing, in my case they have worked. If you find a better way of implementing this please feel free to expand/change it.

Installing packages

sudo aptitude install squid dansguardian

Configuration

Here we are going to configure and start all the services one by one. I will start off by configuring squid, this will get us a fully functional proxy server. Next, dansguardian this will sit on top of squid and allow for content filtering. Then we will configure iptables to redirect all requests by the users to dansguardian.

This has the plus point that, for instance, if you have a staff group and a pupils group that all staff can be redirected to the proxy and all pupils can be redirected to dansguardian.

Squid

sudo gedit /etc/squid/squid.conf

This is needed as later on we will be playing around with iptables so the users will automagically use filtering. Without it squid will display any request as text rather than actually fetching it.

sudo /etc/init.d/squid start

ps aux | grep squid

root      5469  0.0  0.0   4780   652 ?        Ss   Oct10   0:00 /usr/sbin/squid -D -sYC
proxy     5471  0.0  0.2   7644  5348 ?        S    Oct10   0:00 (squid) -D -sYC

Dansguardian

sudo gedit /etc/dansguardian/dansguardian.conf

sudo /etc/init.d/dansguardian start

ps aux | grep dansguardian

IPTables

sudo iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --match owner --gid-owner users -j ACCEPT

sudo iptables -t nat -A OUTPUT -p tcp -d ! 192.168.0.0/255.255.255.0 --match owner --gid-owner users -j REDIRECT --to-ports 8080

*Note: this will redirect ALL port to dansguardian, you may want to DENY all ports (except 80 and 443) instead.

CategoryEdubuntuUserContributedDocumentation

EdubuntuProxy (last edited 2009-08-03 04:47:35 by acesuares)