Прозрачный squid + iptables

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС.

Модераторы: SLEDopit, Модераторы разделов

Аватара пользователя
Arceny
Сообщения: 378
ОС: Debian Lenny/Sid

Прозрачный squid + iptables

Сообщение Arceny »

Не получается настроить прозрачный squid, везде пишут, что необходимы след. опции:

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

ОС DEbian 4.0 , версия squid:

Squid Cache: Version 2.6.STABLE5
configure options: '--prefix=/usr' '--exec_prefix=/usr' '--bindir=/usr/sbin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib/squid' '--sysconfdir=/etc/squid' '--localstatedir=/var/spool/squid' '--datadir=/usr/share/squid' '--enable-async-io' '--with-pthreads' '--enable-storeio=ufs,aufs,coss,diskd,null' '--enable-linux-netfilter' '--enable-arp-acl' '--enable-epoll' '--enable-removal-policies=lru,heap' '--enable-snmp' '--enable-delay-pools' '--enable-htcp' '--enable-cache-digests' '--enable-underscores' '--enable-referer-log' '--enable-useragent-log' '--enable-auth=basic,digest,ntlm' '--enable-carp' '--with-large-files' 'i386-debian-linux' 'build_alias=i386-debian-linux' 'host_alias=i386-debian-linux' 'target_alias=i386-debian-linux'

При запуске ругается на указанные выше опции:
Starting Squid HTTP proxy: squid
2008/02/04 09:49:47| parseConfigFile: line 4357 unrecognized: 'httpd_accel_host virtual'
2008/02/04 09:49:47| parseConfigFile: line 4358 unrecognized: 'httpd_accel_port 80'
2008/02/04 09:49:47| parseConfigFile: line 4359 unrecognized: 'httpd_accel_with_proxy on'
2008/02/04 09:49:47| parseConfigFile: line 4360 unrecognized: 'httpd_accel_uses_host_header on'

В iptables прописываю:
iptables -t nat -A PREROUTING -s 192.168.0.0/24 -d ! 10.0.0.0/8 -p tcp --dport 80 -j REDIRECT --to-port 3128

Выдаёт вместо страницы примерно следующее:

ERROR
The requested URL could not be retrieved

While trying to process the request:

GET / HTTP/1.1
Host: yandex.ru
User-Agent: Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.8.1.11) Gecko/20071128 Iceweasel/2.0.0.11 (Debian-2.0.0.11-1) YB/3.0.3
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: L=dmZ8fHNqfn5rY1xhVnt2X1NgS2JkQlhEAAMqTWZjcD8ICSE/d1Yie3gaXjovESURdUENSyZhNihfHGMJeTB/UQ==.1201612649.2252.298297.d7d4870e0f6c2326701c4ee0034de211; yabs-frequency=/2/uWGu0Fm29ym4E03y0YSMzJS0_08d//fGBy0Wm5WG43W0630G00; yandexuid=3950421189398419
Cache-Control: max-age=0



The following error was encountered:

* Invalid Request

Some aspect of the HTTP Request is invalid. Possible problems:

* Missing or unknown request method
* Missing URL
* Missing HTTP Identifier (HTTP/1.0)
* Request is too large
* Content-Length missing for POST or PUT requests
* Illegal character in hostname; underscores are not allowed

Your cache administrator is webmaster
Спасибо сказали:
onewin
Сообщения: 18

Re: Прозрачный squid + iptables

Сообщение onewin »

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

Возможно вместо всего этого стоит вписать
http_port 3128 transparent
?
Спасибо сказали:
Аватара пользователя
Voler
Сообщения: 498
ОС: Fedora

Re: Прозрачный squid + iptables

Сообщение Voler »

А подскажите как правильно сделать связку прозрачного прокси сервера + squidGuard?
Спасибо сказали:
babahvl
Сообщения: 88
ОС: SuSe 10.3 Kubuntu 8.04

Re: Прозрачный squid + iptables

Сообщение babahvl »

Arceny писал(а):
04.02.2008 09:54
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on


Это было в старых версиях squid.

Сейчас действительно, нужно http_port твойIP:3128 transparent

и в IPTABLES у тебя тоже вроде все верно
Спасибо сказали:
Аватара пользователя
Arceny
Сообщения: 378
ОС: Debian Lenny/Sid

Re: Прозрачный squid + iptables

Сообщение Arceny »

Спасибо, всё заработало
Спасибо сказали: