Squid transparent не хочет работать.
Добавлено: 2012-12-12 15:29:53
Всем доброго дня, прошу помощи в настройке прозрачности данного прокси. Без прозрачности все работает. Буду благодарен любому совету.
Немного о системе.
Немного о системе.
Код: Выделить всё
uname -a
FreeBSD ergo-proxy 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Fri Dec 7 17:24:37 SAMT 2012 root@ergo-proxy:/usr/src/sys/amd64/compile/MYKERNEL amd64
Код: Выделить всё
squid -v
Squid Cache: Version 3.2.3
configure options: '--with-default-user=squid' '--bindir=/usr/local/sbin' '--sbindir=/usr/local/sbin' '--datadir=/usr/local/etc/squid' '--libexecdir=/usr/local/libexec/squid' '--localstatedir=/var/squid' '--sysconfdir=/usr/local/etc/squid' '--with-logdir=/var/log/squid' '--with-pidfile=/var/run/squid/squid.pid' '--enable-auth' '--enable-build-info' '--enable-loadable-modules' '--enable-removal-policies=lru heap' '--disable-epoll' '--disable-linux-netfilter' '--disable-linux-tproxy' '--disable-translation' '--enable-auth-basic=DB MSNT MSNT-multi-domain NCSA PAM POP3 RADIUS fake getpwnam NIS' '--enable-auth-digest=file' '--enable-external-acl-helpers=file_userip unix_group' '--enable-auth-negotiate=kerberos wrapper' '--enable-auth-ntlm=fake smb_lm' '--enable-storeio=diskd rock ufs aufs' '--enable-disk-io=AIO Blocking DiskDaemon IpcIo Mmapped DiskThreads' '--enable-log-daemon-helpers=file' '--enable-url-rewrite-helpers=fake' '--disable-ipv6' '--enable-htcp' '--disable-forw-via-db' '--disable-cache-digests' '--enable-wccp' '--enable-wccpv2' '--disable-eui' '--disable-ipfw-transparent' '--enable-pf-transparent' '--disable-ipf-transparent' '--disable-follow-x-forwarded-for' '--disable-ecap' '--disable-icap-client' '--disable-esi' '--enable-kqueue' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd9.0' 'build_alias=amd64-portbld-freebsd9.0' 'CC=cc' 'CFLAGS=-O2 -pipe -fno-strict-aliasing' 'LDFLAGS= -pthread' 'CPPFLAGS=' 'CXX=c++' 'CXXFLAGS=-O2 -pipe -fno-strict-aliasing' 'CPP=cpp' --enable-ltdl-convenience
Код: Выделить всё
less /etc/rc.conf
#!/bin/sh
defaultrouter="10.18.71.1"
gateway_enable="YES"
hostname="ergo-proxy"
inetd_enable="YES"
network_interfaces="msk0 msk1 lo0"
ifconfig_msk0="inet 192.168.111.201 netmask 255.255.255.0"
ifconfig_msk1="inet 10.18.71.201 netmask 255.255.255.0"
natd_enable="YES"
natd_interface="10.18.71.201"
sshd_enable="YES"
squid_enable="YES"
pf_enable="YES"
pf_rules="/etc/pf.conf"
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
#ifconfig_msk2="inet 192.168.111.230 netmask 255.255.255.0"
keymap="ru.koi8-r.win.kbd"
#ifconfig_msk0="DHCP"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
natd_interface="msk1"
Код: Выделить всё
less /usr/local/etc/squid/squid.conf
acl localnet src 192.168.111.0/24
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
http_access allow localhost manager
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow localhost
http_access deny all
http_port 127.0.0.1:3128 transparent
cache_mem 128 MB
maximum_object_size 8092 KB
maximum_object_size_in_memory 512 KB
cache_log /var/squid/logs/squid_debug.log squid
cache_access_log /var/squid/logs/access.log squid
cache_store_log /var/squid/logs/cache_store.log squid
cache_dir ufs /var/squid/cache/squid 2048 64 256
coredump_dir /var/squid/cache/squid
visible_hostname ergoProxy
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
Код: Выделить всё
int_if="msk0"
ext_if="msk1"
ext_ip="10.18.71.201"
int_ip="192.168.111.201"
int_net="192.168.111.0/24"
rdr on $int_if inet proto tcp from any to any port www -> 127.0.0.1 port 3128
nat on $ext_if from $int_net to any ->$ext_ip
pass in on $int_if proto tcp to ($int_if) port ssh
pass in on $ext_if proto tcp to ($ext_if) port 22
block out all
block in all
pass on lo0
pass on $int_if
pass out from $ext_if to any keep state
pass in on $int_if proto tcp to ($int_if) port ssh
pass in on $ext_if proto tcp to ($ext_if) port 80
pass in on $int_if proto tcp to any port www