nano /etc/network/interfaces && /etc/init.d/networking restart
# apt-get update && apt-get upgrade
# aptitude install krb5-user samba winbind libpam-krb5 libpam-winbind libnss-winbind
domain EXAMPLE.RU search EXAMPLE.RU nameserver 192.168.1.6
# net time set domaincontroller
# ntpdate 192.168.1.3
default_realm = EXAMPLE.RU kdc_timesync = 1 ccache_type = 4 forwardable = true proxiable = true v4_instance_resolve = false v4_name_convert = { host = { rcmd = host ftp = ftp } plain = { something = something-else } } fcc-mit-ticketflags = true [realms] EXAMPLE.RU = { kdc = domaincontroller admin_server = domaincontroller default_domain = EXAMPLE.RU } [domain_realm] .example.ru = EXAMPLE.RU example.ru = EXAMPLE.RU [login] krb4_convert = false krb4_get_tickets = false
# kinit test_user@EXAMPLE.RU
kinit (v5): Clock skew too great while getting initial credentials
kinit (v5): Preauthentication failed while getting initial credentials
kinit (v5): KDC reply did not match expectations while getting initial credentials
kinit (v5): Client not found in Kerberos database while getting initial credentials
[global] dos charset = cp866 unix charset = KOI8-R workgroup = EXAMPLE () realm = EXAMPLE.RU () server string = SQUID-PROXY security = ADS auth methods = winbind allow trusted domains = No password server = * log level = 1 log file = /var/log/samba/samba.%m max log size = 50 time server = Yes socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 os level = 0 preferred master = No local master = No domain master = No dns proxy = No ldap ssl = no winbind use default domain = Yes strict locking = No client NTLMv2 auth = Yes client lanman auth = No client plaintext auth = No winbind enum users = Yes winbind enum groups = Yes winbind refresh tickets = Yes encrypt passwords = yes
# testparm Load smb config files from /etc/samba/smb.conf Loaded services file OK. Server role: ROLE_DOMAIN_MEMBER Press enter to see a dump of your service definitions
#cat /etc/nsswitch.conf passwd: compat winbind group: compat winbind shadow: compat winbind hosts: files dns networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis
# /etc/init.d/winbind stop && /etc/init.d/samba restart && /etc/init.d/winbind start
# net ads join -U test_user -D EXAMPLE .RU Enter test_user's password: Using short domain name -- EXAMPLE Joined 'Multiproxy' to realm 'EXAMPLE '
# wbinfo -u # wbinfo -g
# apt-get install squid3
<listen_ip> - IP- <listen_port> - <acl_name> - <outgoing_ip> - IP- http_port <listen_ip>:<listen_port> http_port <listen_ip>:<listen_port> cache_access_log /var/log/squid3/access.log acl localhost src 127.0.0.1/32 acl god_mode src 192.168.1.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 # NTLM auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp auth_param ntlm children 5 auth_param ntlm keep_alive off acl AuthorizedUsers proxy_auth REQUIRED acl <acl_name> myport <listen_port> tcp_outgoing_address <outgoing_ip> <acl_name> http_access allow localhost http_access deny !Safe_ports http_access allow all AuthorizedUsers http_access deny all icp_access deny all cache_mgr test_user@EXAMPLE.RU visible_hostname MultiProxy
257 <table_name2> 256 <table_name1>
ip route add 192.168.1.0/24 dev eth0 proto kernel scope link src <local_ip> table table_name1 ip route add default gw <gateway_ip1> table table_name1 ip route add 192.168.1.0/24 dev eth0 proto kernel scope link src <local_ip> table table_name2 ip route add default gw <gateway_ip2> table table_name2 ip rule add from xxx.xxx.xxx.xx1 table table_name1 ip rule add from xxx.xxx.xxx.xx2 table table_name2 ip route flush cache
Source: https://habr.com/ru/post/265213/
All Articles