{"id":182924,"date":"2013-06-11T04:09:03","date_gmt":"2013-06-11T00:09:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=182924"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=182924","title":{"rendered":"<span class=\"post_title\">\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 DNS \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h4>\u041e\u0442\u043a\u0443\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h4>\n<p>  \u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u0432\u0430\u0441 \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0438\u0437 \u0434\u043e\u043c\u0430.<br \/>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432 VPN \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0435\u0442\u044c\u044e \u00ab\u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432 \u043d\u0435\u0439\u00bb.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432 linux?<br \/>  \u0412 \/etc\/resolv.conf \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f (\u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 openresolv \u0438\u043b\u0438 NetworkManager)  <\/p>\n<pre><code class=\"bash\">search local.company.name nameserver 10.0.20.186 <\/code><\/pre>\n<p>  \u0413\u0434\u0435 local.company.name \u2014 \u0434\u043e\u043c\u0435\u043d \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0430 10.0.20.186 \u2014 ip \u0430\u0434\u0440\u0435\u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e (\u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0435\u0442\u0438) DNS \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430?  <\/p>\n<pre><code class=\"bash\">root@t510 0 \/usr\/share\/openvpn # ping -c 1 cdash-master PING cdash-master.local.company.name (10.0.20.237) 56(84) bytes of data. 64 bytes from 10.0.20.237: icmp_seq=1 ttl=63 time=214 ms ... <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e?  <\/p>\n<ol>\n<li>search \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043a cdash-master \u0441\u0443\u0444\u0444\u0438\u043a\u0441 local.company.name<\/li>\n<li>DNS \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0435\u0442\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043b cdash-master.local.company.name \u0432 10.0.20.237<\/li>\n<\/ol>\n<p>  \u0412\u0441\u0451 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u043a\u0430 \u0443 \u0432\u0430\u0441 VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u2026 \u043e\u0434\u043d\u043e.<br \/>  \u041c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0434\u0432\u0430 VPN \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0432\u0430 DNS \u2014 \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0435\u0442\u0438, \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043d\u0430 hetzner, \u0433\u0434\u0435 \u043a\u0440\u0443\u0442\u044f\u0442\u0441\u044f \u043c\u043e\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b.<\/p>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0449\u0435? \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0443\u0442\u044c \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u0431\u044b\u043b \u0434\u043e\u043b\u0433\u0438\u043c \u0438 \u0438\u0437\u0432\u0438\u043b\u0438\u0441\u0442\u044b\u043c.<\/p>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430<\/h4>\n<h3>\u0420\u0430\u0431\u043e\u0447\u0430\u044f \u0441\u0435\u0442\u044c<\/h3>\n<p>  \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0434\u0441\u0435\u0442\u044c \u2014 10.0.20.0\/24 (\u0442.\u0435. 10.0.20.* \u2014 \u0438\u0437 \u043f\u043e\u0434\u0441\u0435\u0442\u0438)<br \/>  \u0414\u043e\u043c\u0435\u043d \u2014 *.local.company.name<br \/>  DNS \u0441\u0435\u0440\u0432\u0435\u0440 \u2014 10.0.20.186<\/p>\n<pre><code class=\"bash\">ping -\u0441 1 somename  <\/code><\/pre>\n<p>  \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c somename \u043a\u0430\u043a somename.local.company.name, \u0430 somename.local.company.name \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0432 IP \u0430\u0434\u0440\u0435\u0441 \u0447\u0435\u0440\u0435\u0437 DNS 10.0.20.186<\/p>\n<p>  \u0415\u0441\u043b\u0438 VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u2014 \u0438\u043c\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0434\u043d\u043e<\/p>\n<h3>\u041b\u0438\u0447\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 hetzner<\/h3>\n<p>  \u0421 \u043d\u0438\u043c \u0432\u0441\u0451 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0445\u0438\u0442\u0440\u0435\u0435<\/p>\n<p>  \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0434\u0441\u0435\u0442\u044c \u2014 10.10.10.0\/24 (\u0442.\u0435. 10.10.10.* \u2014 \u0438\u0437 \u043f\u043e\u0434\u0441\u0435\u0442\u0438)<br \/>  \u0414\u043e\u043c\u0435\u043d \u2014 *.my.domain<br \/>  \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 DNS \u0441\u0435\u0440\u0432\u0435\u0440 \u2014 10.10.10.253<\/p>\n<p>  \u0421\u0435\u0440\u0432\u0435\u0440 my.domain \u0438\u043c\u0435\u0435\u0442 \u0431\u0435\u043b\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0438\u0437\u0432\u043d\u0435<br \/>  \u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441\u0442\u043e\u0438\u0442 nginx, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432\u0438\u0434\u0430 subdomain.my.domain \u043c\u0430\u0448\u0438\u043d\u0430\u043c \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438.<\/p>\n<p>  \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0448\u0451\u043b \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c \u043d\u0430 subdomain.my.domain, \u0442\u043e DNS \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u0432\u0435\u0440\u043d\u0443\u0442 \u0431\u0435\u043b\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441 my.domain, \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442 \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 IP \u0430\u0434\u0440\u0435\u0441\u0443 HTTP \u0437\u0430\u043f\u0440\u043e\u0441, \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 nginx \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u0442\u0441\u044f \u043a\u0443\u0434\u0430 \u0435\u0433\u043e \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442.<\/p>\n<p>  \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u043c VPN \u043c\u043e\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0430:  <\/p>\n<pre><code class=\"bash\">ssh subdomain <\/code><\/pre>\n<p>  \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0443 \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0435\u0442\u0438.<br \/>  \u0417\u0430\u0447\u0435\u043c? <\/p>\n<p>  \u041c\u043d\u0435 \u0442\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u043e. \u042f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443, \u0438 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e \u0433\u0443\u043b\u044f\u044e \u043f\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0435\u0442\u0438 \u0438 \u043b\u0438\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u0438.<br \/>  \u0421\u043d\u0430\u0440\u0443\u0436\u0438 \u043f\u043e *.my.domain \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0432\u0438\u0434\u044f\u0442 \u0440\u043e\u0432\u043d\u043e \u043e\u0434\u0438\u043d \u0441\u0435\u0440\u0432\u0435\u0440 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443 \u0438 VPN) \u0438 \u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0430\u0448\u0438\u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442<br \/>  \u042f \u0436\u0435 \u043c\u043e\u0433\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043f\u043e ssh \u043a\u0430\u043a \u043a \u043c\u0430\u0448\u0438\u043d\u0430\u043c \u0438\u0437 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0435\u0442\u0438, \u0442\u0430\u043a \u0438 \u0438\u0437 \u043b\u0438\u0447\u043d\u043e\u0439<\/p>\n<p>  \u00ab\u041f\u043e\u0434\u043e\u0436\u0434\u0438\u00bb, \u0441\u043a\u0430\u0436\u0435\u0442 \u043c\u043d\u0435 \u044e\u0437\u0435\u0440.<br \/>  \u00ab\u042f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u043f\u0438\u0448\u0443 \/etc\/resolv.conf\u00bb:  <\/p>\n<pre><code class=\"bash\">search local.company.name my.domain <\/code><\/pre>\n<p>  \u0418 \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>  \u041d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u043e\u043d\u044b \u2014 local.company.name \u0438 my.domain \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 DNS \u0441\u0435\u0440\u0432\u0435\u0440. \u0427\u0435\u0440\u0435\u0437 resolv.conf, openresolv \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f.<\/p>\n<h4>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u043e\u0432 \u043c\u0443\u0447\u0430\u0442\u044c \u0433\u0443\u0433\u043b\u044c \u0438 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u0430\u0434\u043c\u0438\u043d\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<br \/>  \u041c\u043e\u0439 \u043f\u043e\u0441\u0442 \u043f\u0440\u0438\u0437\u0432\u0430\u043d \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c bind. \u0420\u0430\u0431\u043e\u0447\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 Arch Linux:  <\/p>\n<pre><code class=\"bash\">pacman -S bind systemctl enable named <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \/etc\/named.conf, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0443\u0434\u0430  <\/p>\n<pre><code class=\"bash\">zone &quot;local.company.name&quot; IN { \ttype forward; \tforwarders { 10.0.20.186; }; };  include &quot;\/usr\/share\/openvpn\/named.conf.my.domain&quot;;  zone &quot;.&quot; IN { \ttype forward;         forwarders { 8.8.8.8; 8.8.4.4; }; }; <\/code><\/pre>\n<p>  \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c NetworkManager \u043b\u0438\u0431\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \/etc\/resolv.conf. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c:<br \/>  root@t510 0 \/usr\/share\/openvpn # cat \/etc\/resolv.conf  <\/p>\n<pre><code class=\"bash\"># Generated by NetworkManager search local.company.name my.domain nameserver 127.0.0.1 <\/code><\/pre>\n<p>  \u0412 openvpn \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f my.domain \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c  <\/p>\n<pre><code class=\"bash\">up &quot;\/usr\/share\/openvpn\/update-dns-my.domain&quot; down &quot;\/usr\/share\/openvpn\/update-dns-my.domain&quot; <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \/usr\/share\/openvpn\/update-dns-my.domain \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 bind \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  set -eu  NAME=\/usr\/share\/openvpn\/named.conf.my.domain TEMPLATE=${NAME}.template  function restart_bind () {     \/usr\/bin\/systemctl restart named }  case $script_type in     up) \tcat ${TEMPLATE} &gt; ${NAME} \trestart_bind \t;;     down) \tcat \/dev\/null &gt; ${NAME} \trestart_bind \t;; esac <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \/usr\/share\/openvpn\/named.conf.my.domain.template  <\/p>\n<pre><code class=\"bash\">zone &quot;my.domain&quot; IN {      type forward;      forwarders { 10.10.10.253; }; }; <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442?<\/p>\n<p>  \u041f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043b\u0438\u0447\u043d\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443:  <\/p>\n<ol>\n<li>openvpn \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \/usr\/share\/openvpn\/update-dns-my.domain<\/li>\n<li>\u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0444\u0430\u0439\u043b \/usr\/share\/openvpn\/named.conf.my.domain \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \/usr\/share\/openvpn\/named.conf.my.domain.template<\/li>\n<li>\u0441\u043a\u0440\u0442\u0438\u043f\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 bind<\/li>\n<li>bind \u0432\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u043e\u043d\u044b my.domain \u0438\u0437 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/li>\n<\/ol>\n<p>  \u041f\u0440\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f  <\/p>\n<ol>\n<li>openvpn \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \/usr\/share\/openvpn\/update-dns-my.domain<\/li>\n<li>\u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u0447\u0438\u0449\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \/usr\/share\/openvpn\/named.conf.my.domain.template<\/li>\n<li>\u0441\u043a\u0440\u0442\u0438\u043f\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 bind<\/li>\n<li>bind \u0432\u044b\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u043e\u043d\u044b my.domain \u0438\u0437 \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 (\u0437\u0430\u0431\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e \u0437\u043e\u043d\u0443)<\/li>\n<li>\u0437\u043e\u043d\u0430 my.domain \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0441\u043e\u043b\u0432\u0438\u0442\u0441\u044f \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 DNS<\/li>\n<\/ol>\n<p>  \u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435?<\/p>\n<pre><code class=\"bash\">root@t510 0 \/usr\/share\/openvpn # ping -c 1 cdash-master PING cdash-master.local.company.name (10.0.20.237) 56(84) bytes of data. 64 bytes from 10.0.20.237: icmp_seq=1 ttl=63 time=214 ms ...  root@t510 0 \/usr\/share\/openvpn # ping -c 1 db PING db.my.domain (10.10.10.200) 56(84) bytes of data. 64 bytes from 10.10.10.200: icmp_seq=1 ttl=63 time=233 ms ...  root@t510 0 \/usr\/share\/openvpn # systemctl stop openvpn@hetzner    root@t510 0 \/usr\/share\/openvpn # ping -c 1 db                   PING db.my.domain (178.63.28.181) 56(84) bytes of data. 64 bytes from wesnoth.in (178.63.28.181): icmp_seq=1 ttl=55 time=124 ms ...  root@t510 0 \/usr\/share\/openvpn # systemctl start openvpn@hetzner   root@t510 0 \/usr\/share\/openvpn # ping -c 1 db                    PING db.my.domain (10.10.10.200) 56(84) bytes of data. 64 bytes from 10.10.10.200: icmp_seq=1 ttl=63 time=118 ms ... <\/code><\/pre>\n<p>  \u0417\u0430\u0431\u0430\u0432\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0431\u043e\u0442\u044b.      \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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\/182924\/\"> http:\/\/habrahabr.ru\/post\/182924\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h4>\u041e\u0442\u043a\u0443\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h4>\n<p>  \u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u0432\u0430\u0441 \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0438\u0437 \u0434\u043e\u043c\u0430.<br \/>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432 VPN \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0441 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0435\u0442\u044c\u044e \u00ab\u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432 \u043d\u0435\u0439\u00bb.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432 linux?<br \/>  \u0412 \/etc\/resolv.conf \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f (\u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 openresolv \u0438\u043b\u0438 NetworkManager)  <\/p>\n<pre><code class=\"bash\">search local.company.name nameserver 10.0.20.186 <\/code><\/pre>\n<p>  \u0413\u0434\u0435 local.company.name \u2014 \u0434\u043e\u043c\u0435\u043d \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0430 10.0.20.186 \u2014 ip \u0430\u0434\u0440\u0435\u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e (\u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0435\u0442\u0438) DNS \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0430?  <\/p>\n<pre><code class=\"bash\">root@t510 0 \/usr\/share\/openvpn # ping -c 1 cdash-master PING cdash-master.local.company.name (10.0.20.237) 56(84) bytes of data. 64 bytes from 10.0.20.237: icmp_seq=1 ttl=63 time=214 ms ... <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e?  <\/p>\n<ol>\n<li>search \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043a cdash-master \u0441\u0443\u0444\u0444\u0438\u043a\u0441 local.company.name<\/li>\n<li>DNS \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0435\u0442\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043b cdash-master.local.company.name \u0432 10.0.20.237<\/li>\n<\/ol>\n<p>  \u0412\u0441\u0451 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u043a\u0430 \u0443 \u0432\u0430\u0441 VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u2026 \u043e\u0434\u043d\u043e.<br \/>  \u041c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0434\u0432\u0430 VPN \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0432\u0430 DNS \u2014 \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0435\u0442\u0438, \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u043d\u0430 hetzner, \u0433\u0434\u0435 \u043a\u0440\u0443\u0442\u044f\u0442\u0441\u044f \u043c\u043e\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b.<\/p>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0449\u0435? \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0443\u0442\u044c \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u0431\u044b\u043b \u0434\u043e\u043b\u0433\u0438\u043c \u0438 \u0438\u0437\u0432\u0438\u043b\u0438\u0441\u0442\u044b\u043c.<\/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-182924","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/182924","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=182924"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/182924\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=182924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=182924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=182924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}