Страница 1 из 1

SQUID + PF прозрачный прокси

Добавлено: 2009-12-24 14:51:12
ttys
FreeBSD 8
пытаюсь настроить прозрачный прокси PF + SQUID
/etc/pf.conf:

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

ext_if="rl1" #Внешний интерфейс (192.168.1.0/24)
int_if="rl0" #Внутренний интерфейс (192.168.0.0/24)
internal_net="192.168.0.0/24" #Наша сеть
external_addr="192.168.1.9" #Внешний IP
kirill=192.168.0.2
set skip on lo0
scrub in all
nat on $ext_if from $internal_net to any port { ntp, nntp, domain } -> ($ext_if)
rdr on $int_if proto tcp from $internal_net to any port www -> 127.0.0.1 port 3128
pass in on $int_if proto tcp from $kirill to 127.0.0.1 port 3128
pass in all
pass out all
что здесь выбирать ?
/usr/ports/www/squid30/Makefile:

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

                SQUID_LDAP_AUTH "Install LDAP authentication helpers" off \
                SQUID_NIS_AUTH "Install NIS/YP authentication helpers" on \
                SQUID_SASL_AUTH "Install SASL authentication helpers" off \
                SQUID_DELAY_POOLS "Enable delay pools" off \
                SQUID_SNMP "Enable SNMP support" on \
                SQUID_CARP "Enable CARP support" on \
                SQUID_SSL "Enable SSL support for reverse proxies" off \
                SQUID_PINGER "Install the icmp helper" off \
                SQUID_DNS_HELPER "Use the old 'dnsserver' helper" off \
                SQUID_HTCP "Enable HTCP support" off \
                SQUID_VIA_DB "Enable forward/via database" off \
                SQUID_CACHE_DIGESTS "Enable cache digests" off \
                SQUID_WCCP "Enable Web Cache Coordination Prot. v1" on \
                SQUID_WCCPV2 "Enable Web Cache Coordination Prot. v2" off \
                SQUID_STRICT_HTTP "Be strictly HTTP compliant" off \
                SQUID_IDENT "Enable ident (RFC 931) lookups" on \
                SQUID_REFERER_LOG "Enable Referer-header logging" off \
                SQUID_USERAGENT_LOG "Enable User-Agent-header logging" off \
                SQUID_ARP_ACL "Enable ACLs based on ethernet address" oт \
                SQUID_IPFW "Enable transparent proxying with IPFW" off \
                SQUID_PF "Enable transparent proxying with PF" on \
                SQUID_IPFILTER "Enable transp. proxying with IPFilter" off \
                SQUID_ICAP "Enable ICAP client functionality" off \
                SQUID_ESI "Enable ESI support (experimental)" off \
                SQUID_AUFS "Enable the aufs storage scheme" off \
                SQUID_COSS "Enable COSS (currently not available)" off \
                SQUID_KQUEUE "Use kqueue(2) (experimental)" on \
                SQUID_LARGEFILE "Support log and cache files >2GB" on \
                SQUID_STACKTRACES "Create backtraces on fatal errors" off \
                SQUID_DEBUG "Enable debugging options" off

Re: SQUID + PF прозрачный прокси

Добавлено: 2009-12-24 18:06:49
Burner
очевидно SQUID_PF "Enable transparent proxying with PF" on \

Re: SQUID + PF прозрачный прокси

Добавлено: 2009-12-25 10:59:48
ttys
Burner писал(а):очевидно SQUID_PF "Enable transparent proxying with PF" on \
1) SQUID_PF "Enable transparent proxying with PF"
2) ?????????
а всё остальное OFF ?
без чего не будет работать?

Re: SQUID + PF прозрачный прокси

Добавлено: 2009-12-25 12:02:57
skeletor
Не будет работать без п.1. Остальное можно ставить в off. Хотя, я делаю так: если при установке порта не знаю, какие опции нужны, а какие нет - оставляю по дефолту, чего и тебе советую.

Re: SQUID + PF прозрачный прокси

Добавлено: 2010-01-13 10:56:04
ttys
разобрался:
теперь имеем /etc/pf.conf

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

ext_if="rl1" #Внешний интерфейс WAN
int_if="rl0" #Внутренний интерфейс LAN
internal_net="192.168.0.0/24" #Наша сеть LAN
external_addr="192.168.1.9" #Внешний IP WAN

set skip on lo0
scrub in all

rdr on $int_if proto { tcp } from 192.168.0.0/24 to any port www -> 127.0.0.1 port 3128
nat on $ext_if from $internal_net to any -> ($ext_if)
pass out on $ext_if inet proto tcp from any to any port www keep state

pass in all
pass out all
сам сервер подключен каскадно к прокси с debian(192.168.1.254) на котором стоит squid 3128
вопрос в том что надо добавить /etc/pf.conf чтобы пк (internal_net="192.168.0.0/24" #Наша сеть LAN) ходил чере порт (192.168.1.254:3128) debian сервера ?