-
Обновляем систему cl-update
-
Записываем имя машины в /etc/conf.d/hostname
hostname="proxy.domain.local"
-
Правим файл /etc/host
127.0.0.1 proxy.local proxy localhost
192.168.1.10(<-- тут IP прокси сервера) proxy.domain.local proxy
-
Добавляем /etc/portage/package.use/custom строчки
net-proxy/squid kerberos
dev-libs/cyrus-sasl kerberos
-
Устанавливаем squid
emerge -av squid
-
Редактируем файл krb5.conf
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
dns_lookup_kdc = no
dns_lookup_realm = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
default_realm = DOMAIN.LOCAL
default_keytab_name = /etc/squid/proxy.keytab
[realms]
DOMAIN.LOCAL = {
kdc = dc1.domain.local
kdc = dc2.domain.local
admin_server = dc1.domain.local
}
-
Отключить ipv6 на уровне системы: /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
-
На контроллере домена создаем учётную запись squid_admin
-
На контроллере домена создаем группу squid_full (сюда добавляем группы и пользоватлей с интернетом без ограничений)
-
На контроллере домена создаем группу squid_other (сюда добавляем группы(можно добавить сразу группу Пользователи домена) или пользователей с интернетом с ограничениями)
-
На контролерре домена запускаем cmd c правами Администратора и выполняем команду ktpass /princ HTTP/proxy.domain.local@DOMAIN.LOCAL /mapuser squid_admin@DOMAIN.LOCAL /crypto ALL /ptype KRB5_NT_PRINCIPAL /pass “12345” /out C:\proxy.keytab после чего полученный файл в C:\proxy.keytab копируем на прокси сервер в /etc/squid/
-
Редактируем файл /etc/squid/squid.conf
auth_param negotiate program /usr/libexec/squid/negotiate_kerberos_auth -r -s HTTP/proxy.domain.local@DOMAIN.LOCAL -t none
auth_param negotiate children 100
auth_param negotiate keep_alive on
external_acl_type fullgroup_krb children-max=100 children-startup=50 cache=10 grace=15 ipv4 %LOGIN /usr/libexec/squid/ext_kerberos_ldap_group_acl -a -g squid_full@DOMAIN.LOCAL -D DOMAIN.LOCAL -S dc1.DOMAIN.LOCAL
external_acl_type othergroup_krb children-max=100 children-startup=50 cache=10 grace=15 ipv4 %LOGIN /usr/libexec/squid/ext_kerberos_ldap_group_acl -a -g squid_other@DOMAIN.LOCAL -D DOMAIN.LOCAL -S dc1.DOMAIN.LOCAL
acl localnet src 192.168.100.0/24 # RFC1918 possible internal network
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 port
s
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 8101 # multiling http
acl Safe_ports port 44300 # multiling http
acl CONNECT method CONNECT
acl AD_users proxy_auth REQUIRED
acl AD_FullInet external fullgroup_krb
acl AD_OtherInet external othergroup_krb
acl blacklist url_regex -i "/etc/squid/stop_sites"
acl telemetry url_regex -i "/etc/squid/telemetry.txt"
acl blackfiles urlpath_regex -i "/etc/squid/stop_files"
#acl blackmimes rep_mime_type -i "/etc/squid/stop_mimes"
acl manager proto cache_object
#http_access allow CONNECT SSL_ports
http_access allow manager localhost
http_access deny manager
#http_access deny !Safe_ports
#http_access deny CONNECT !SSL_ports
#http_access allow CONNECT SSL_ports
http_access deny telemetry AD_OtherInet
http_access deny telemetry AD_FullInet
http_access deny blacklist AD_OtherInet !AD_FullInet
http_access deny blackfiles AD_OtherInet !AD_FullInet
#http_access deny blackmimes AD_OtherInet
http_access allow CONNECT Safe_ports AD_FullInet
http_access allow CONNECT Safe_ports AD_OtherInet !blackfiles
http_access allow AD_FullInet
http_access allow AD_OtherInet
# !blackfiles
http_access deny AD_users
http_access deny all
http_port 192.168.1.10:3128
dns_v4_first on
dns_nameservers 192.168.100.90
hosts_file /etc/hosts
via off
forwarded_for delete
#pinger_enable off
#half_closed_clients off
#quick_abort_min 0 KB
#quick_abort_max 0 KB
#quick_abort_pct 95
#client_persistent_connections off
#server_persistent_connections off
#detect_broken_pconn on
coredump_dir /var/spool/squid
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
cache_store_log none
cache_dir null /var/spool/squid
# 1024 16 256
#maximum_object_size 61440 KB
- Запустить squid
/etc/init.d/squid start