Недавно стала задача, зарезать торренты на базе FreeBSD 8.0.

На серваке имеются NAT и SQUID.

Касаемо NAT проблем не возникло — сделал похитрому:

UsersLan="10.10.1.0/24"
OpenPorts="20-25,110,143,80,443,8080,5222,5901" здесь добавляем все необходимые порты
ipfw add 210 deny log ip from ${UsersLan} to any out via bge1 not dst-port ${OpenPorts} not src-ip me not dst-ip me not icmptypes 0,8,11
ipfw add 210 deny log ip from any to ${UsersLan} in via bge1 not src-port ${OpenPorts} not dst-ip me not src-ip me not icmptypes 0,8,11

Правила, которые отображены выше — добавлены и перед парвилом divert и после него.

А в конфигурационном файле squid.conf, тоже немного поменял — особенно что касалось метода CONNECT:

acl SSL_ports port 443 563 # Ssl
acl Safe_ports port 443 563 #https, snews
acl Safe_ports port 80 #http
acl Safe_ports port 20 #ftp
acl Safe_ports port 21 #ftp
acl Safe_ports port 70 #gopher
acl Safe_ports port 210 #wais
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 Safe_ports port 13  #
acl Safe_ports port 123 #https, ntp
acl Safe_ports port 488 #gss-http
acl Safe_ports port 5109 #icq
acl Safe_ports port 5901-5909 #
acl Safe_ports port 5190-5193 #
acl Safe_ports port 5222-5230 #
acl deny_ports port 1025-65535 #unregistered ports
acl CONNECT method CONNECT
#http_access allow CONNECT !SSL_ports
http_access allow CONNECT SSL_ports
http_access allow CONNECT Safe_ports
http_access deny CONNECT deny_ports
acl torrent_files urlpath_regex -i \.torrent$
http_access deny torrent_files
http_access deny CONNECT SSL_ports
http_access deny CONNECT !SSL_ports
http_access deny Safe_ports
http_access deny !Safe_ports

Я привел лиш кусок из squid.conf, разобраться не сложно что к чему. На всякий случай позакрывал все что только можно было.. Открыть, необходимое всегда можно, а бан должен быть по умолчанию 😉

Может даже и криво, но оно реально работает 😉

Напоминаю всем копирующим мой контент о существовании закона "Об авторском праве".
В связи с этим, прошу во избежании конфликтов при копировании данного материала, ставить на него ссылку:

http://noted.org.ua/1894


Также, вы можете отблагодарить меня переслав любую сумму на любой кошелек WebMoney, для поддержания данного ресурса. Или просто админу на пиво ;)

Кошельки для получения благодарности:
R386985788805
U234140473141
Z147712360455

На данной странице нет комментариев, возможно они закрыты. Если Вы хотите оставить свой комментарий, перейдите на специально созданный раздел

Add your comment now

Please note: JavaScript is required to post comments.