LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-19-2004, 01:08 AM   #1
mahmoudkhn
LQ Newbie
 
Registered: Dec 2004
Location: Afghanistan
Distribution: Fedora
Posts: 6

Rep: Reputation: 0
Dansguardian


Hi,

I've setup Squid and Dansguardian-2.8 for safe browsing. But now I don't know how to configure Dansguardian properly so that I don't have to do manual proxy settings in the browser and that it blocks all inappropriate browsing such as porns.

Thanks in advance for any help.

Mahmoud
 
Old 12-19-2004, 05:23 AM   #2
gkhewitt
Member
 
Registered: Jun 2003
Distribution: ClarkConnect (RH9)
Posts: 41

Rep: Reputation: 15
You need to make your proxy transparent, so that all requests for the internet that go through your box get routed via squid and therefore dansguardian.

Using IPTables, this can be done by running the following lines

iptables -A PREROUTING -i $INTIF -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
/sbin/service iptables save
/sbin/service iptables restart

...replacing $INTIF with your LAN-side interface (eg. eth1). Also, if Squid is running on a port other than 3128, change that too..

This will automatically route anything heading to port 80 via port 3128 where squid is sitting.

HTH
 
Old 12-19-2004, 12:57 PM   #3
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
A little bit more info is needed...

Dansguardian should be listening on the LAN interface port 80.. eg 192.168.1.1:80
squid on 127.0.0.1 port 3128..

squid.conf should have these lines to make it handle transparent virtual requests..
http_port 127.0.0.1:3128
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_single_host off
httpd_accel_uses_host_header on

and iptables should have..
iptables -t nat -A PREROUTING -i eth~ -p tcp --dport 80 -j DNAT --to-destination 192.168.1.1
#eth~ is the LAN interface

You can also add a second rule for port 443 for https..

In this configuration, everything from the LAN going out to port 80 gets diverted to dansguardian which then sends it to squid..

If squid listens on only 127.0.0.1 there is no need to block packets from everywhere from finding it and bypassing dansguardian, or internet sources using it as an open proxy..
Likewise with dansguardian.. only the LAN interface is sent to it..

Last edited by peter_robb; 12-19-2004 at 12:59 PM.
 
Old 12-20-2004, 01:10 AM   #4
mahmoudkhn
LQ Newbie
 
Registered: Dec 2004
Location: Afghanistan
Distribution: Fedora
Posts: 6

Original Poster
Rep: Reputation: 0
Thumbs up

Thanks a lot for your help, I was stuck and really used your help. I'm a newbie to the world of Linux.
 
Old 12-20-2004, 06:15 AM   #5
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Welcome...

The most hated but most frequently used comment is "RTFM"... read the manual..
This info is on the dansguardian website under the Docs & HOWTO section..
http://dansguardian.org/downloads/DGandTransparent.txt
and of course once it's working ok, the Docs suddenly make sense..

I have just changed a few things to make it more resilient..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
using DansGuardian Trio3b Linux - Security 4 12-02-2005 03:18 AM
Dansguardian jomy Linux - Networking 2 11-27-2005 09:56 AM
install DansGuardian Trio3b Linux - Software 3 09-09-2005 04:49 PM
Problems with DansGuardian win32sux Linux - Software 12 12-07-2004 04:26 PM
Networking with Dansguardian...please help! Louie55 Linux - Networking 3 08-26-2004 11:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:03 AM.

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