Прозрачный SQUID, не работает

Проблемы установки, настройки и работы Правильной Операционной Системы

Модератор: terminus

Правила форума
Убедительная просьба юзать теги [cоde] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
tangichhan
рядовой
Сообщения: 24
Зарегистрирован: 2011-09-29 9:37:47

Прозрачный SQUID, не работает

Непрочитанное сообщение tangichhan » 2016-07-15 6:40:56

Добрый день. Есть проблема, с которой я разобраться не могу.
Дано:
Сервер на FreeBSD 10
пакетный фильтр PF
squid 3.5
Проблема: При настройки прозрачного проксирования выдается ошибка на хосте (в браузере)

Код: Выделить всё


ERROR
The requested URL could not be retrieved

The following error was encountered while trying to retrieve the URL: /

    Invalid URL

Some aspect of the requested URL is incorrect.

Some possible problems are:

    Missing or incorrect access protocol (should be "http://" or similar)

    Missing hostname

    Illegal double-escape in the URL-Path

    Illegal character in hostname; underscores are not allowed.

Your cache administrator is webmaster.
Если устанавливать в браузере настройки сквида, то все нормально - работает.

Конфиг сквида

Код: Выделить всё

#
# Recommended minimum configuration:
#

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT

#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
#http_port 3128
http_port 3128
http_port 127.0.0.1:3128 intercept

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/squid/cache 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/squid/cache
visible_hostname BSDGW
#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320

На стороне PF настроено правило rdr

Код: Выделить всё

rdr on $iface2 proto tcp from {192.168.13.75} to any port $www_ports -> 192.168.0.1 port 3128
SQUID собран с параметрами

Код: Выделить всё

squid-3.5.9
Name           : squid
Version        : 3.5.9
Installed on   : Fri Jul 15 09:05:37 2016 IRKT
Origin         : www/squid
Architecture   : freebsd:10:x86:32
Prefix         : /usr/local
Categories     : ipv6 www
Licenses       : GPLv2
Maintainer     : timp87@gmail.com
WWW            : http://www.squid-cache.org/
Comment        : HTTP Caching Proxy
Options        :
        ARP_ACL        : off
        AUTH_LDAP      : off
        AUTH_NIS       : on
        AUTH_SASL      : off
        AUTH_SMB       : off
        AUTH_SQL       : off
        CACHE_DIGESTS  : off
        DEBUG          : off
        DELAY_POOLS    : on
        DOCS           : on
        ECAP           : off
        ESI            : off
        EXAMPLES       : on
        FOLLOW_XFF     : off
        FS_AUFS        : on
        FS_DISKD       : on
        FS_ROCK        : off
        GSSAPI_BASE    : on
        GSSAPI_HEIMDAL : off
        GSSAPI_MIT     : off
        GSSAPI_NONE    : off
        HTCP           : on
        ICAP           : off
        ICMP           : off
        IDENT          : on
        IPV6           : on
        KQUEUE         : on
        LARGEFILE      : on
        LAX_HTTP       : on
        NETTLE         : off
        SNMP           : on
        SSL            : off
        SSL_CRTD       : off
        STACKTRACES    : off
        TP_IPF         : off
        TP_IPFW        : off
        TP_PF          : on
        VIA_DB         : off
        WCCP           : on
        WCCPV2         : on
Annotations    :
        cpe            : cpe:2.3:a:squid-cache:squid:3.5.9:::::freebsd10:x86
Flat size      : 8.05MiB
Description    :
Squid is a fully-featured HTTP/1.0 proxy which is almost (but not quite)
HTTP/1.1 compliant. Squid offers a rich access control, authorization and
logging environment to develop web proxy and content serving applications.

WWW: http://www.squid-cache.org/
В чем проблема, помогите разобраться.

Хостинговая компания Host-Food.ru
Хостинг HostFood.ru
 

Услуги хостинговой компании Host-Food.ru

Хостинг HostFood.ru

Тарифы на хостинг в России, от 12 рублей: https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.: https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

Аватара пользователя
Neus
капитан
Сообщения: 1977
Зарегистрирован: 2008-09-08 21:59:56

Прозрачный SQUID, не работает

Непрочитанное сообщение Neus » 2016-07-15 8:47:58

tangichhan писал(а): http_port 3128
http_port 127.0.0.1:3128 intercept
уверен что номера портов одинаковые должны быть?

tangichhan
рядовой
Сообщения: 24
Зарегистрирован: 2011-09-29 9:37:47

Прозрачный SQUID, не работает

Непрочитанное сообщение tangichhan » 2016-07-15 10:02:38

Не уверен, поменять на следующее?

http_port 3129
http_port 127.0.0.1:3128 intercept

BeginnerBSD
рядовой
Сообщения: 40
Зарегистрирован: 2014-09-26 18:45:58

Прозрачный SQUID, не работает

Непрочитанное сообщение BeginnerBSD » 2016-11-07 16:56:11

Есть ещё вопрос по прозрачному проксированию (PFNAT+Squiq).
Как рулить https (разрешать/запрещать разные url или по рег.выражениям)?
Когда сквид непрозрачен (например, с ntlm), там все хорошо с помощью acl разруливается - и ssl и web.
А тут весь ssl трафик шурует через nat мимо сквида. Посоветуйте, как им управлять?