I've called this a "user's experience" rather than a how-to because your mileage may vary if you follow in my foot steps. My requirement is what I already have from Smoothwall: A content filtering system, for use at home, to flag and block when a page is probably inappropriate content. The reason I want to change is that I believe PFsense is a better firewall but before Marcello built this excellent package I was missing content filtering.
Basic InstallFirstly install PFSense and ensure that it is working. You should have internet access but no filtering. Don't install any packages before you install Dansguardian, they may work but it's not what I did. In my set up I have a WAN interface pointing at the ISP and a LAN interface with the IP address 10.0.2.1
In the web interface go to:
System>Packages>Available Packages and select
DansguardianClick on the install button and wait for the installation to complete (It takes a fair amount of time so be patient)
Setup
Go to:
Services>DansguardianClick on
Enable DansguardianListen interface - LAN
Listen Port - 8080
Proxy IP - 10.0.2.1 (My PFSense box)
Proxy Port - 3128
Go to the bottom and click
SaveCheck that DG is running
Status>ServicesAt this point I found there was nothing listening on port 3128 (sockstat -4l) which I didn't expect because I thought the package installed Squid so either I missed something or I was just wrong, either way, I decided I'd install squid from the package.In the web interface go to:
System>Packages>Available Packages and select
SquidSquid configuration (optional)
Visible host name - "your host name"
saveNow there is a squid server listening on 3128
Go back to
Services>Dansguardian and click
save in order to recycle DG
Testing the set upSet up your web browser to use Dansguardian and Squid. For Firefox proceed as follows:
Tools>OptionsNetwork Tab>Settings>Manual Proxy configuration HTTP Proxy - 10.0.2.1 (IP of your dansguardian/PFsense machine)
Port - 8080
Tick -
Use this proxy for all protocolsNow try to access both a good site and a bad site:
google.com - Good
tits.com - Bad (or any other bad site)
If you can access the good but not the bad everything is working as expected.
Now I want to add a transparent proxy. I believe that the package author prefers to use WPAD/PAC/auto configuration with dns+dhcp as opposed to a transparent proxy. I agree that it's better for a professional set up in a company but for me I just want to stop my daughters from inadvertently finding the wrong things on the net when browsing at home. In this use case I find the transparent proxy mush easier.
There is a tick box in the squid configuration page that is marked "Transparent Proxy" and promises to redirect everything automagically for you, it doesn't work for a DG set up in my experience.
Add a rule to forward the browsing requests to Dansguardian (thanks to Zgruk for this since I copied it from his post):
Firewall>NATPort Forward tab click the
+ button
Interface: LAN
Protocol: TCP
Source: LAN subnet
Destination: any
Destination Port: HTTP to HTTP
Redirect IP: <the IP of your pfSense box> (10.0.2.1 in my case)
Redirect Target Port: 8080
Click
Save and then
Apply ChangesThen retry your good and bad test after resetting the web browsers proxy to
No proxy and you should get the same results.
There are two other steps you can optionally choose, firstly to block direct access to Squid and hence bypassing DG altogether and secondly to do the same forwarding for HTTPS, the rules are detailed by Zgruk in this
postI haven't done either of these since for my use case it isn't required.
Further configurationWith the base system working I continued to modify some other options. Obviously these are for my own use case and may not be appropriate for your use case.
Naughtiness limit - By default the limit is set very low and since my daughters are teenagers I needed to increase it to a more appropriate limit.
Service>Dansguardian>Groups - Click Edit - Scroll to naughtiness limit and set as appropriate
Mime & Extension types - I find that despite the security risk from embedded virus teenagers like to download mpeg etc.
Service>Dansguardian>Access Lists - Click Edit - Comment out with # the ones you don't want active as appropriate
URL exception list - Occasionally DG will block perfectly legitimate sites so I have a set of exceptions to allow the odd filtering mistake.
Service>Dansguardian>Access Lists>Site - Click Edit
That's about it. If I've got things wrong or could have done them in a better way then do let me know. If this short write up helps anyone then it was worth the effort.