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

Squid(), pf, block all

Добавлено: 2012-11-08 19:13:09
serpent
Приветствую!
Есть хост с freebsd + squid + pf

Задача: раздавать инет пользователям посредством сквида + nat'ить адреса некоторых пользователей, посредством pf + предоставлять пользователям извне различные сервисы

Внизу рабочий конфиг, все работает, но не могу понять что необходимо добавить к правилу:

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

block in log on $ext_if all
если прописываю данную блокировку и добавляю правило

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

pass out on $ext_if flags S/SA synproxy state 
то сквид перестает отвечать - т.е. просто waiting и все
Авторизация в сквиде идет ntlm с использованием winbindd на основе членства пользователей в группах AD

access.log для не работающего block:

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

1352388385.603  80241 192.168.0.3 TCP_MISS/200 37182 GET http://oper.ru/ admin DIRECT/84.204.58.26 text/html
access.log для работающего block:

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

1352388090.549      0 192.168.0.3 TCP_DENIED/407 1716 GET http://yandex.ru/yandsearch? - NONE/- text/html
Как я понимаю, перестает идти авторизация - а из-за чего - в этом вопрос, как переписать блокировки?


FreeBSD dmz 9.0-RELEASE FreeBSD 9.0-RELEASE #0:

##pf.conf

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

ext_if = "fxp0"  #внешний интерфейс
int_if = "em0" #внутренний интерфейс(192.168.0.1), в локальную сеть 192.168.0.0/24


table <FullAccess> { 192.168.0.5, 192.168.0.6, 192.168.0.20}
       TcpServices = "{ 25, 110, 3389, 5190 }"
         ServerRDS = 192.168.0.3
          Server1C = 192.168.0.81
      ServerGarant = 192.168.0.5
          ServerDC = 192.168.0.2


set block-policy return
set skip on lo0
scrub in all

# mail for all; DNS for dc01; nat for users

nat on $ext_if from $int_if:network to any port $TcpServices -> $ext_if
nat on $ext_if from $ServerDC to any port 53 -> $ext_if
nat on $ext_if from <FullAccess> to any -> $ext_if

# Services
rdr on $ext_if proto tcp from any to $ext_if port 5667 -> $ServerRDS port 3389
rdr on $ext_if proto tcp from any to $ext_if port 443 -> $ServerRDS port 443
rdr on $ext_if inet proto tcp from any to $ext_if port 5635 -> $Server1C port 3389
rdr on  $ext_if proto tcp from any to $ext_if port 80 -> $ServerGarant

####block in log on $ext_if all

antispoof quick for $int_if inet

pass in log on $ext_if proto tcp from any to $ServerRDS port 443 flags S/SA synproxy state
pass in log on $ext_if proto tcp from any to $ServerRDS port 3389 flags S/SA synproxy state
pass in log on $ext_if proto tcp from any to $Server1C port 3389 flags S/SA synproxy state
pass in log on $ext_if proto tcp from any to $ServerGarant port 80 flags S/SA synproxy state
pass in log on $ext_if proto tcp from any to $ext_if port {ftp, ftp-data} flags S/SA synproxy state
pass in log on $ext_if proto tcp from any to $ext_if port 4455 flags S/SA keep state

#pass out on $ext_if flags S/SA synproxy state

Re: Squid(), pf, block all

Добавлено: 2013-05-21 8:17:37
Alex Keda
юзайте ipfw - файрволл для людей =)