Koozali.org: home of the SME Server

squid, dansguardian, and --enable-follow-x-forwarded-for

Offline markehle

  • ***
  • 125
  • +0/-0
squid, dansguardian, and --enable-follow-x-forwarded-for
« on: November 14, 2007, 04:02:11 PM »
Folks -

I am using a 7.2 box as a proxy/filter using dansguardian in a public library, and it performs great. I would like to start using delay pools, as when the kids get out of school, they come over and clobber our bandwidth.

I can't get delay pools to work because of dansguardian; as far as squid is concerned, it only has one customer coming from 127.0.0.1, so it can't discern who to delay.

I guess I need to have the  --enable-follow-x-forwarded-for configure option compiled into squid

Can anybody tell me what the best way to go about this is?

Thanks -

Mark

Offline raem

  • *
  • 3,972
  • +4/-0
Re: squid, dansguardian, and --enable-follow-x-forwarded-for
« Reply #1 on: November 15, 2007, 04:08:44 AM »
Alternatively try the HTBWondershaper script, do a forum search to find it.
...

Offline stephen noble

  • *
  • 607
  • +1/-0
    • Dungog
Re: squid, dansguardian, and --enable-follow-x-forwarded-for
« Reply #2 on: November 15, 2007, 08:41:05 AM »
use delay pools to throttle the sites they go to

Offline raem

  • *
  • 3,972
  • +4/-0

Offline byte

  • *
  • 2,183
  • +2/-0
Re: squid, dansguardian, and --enable-follow-x-forwarded-for
« Reply #4 on: November 15, 2007, 11:20:02 PM »
Moving this topic to the SME 7.x contribs forum, it is more appropriate there. Thanks!
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline markehle

  • ***
  • 125
  • +0/-0
Re: squid, dansguardian, and --enable-follow-x-forwarded-for
« Reply #5 on: November 16, 2007, 02:31:01 AM »
OK, Byte - thanks.

Offline vincepanozzo

  • *
  • 1
  • +0/-0
Re: squid, dansguardian, and --enable-follow-x-forwarded-for
« Reply #6 on: September 10, 2008, 06:45:35 AM »
Folks -

I am using a 7.2 box as a proxy/filter using dansguardian in a public library, and it performs great. I would like to start using delay pools, as when the kids get out of school, they come over and clobber our bandwidth.

I can't get delay pools to work because of dansguardian; as far as squid is concerned, it only has one customer coming from 127.0.0.1, so it can't discern who to delay.

I guess I need to have the  --enable-follow-x-forwarded-for configure option compiled into squid

Can anybody tell me what the best way to go about this is?

Thanks -

Mark

Here is how I resolved this problem:

You must include the client IP into the header sent to Squid.
To do this you will need to change the following setting in dansguardian.conf to "on" (default is off)

# if on it adds an X-Forwarded-For: <clientip> to the HTTP request
# header.  This may help solve some problem sites that need to know the
# source ip. on | off
forwardedfor = on

You should do this using the templates-custom but I will not go into that detail here.

Then in your squid.conf you can identity the IP address by retreiving it from the Header sent from Dansguardian:

acl aclname req_header X-Forwarded-For -i <IP address>

(You will need to change aclname and <IP address>)

Then you can use this to do your pool delays

Again you should do this by using templates-custom.

Hope this helps.