{"id":264027,"date":"2015-08-21T12:33:02","date_gmt":"2015-08-21T08:33:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=264027"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=264027","title":{"rendered":"\u041c\u0443\u043b\u044c\u0442\u0438\u043f\u0440\u043e\u043a\u0441\u0438 \u043d\u0430 \u0431\u0430\u0437\u0435 Debian \u0438 SQUID \u0441 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439"},"content":{"rendered":"<p>             \u041f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 Squid, \u0441\u043b\u0443\u0448\u0430\u044e\u0449\u0438\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0440\u0442\u043e\u0432. \u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0440\u0442 \u0441\u0432\u043e\u0439 \u043a\u0430\u043d\u0430\u043b \u0441\u0432\u044f\u0437\u0438 \u0438\u043b\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 IP. \u041c\u0430\u043d\u0443\u0430\u043b\u043e\u0432 \u0438 \u0441\u0442\u0430\u0442\u0435\u0435\u043a \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\u0445 \u043f\u043e\u043b\u043d\u043e, \u043d\u043e \u043e\u0431\u0449\u0435\u0439 \u0441\u043a\u043e\u043d\u0441\u043e\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0443\u0432\u044b \u043d\u0435\u0442, \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c.<\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Debian 7.8, Samba 4, Squid 3, Kerberos 5.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/h4>\n<p>  1. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u041e\u0421, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b:  <\/p>\n<pre><code class=\"bash\">nano \/etc\/network\/interfaces && \/etc\/init.d\/networking restart <\/code><\/pre>\n<p>  2. \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0432\u0443\u0445 \u043a\u043e\u043c\u0430\u043d\u0434:  <\/p>\n<pre><code class=\"bash\"># apt-get update && apt-get upgrade<\/code><\/pre>\n<p>  3. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0432\u043e\u0434\u0438\u043c \u043c\u0430\u0448\u0438\u043d\u0443 \u0432 \u0434\u043e\u043c\u0435\u043d, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u044b:  <\/p>\n<pre><code class=\"bash\"># aptitude install krb5-user samba winbind libpam-krb5 libpam-winbind libnss-winbind <\/code><\/pre>\n<p>  4. \u041c\u0435\u043d\u044f\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 DNS \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/resolv.conf:  <\/p>\n<pre><code class=\"bash\">domain EXAMPLE.RU search EXAMPLE.RU nameserver 192.168.1.6 <\/code><\/pre>\n<p>  5. \u0417\u0430\u0434\u0430\u0435\u043c \u0438\u043c\u044f \u043c\u0430\u0448\u0438\u043d\u044b \u0432 \/etc\/hostname:<br \/>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b \/etc\/hosts \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u043d\u0451\u043c \u0431\u044b\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0441 \u043f\u043e\u043b\u043d\u044b\u043c \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0438 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0445\u043e\u0441\u0442\u0430, \u0441\u0441\u044b\u043b\u0430\u044e\u0449\u0430\u044f\u0441\u044f \u043d\u0430 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 IP.<\/p>\n<p>  6. \u0421\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043e\u043c\u0435\u043d\u0430:<br \/>  # ping domaincontroller<br \/>  # ping domaincontroller.EXAMPLE.RU<\/p>\n<p>  7. \u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c \u0434\u043e\u043c\u0435\u043d\u0430. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 5 \u043c\u0438\u043d\u0443\u0442 \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0438\u043a\u0435\u0442 \u043e\u0442 Kerberos. \u0414\u043b\u044f \u0440\u0430\u0437\u043e\u0432\u043e\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:  <\/p>\n<pre><code class=\"bash\"># net time set domaincontroller <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u0436\u0435, \u0435\u0441\u043b\u0438 \u0432 \u0441\u0435\u0442\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0441 \u043d\u0435\u0433\u043e:  <\/p>\n<pre><code class=\"bash\"># ntpdate 192.168.1.3 <\/code><\/pre>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 Kerberos<\/h4>\n<p>  1. \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0440\u0430\u0432\u0438\u043c \u0444\u0430\u0439\u043b \/etc\/krb5.conf. \u041d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\">  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 <\/code><\/pre>\n<p>  2. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u043e\u043c\u0435\u043d\u0435:  <\/p>\n<pre><code class=\"bash\"># kinit test_user@EXAMPLE.RU <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a, \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u0441\u0435 \u0432\u0435\u0440\u043d\u043e \u0438 \u0434\u043e\u043c\u0435\u043d\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0432\u044b\u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u0442\u0438\u043a\u0435\u0442 Kerberos. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0442\u0438\u043a\u0435\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 # klist<\/p>\n<p>  2.a. \u0420\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 Kinit:   <\/p>\n<blockquote><p>kinit(v5): Clock skew too great while getting initial credentials<\/p><\/blockquote>\n<p>  \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0443 \u043d\u0430\u0448\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u043d\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432\u0440\u0435\u043c\u044f \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c \u0434\u043e\u043c\u0435\u043d\u0430.   <\/p>\n<blockquote><p>kinit(v5): Preauthentication failed while getting initial credentials<\/p><\/blockquote>\n<p>  \u0412\u0432\u0435\u0434\u0435\u043d \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c.   <\/p>\n<blockquote><p>kinit(v5): KDC reply did not match expectations while getting initial credentials<\/p><\/blockquote>\n<p>  \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0444\u0430\u0439\u043b krb5.conf \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e realm \u0438 \u0434\u043e\u043c\u0435\u043d \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 kinit \u0431\u044b\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435.   <\/p>\n<blockquote><p>kinit(v5): Client not found in Kerberos database while getting initial credentials<\/p><\/blockquote>\n<p>  \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0434\u043e\u043c\u0435\u043d\u0435 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Samba \u0438 \u0432\u0432\u043e\u0434 \u043c\u0430\u0448\u0438\u043d\u044b \u0432 \u0434\u043e\u043c\u0435\u043d<\/h4>\n<p>  1. \u0414\u043b\u044f \u0432\u0445\u043e\u0434\u0430 \u0432 \u0434\u043e\u043c\u0435\u043d \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c Samba. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \/etc\/samba\/smb.conf:  <\/p>\n<pre><code class=\"bash\">  [global]       dos charset = cp866       unix charset = KOI8-R       workgroup = EXAMPLE (\u043f\u0440\u043e\u043f\u0438\u0441\u043d\u044b\u043c\u0438)       realm = EXAMPLE.RU (\u043f\u0440\u043e\u043f\u0438\u0441\u043d\u044b\u043c\u0438)       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 <\/code><\/pre>\n<p>  2. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e:  <\/p>\n<pre><code class=\"bash\"># 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 <\/code><\/pre>\n<p>  3. \u041f\u0440\u0430\u0432\u0438\u043c \u0444\u0430\u0439\u043b \/etc\/nsswitch.conf \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"bash\">  #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 <\/code><\/pre>\n<p>  4. \u041f\u043ec\u043b\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \/etc\/samba\/smb.conf, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Samba \u0438 Winbind:  <\/p>\n<pre><code class=\"bash\">  # \/etc\/init.d\/winbind stop && \/etc\/init.d\/samba restart && \/etc\/init.d\/winbind start <\/code><\/pre>\n<p>  5. \u0412\u0432\u043e\u0434\u0438\u043c \u043c\u0430\u0448\u0438\u043d\u0443 \u0432 \u0434\u043e\u043c\u0435\u043d:  <\/p>\n<pre><code class=\"bash\">  # net ads join -U test_user -D EXAMPLE .RU   Enter test_user's password:   Using short domain name -- EXAMPLE    Joined 'Multiproxy' to realm 'EXAMPLE ' <\/code><\/pre>\n<p>  6. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0432\u0438\u0434\u0438\u0442 \u043b\u0438 Samba \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u0434\u043e\u043c\u0435\u043d\u0430  <\/p>\n<pre><code class=\"bash\">  # wbinfo -u   # wbinfo -g <\/code><\/pre>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 SQUID 3<\/h4>\n<p>  1. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442 SQUID 3:  <\/p>\n<pre><code class=\"bash\">  # apt-get install squid3 <\/code><\/pre>\n<p>  2. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c SQUID \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0430\u0439\u043b\u0430 \/etc\/squid3\/squid.conf:  <\/p>\n<pre><code class=\"bash\">&lt;listen_ip&gt; - IP-\u0430\u0434\u0440\u0435\u0441 \u043f\u0440\u043e\u043a\u0441\u0438  &lt;listen_port&gt; - \u041f\u043e\u0440\u0442 \u043f\u0440\u043e\u043a\u0441\u0438 &lt;acl_name&gt; - \u0418\u043c\u044f \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 &lt;outgoing_ip&gt; - IP-\u0430\u0434\u0440\u0435\u0441 \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430   http_port &lt;listen_ip&gt;:&lt;listen_port&gt;   http_port &lt;listen_ip&gt;:&lt;listen_port&gt;   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 &lt;acl_name&gt; myport &lt;listen_port&gt;   tcp_outgoing_address &lt;outgoing_ip&gt; &lt;acl_name&gt;   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 <\/code><\/pre>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/h4>\n<p>  1. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b:  <\/p>\n<pre><code class=\"bash\">\/etc\/network\/interfaces auto eth0:1 iface eth0:1 inet static         address xxx.xxx.xxx.xx1         netmask xxx.xxx.xxx.xxx auto eth0:2 iface eth0:2 inet static         address xxx.xxx.xxx.xx2         netmask xxx.xxx.xxx.xxx <\/code><\/pre>\n<p>  2. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \/etc\/iproute2\/rt_tables, \u043d\u043e\u043c\u0435\u0440 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 \u0433\u043e\u043b\u043e\u0432\u044b, \u043d\u043e \u043d\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439\u0441\u044f:  <\/p>\n<pre><code class=\"bash\">257     &lt;table_name2&gt; 256     &lt;table_name1&gt; <\/code><\/pre>\n<p>  3. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446:  <\/p>\n<pre><code class=\"bash\">ip route add 192.168.1.0\/24 dev eth0  proto kernel  scope link  src &lt;local_ip&gt; table table_name1 ip route add default gw &lt;gateway_ip1&gt; table table_name1 ip route add 192.168.1.0\/24 dev eth0  proto kernel  scope link  src &lt;local_ip&gt; table table_name2 ip route add default gw &lt;gateway_ip2&gt; 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 <\/code><\/pre>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/265213\/\"> http:\/\/habrahabr.ru\/post\/265213\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>             \u041f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 Squid, \u0441\u043b\u0443\u0448\u0430\u044e\u0449\u0438\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0440\u0442\u043e\u0432. \u041d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u043e\u0440\u0442 \u0441\u0432\u043e\u0439 \u043a\u0430\u043d\u0430\u043b \u0441\u0432\u044f\u0437\u0438 \u0438\u043b\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 IP. \u041c\u0430\u043d\u0443\u0430\u043b\u043e\u0432 \u0438 \u0441\u0442\u0430\u0442\u0435\u0435\u043a \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\u0445 \u043f\u043e\u043b\u043d\u043e, \u043d\u043e \u043e\u0431\u0449\u0435\u0439 \u0441\u043a\u043e\u043d\u0441\u043e\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0443\u0432\u044b \u043d\u0435\u0442, \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c.<\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Debian 7.8, Samba 4, Squid 3, Kerberos 5.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-264027","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=264027"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264027\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}