{"id":468,"date":"2016-01-21T17:06:56","date_gmt":"2016-01-21T13:06:56","guid":{"rendered":"http:\/\/blog.mgvmi-hipl.ru\/?p=468"},"modified":"2016-01-21T17:50:43","modified_gmt":"2016-01-21T13:50:43","slug":"openvpn","status":"publish","type":"post","link":"https:\/\/blog.5flor.ru\/?p=468","title":{"rendered":"OpenVPN"},"content":{"rendered":"<h1>CentOS<\/h1>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 EPEL:<br \/>\nwget http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/i386\/epel-release-6-8.noarch.rpm<br \/>\nrpm -Uvh epel-release-6-8.noarch.rpm<br \/>\n\u0418 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442:<br \/>\nyum install openvpn -y<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenVPN<br \/>\n\u0414\u043b\u044f openvpn &gt; 2.3<br \/>\n\u0414\u043b\u044f OpenVPN \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u044b\u0448\u0435 2.3 \u043d\u0430\u0431\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 easy-rsa \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0430 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e:<br \/>\nmkdir \/src; cd \/src &amp;&amp; wget https:\/\/github.com\/OpenVPN\/easy-rsa\/archive\/master.zip<br \/>\nunzip master.zip<br \/>\ncd easy-rsa-master<br \/>\n.\/build\/build-dist.sh<br \/>\n\u0420\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0430\u0440\u0445\u0438\u0432:<br \/>\ntar zxvf EasyRSA-git-development.tgz &amp;&amp; cd EasyRSA-git-development<br \/>\n\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442:<br \/>\n.\/easyrsa init-pki<br \/>\n.\/easyrsa build-ca<br \/>\n\u041f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0434\u0432\u0430\u0436\u0434\u044b \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f ca.crt. \u041f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<p>.\/pki\/ca.crt<br \/>\n\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u043b\u044e\u0447\u0438 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<br \/>\n.\/easyrsa build-server-full server<br \/>\n\u041f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0434\u0432\u0430\u0436\u0434\u044b \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f PEM \u0438 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u0434\u043b\u044f ca.crt<br \/>\n\u041f\u043e\u043b\u0443\u0447\u0438\u043c:<br \/>\n.\/pki\/private\/server.key<\/p>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u043b\u044e\u0447\u0438 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430:<br \/>\n.\/easyrsa build-client-full client1<br \/>\n\u041f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u0434\u0432\u0430\u0436\u0434\u044b \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f PEM \u0438 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u0434\u043b\u044f ca.crt<br \/>\n\u041f\u043e\u043b\u0443\u0447\u0438\u043c:<br \/>\n.\/pki\/private\/client1.key<br \/>\n.\/pki\/issued\/client1.crt<\/p>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0414\u0438\u0444\u0444\u0438-\u0425\u0435\u043b\u043b\u043c\u0430\u043d\u0430 (dh.pem):<br \/>\n.\/easyrsa gen-dh<br \/>\n\u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<br \/>\n\u041f\u043e\u043b\u0443\u0447\u0438\u043c:<br \/>\n.\/pki\/dh.pem<br \/>\n\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \/etc\/openvpn\/ \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430:<br \/>\nmv .\/pki\/dh.pem \/etc\/openvpn\/dh1024.pem<br \/>\nmv .\/pki\/private\/client1.key \/etc\/openvpn\/<br \/>\nmv .\/pki\/private\/server.key \/etc\/openvpn\/<br \/>\nmv .\/pki\/ca.crt \/etc\/openvpn\/<br \/>\nmv .\/pki\/issued\/client1.crt \/etc\/openvpn\/<br \/>\nmv .\/pki\/issued\/server.crt \/etc\/openvpn\/<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 HMAC<br \/>\n\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0430 HMAC \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 openvpn \u0441 \u043e\u043f\u0446\u0438\u044f\u043c\u0438 &#8212;genkey \u0438 &#8212;secret:<br \/>\n# cd \/etc\/openvpn<br \/>\n# openvpn &#8212;genkey &#8212;secret ta.key<br \/>\n\u0424\u0430\u0439\u043b\u044b client1.crt, client1.key, ca.crt \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a OpenVPN-\u0441\u0435\u0440\u0432\u0435\u0440\u0443:<br \/>\ncd \/etc\/openvpn<br \/>\nmkdir ovpn-client<br \/>\ncp -rp client1.crt client1.key ca.crt .\/ovpn-client\/<br \/>\nzip ovpn-client.zip .\/ovpn-client\/*<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 openvpn.conf \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenVPN \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443<a href=\"http:\/\/openvpn.net\/index.php\/open-source\/documentation\/howto.html#server\">openvpn.net\/index.php\/open-source\/documentation\/howto.html#server<\/a>. \u041c\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<div>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 server.conf<\/p>\n<div>\n<pre><code>#\u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u043a\u043b\u044e\u0447\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0434\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u0433\u0434\u0435 \u0438 \u0432\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u043e!\r\naskpass \/etc\/openvpn\/pass.txt\r\n#\u041d\u043e\u043c\u0435\u0440 \u043f\u043e\u0440\u0442\u0430\r\nport 1194\r\n#\u0442\u0438\u043f \u043f\u043e\u0440\u0442\u0430\r\nproto udp\r\n# \u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\r\ndev tun\r\nuser openvpn\r\ngroup openvpn\r\n#\u0413\u0434\u0435 \u043a\u043e\u043d\u0444\u0438\u0433 \u0438 \u0433\u0434\u0435 \u043a\u043b\u044e\u0447\u0438\r\ncd \/etc\/openvpn\r\npersist-key\r\npersist-tun\r\ntls-server\r\ntls-timeout 120\r\ndh dh.pem\r\nca ca.crt\r\ncert vpn-server.crt\r\nkey server.key\r\n\u2116\u0444\u0430\u0439\u043b \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439\r\ncrl-verify crl.pem\r\ntls-auth \/etc\/openvpn\/ta.key 0\r\nserver 10.15.0.0 255.255.255.0\r\nclient-config-dir \/etc\/openvpn\/ccd\r\nclient-to-client\r\ntopology subnet\r\nmax-clients 5\r\n#\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0447\u0442\u043e \u0432\u0441\u0451 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u0448\u043b\u044e\u0437\r\npush \"redirect-gateway\"\r\n#\u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043d\u0443\u0436\u043d\u044b\u0439 \u0434\u043d\u0441\r\npush \"dhcp-option DNS 10.15.0.1\"\r\n#\u041f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\r\nroute 10.15.0.0 255.255.255.0\r\n#\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0436\u0430\u0442\u0438\u0435\r\ncomp-lzo\r\nkeepalive 10 120\r\n#\u041b\u043e\u0433\u0438\r\nstatus \/var\/log\/openvpn\/openvpn-status.log 1\r\nstatus-version 3\r\nlog-append \/var\/log\/openvpn\/openvpn-server.log\r\n#\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0433\u043e\u0432\u043e\u0440\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u043b\u043e\u0433\u0430\r\nverb 3\r\nmute 20\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p>\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenVPN \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u0435\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438, \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0438 \u043a\u043b\u044e\u0447\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0430\u0445 openssl.cnf \u0438 server.conf, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f openvpn.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0434\u043b\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenVPN:<br \/>\n<code># mkdir \/var\/log\/openvpn\/<\/code><\/p>\n<p>\u0420\u0435\u0432\u0438\u0437\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c OpenVPN<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0438\u0437 \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0435\u0433\u043e \u0446\u0435\u043d\u0442\u0440\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenVPN, \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0435\u0433\u043e \u0446\u0435\u043d\u0442\u0440\u0430 CA, \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0442\u0437\u044b\u0432\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0444\u0430\u0439\u043b \u0414\u0438\u0444\u0444\u0438-\u0425\u0435\u043b\u043c\u0430\u043d\u0430 \u0438 \u043a\u043b\u044e\u0447 HMAC.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0434\u0435\u043c\u043e\u043d OpenVPN, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \/etc\/openvpn\/ \u0434\u043b\u044f Linux \u0438\u043b\u0438 \/usr\/local\/etc\/openvpn\/ \u0434\u043b\u044f FreeBSD \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0430\u0439\u043b\u044b:<br \/>\nopenssl.cnf \u2014 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 OpenSSL;<br \/>\nserver.conf \u2014 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenVPN;<br \/>\nca.crt \u2014 c\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0435\u0433\u043e \u0446\u0435\u043d\u0442\u0440\u0430;<br \/>\nvpn-server.crt \u2014 c\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenVPN;<br \/>\nserver.key \u2014 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenVPN, \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439;<br \/>\ncrl.pem \u2014 c\u043f\u0438\u0441\u043e\u043a \u043e\u0442\u0437\u044b\u0432\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432;<br \/>\ndh.pem \u2014 \u0444\u0430\u0439\u043b \u0414\u0438\u0444\u0444\u0438-\u0425\u0435\u043b\u043c\u0430\u043d\u0430 \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043e\u0442 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0438;<br \/>\nta.key \u2014 \u043a\u043b\u044e\u0447 HMAC \u0434\u043b\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 DoS-\u0430\u0442\u0430\u043a \u0438 \u0444\u043b\u0443\u0434\u0430<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u0435\u043c\u043e\u043d\u0430 OpenVPN<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 OpenVPN \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a, \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b ifconfig \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 TUN:<\/p>\n<p># ifconfig<br \/>\n&#8230;<br \/>\ntun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00<br \/>\ninet addr:10.15.0.1 P-t-P:10.15.0.1 Mask:255.255.255.0<br \/>\nUP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1<br \/>\nRX packets:0 errors:0 dropped:0 overruns:0 frame:0<br \/>\nTX packets:0 errors:0 dropped:0 overruns:0 carrier:0<br \/>\ncollisions:0 txqueuelen:100<br \/>\nRX bytes:0 (0.0 B) TX bytes:0 (0.0 B)<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/h3>\n<p>\u0424\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043a\u043b\u044e\u0447\u0438 \u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \/etc\/openvpn.<br \/>\n\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u044c\u0442\u0435 \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 openssl.cnf \u0438 server.conf.<\/p>\n<p>\u0424\u0430\u0439\u043b openssl.cnf, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e OpenSSL, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0436\u0435, \u043a\u0430\u043a \u0438 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenVPN.<\/p>\n<h2>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/h2>\n<p>$ .\/easyrsa revoke developer5<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043e\u0442\u043e\u0437\u0432\u0430\u043b\u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 developer5.<br \/>\n\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b CRL \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 OpenVPN<br \/>\n\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0434\u0435\u043c\u043e\u043d OpenVPN.<br \/>\n$ .\/easyrsa gen-crl<br \/>\ncp crl.pem \/etc\/openvpn\/<\/p>\n<p>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430<br \/>\ncat keys\/index.txt<br \/>\nindex.txt \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f . \u0417\u043d\u0430\u043a \u2018R\u2019 (for Revoked) \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 \u0437\u043d\u0430\u0447\u0438\u0442 \u0447\u0442\u043e \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043e\u0442\u043e\u0437\u0432\u0430\u043d.<\/p>\n<p>openssl crl -in crl.pem -text<\/p>\n<p>&nbsp;<\/p>\n<h2>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 server.conf \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 OpenVPN (android)<\/h2>\n<p>dev tun<br \/>\nproto udp<br \/>\nremote 192.168.0.54 1194<br \/>\nclient<br \/>\nresolv-retry infinite<br \/>\nca ca.crt<br \/>\ncert developer1.crt<br \/>\nkey client.key<br \/>\ntls-auth ta.key 1<br \/>\nremote-cert-tls server<br \/>\npersist-key<br \/>\npersist-tun<br \/>\ncomp-lzo<br \/>\nverb 3<br \/>\nstatus-version 3<\/p>\n<p>\u0444\u0430\u0439\u043b \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c client.ovpn<\/p>\n<p>\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043f\u043e\u0434 \u0430\u043d\u0434\u0440\u043e\u0439\u0434.<\/p>\n<p>iptables<\/p>\n<p>iptables -I INPUT -p udp &#8212;dport 1194 -s eth0 -j ACCEPT<\/p>\n<p>iptables -I INPUT -i tun0 -s 172.16.0.0\/24 -j ACCEPT<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 EPEL: wget http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/i386\/epel-release-6-8.noarch.rpm rpm -Uvh epel-release-6-8.noarch.rpm \u0418 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442: yum install openvpn -y \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 OpenVPN \u0414\u043b\u044f openvpn &gt; 2.3 \u0414\u043b\u044f OpenVPN \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u044b\u0448\u0435 2.3 \u043d\u0430\u0431\u043e\u0440 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 easy-rsa \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0430 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e: &hellip; <a href=\"https:\/\/blog.5flor.ru\/?p=468\">\u0427\u0438\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,9],"tags":[],"class_list":["post-468","post","type-post","status-publish","format-standard","hentry","category-linux","category-9"],"_links":{"self":[{"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=\/wp\/v2\/posts\/468"}],"collection":[{"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=468"}],"version-history":[{"count":0,"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=\/wp\/v2\/posts\/468\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.5flor.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}