{"id":6318,"date":"2024-01-30T16:40:15","date_gmt":"2024-01-30T14:40:15","guid":{"rendered":"https:\/\/skeletor.org.ua\/?p=6318"},"modified":"2024-01-30T16:40:41","modified_gmt":"2024-01-30T14:40:41","slug":"openvpn-%d0%bc%d0%b0%d1%81%d0%be%d0%b2%d0%be-%d0%b3%d0%b5%d0%bd%d0%b5%d1%80%d1%83%d1%94%d0%bc%d0%be-ovpn-%d1%81%d0%b5%d1%80%d1%82%d0%b8%d1%84%d1%96%d0%ba%d0%b0%d1%82%d0%b8","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=6318","title":{"rendered":"[OpenVPN] \u041c\u0430\u0441\u043e\u0432\u043e \u0433\u0435\u043d\u0435\u0440\u0443\u0454\u043c\u043e ovpn-\u043a\u043e\u043d\u0444\u0456\u0433\u0438"},"content":{"rendered":"\n<p>\u0417\u0430\u0440\u0430\u0437 \u0432\u0441\u0435 \u0447\u0430\u0441\u0442\u0456\u0448\u0435 \u0434\u043e\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0443\u0432\u0430\u0442\u0438 \u0441\u0430\u043c\u0435 ovpn \u0444\u0430\u0439\u043b\u0438, \u0434\u0435 \u0432\u0441\u0435 \u0432\u0436\u0435 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456 (\u0456 \u043a\u043e\u043d\u0444\u0456\u0433 \u0456 \u0441\u0435\u0440\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u0438). \u041d\u0438\u0436\u0447\u0435 \u0431\u0443\u0434\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u0435 how-to \u0434\u043b\u044f \u0432\u0438\u043f\u0430\u0434\u043a\u0443, \u043a\u043e\u043b\u0438 \u0442\u0440\u0435\u0431\u0430 \u0437\u0440\u043e\u0431\u0438\u0442\u0438 \u0446\u0435 \u0434\u043b\u044f 10 \u0447\u0438 20 \u043b\u043e\u0433\u0456\u043d\u0456\u0432.<\/p>\n\n\n<p><!--more--><\/p>\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\">1. \u0421\u0442\u0432\u043e\u0440\u044e\u0454\u043c\u043e \u0448\u0430\u0431\u043b\u043e\u043d<\/mark><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">client\ndev tun0\nremote XX.XX.XX.XX 1194\nproto udp\ntun-mtu 1500\nns-cert-type server\nremote-cert-tls server\npull\ncipher AES-128-CBC\nresolv-retry infinite\nnobind\npersist-tun\npersist-key\nkeepalive 10 30\ncomp-lzo\nverb 3\n&lt;ca>\n-----BEGIN CERTIFICATE-----\nXXX\n-----END CERTIFICATE-----\n&lt;\/ca>\n&lt;cert>\nCRT_TMPL\n&lt;\/cert>\n&lt;key>\nKEY_TMPL\n&lt;\/key><\/pre>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\">2. \u0413\u0435\u043d\u0435\u0440\u0443\u0454\u043c\u043e \u043a\u043e\u043d\u0444\u0456\u0433\u0438<\/mark><\/strong><\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><code><kbd>for i in `cat list1.txt`; do echo $i; echo '-----BEGIN CERTIFICATE-----'&gt; ${i}.crt;cat \/etc\/openvpn\/easy-rsa\/keys\/${i}.crt | sed -n '\/BEGIN CERTIFICATE\/,\/END CERTIFICATE\/ {\/\/!p}'&gt;&gt;${i}.crt;echo '-----END CERTIFICATE-----'&gt;&gt;${i}.crt; done<\/kbd><\/code><\/p>\n\n\n\n<p><kbd>for i in `cat list1.txt`; do echo $i; sed \"\/^KEY_TMPL\/ r \/etc\/openvpn\/easy-rsa\/keys\/${i}.key\" &lt; client.ovpn_example &gt; ${i}.ovpn_tmp; done<\/kbd><\/p>\n\n\n\n<p><kbd>for i in `cat list1.txt`; do echo $i; sed \"\/^CRT_TMPL\/ r ${i}.crt\" &lt; ${i}.ovpn_tmp &gt; ${i}.ovpn_new; done<\/kbd><\/p>\n\n\n\n<p><kbd>for i in `cat list1.txt`; do echo $i; cat ${i}.ovpn_new | sed '\/KEY_TMPL\/d' | sed '\/CRT_TMPL\/d' &gt; ${i}.ovpn_new2;done<\/kbd><\/p>\n\n\n\n<p><kbd>mkdir VPN;for i in `cat list1.txt`; do echo $i; mv ${i}.ovpn_new2 VPN\/${i}.ovpn;done<\/kbd><\/p>\n<\/div><\/div>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\">3. \u041f\u043e\u044f\u0441\u043d\u0435\u043d\u043d\u044f.<\/mark><\/strong><\/p>\n\n\n\n<p>\u041a\u043b\u044e\u0447\u0456 \u0456 \u0441\u0435\u0440\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u0438 \u0437\u043d\u0430\u0445\u043e\u0434\u044f\u0442\u044c\u0441\u044f \u0443 \u043f\u0430\u043f\u0446\u0456 <code><kbd>\/etc\/openvpn\/easy-rsa\/keys\/<\/kbd><\/code> , \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0443\u044e\u0447\u0456 &#8211; \u0443 \u043f\u0430\u043f\u0446\u0456 <strong>VPN <\/strong>\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0457 \u043f\u0430\u043f\u043a\u0438, \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0456\u0432 \u0443 \u0444\u0430\u0439\u043b\u0456 <strong>list1.txt<\/strong> (\u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043d\u0430 \u0440\u044f\u0434\u043e\u043a)<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\">4. \u041d\u044e\u0430\u043d\u0441\u0438.<\/mark><\/strong><\/p>\n\n\n\n<p>\u0412\u0440\u0430\u0445\u043e\u0432\u0443\u044e\u0447\u0438, \u0449\u043e \u0454 \u0440\u0456\u0437\u043d\u0456 \u0440\u0435\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457 <strong>sed<\/strong>, \u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0432\u0438\u043f\u0430\u0434\u043a\u0443 \u043c\u0430\u0454\u0442\u044c\u0441\u044f \u043d\u0430 \u0443\u0432\u0430\u0437\u0456 <strong>GNU sed<\/strong>, \u0442\u043e\u0431\u0442\u043e \u043d\u0430 <strong>BSD\/Solaris<\/strong> \u043c\u043e\u0436\u0435 \u043d\u0435 \u043f\u0440\u0430\u0446\u044e\u0432\u0430\u0442\u0438.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0440\u0430\u0437 \u0432\u0441\u0435 \u0447\u0430\u0441\u0442\u0456\u0448\u0435 \u0434\u043e\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0443\u0432\u0430\u0442\u0438 \u0441\u0430\u043c\u0435 ovpn \u0444\u0430\u0439\u043b\u0438, \u0434\u0435 \u0432\u0441\u0435 \u0432\u0436\u0435 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456 (\u0456 \u043a\u043e\u043d\u0444\u0456\u0433 \u0456 \u0441\u0435\u0440\u0442\u0438\u0444\u0456\u043a\u0430\u0442\u0438). \u041d\u0438\u0436\u0447\u0435 \u0431\u0443\u0434\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u0435 how-to \u0434\u043b\u044f \u0432\u0438\u043f\u0430\u0434\u043a\u0443, \u043a\u043e\u043b\u0438 \u0442\u0440\u0435\u0431\u0430 \u0437\u0440\u043e\u0431\u0438\u0442\u0438 \u0446\u0435 \u0434\u043b\u044f 10 \u0447\u0438 20 \u043b\u043e\u0433\u0456\u043d\u0456\u0432.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,13],"tags":[],"class_list":["post-6318","post","type-post","status-publish","format-standard","hentry","category-others","category-security"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/6318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6318"}],"version-history":[{"count":2,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/6318\/revisions"}],"predecessor-version":[{"id":6320,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/6318\/revisions\/6320"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}