{"id":20,"date":"2021-11-01T08:50:12","date_gmt":"2021-11-01T08:50:12","guid":{"rendered":"http:\/\/localhost\/2\/wp\/?p=20"},"modified":"2021-12-08T14:37:16","modified_gmt":"2021-12-08T09:07:16","slug":"openvpn-with-pihole","status":"publish","type":"post","link":"https:\/\/vvcares.com\/blog\/openvpn-with-pihole\/","title":{"rendered":"OpenVPN with PiHole"},"content":{"rendered":"<p>This guide followed from : <a class=\"vglnk\" href=\"https:\/\/docs.pi-hole.net\/guides\/vpn\/openvpn\/installation\/\" rel=\"nofollow\">https:\/\/docs.pi-hole.net\/guides\/vpn\/openvpn\/installation\/<\/a><\/p>\n<p>This script will install openVPN with PiHole with all required iptables rules enabled. This script can install with Digitalocean Anchor IP too (10.15.xx.xx). So you could access the PiHole interface via your desired hostname.<\/p>\n<p>1. UPDATE the server:<\/p>\n<pre><code>sudo -- sh -c 'apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y; apt-get autoremove -y; apt-get autoclean -y'\r\n<\/code><\/pre>\n<hr \/>\n<p>2. Download the OVPN installer from original OVPN source:<\/p>\n<pre><code>wget <a class=\"vglnk\" href=\"https:\/\/git.io\/vpn\" rel=\"nofollow\">https:\/\/git.io\/vpn<\/a> -O openvpn-install.sh\r\nchmod +x openvpn-install.sh\r\n<\/code><\/pre>\n<hr \/>\n<p>3. For client user\/password feature:<\/p>\n<pre><code>*Edit the installer to have password login feature:*\r\nEASYRSA_CERT_EXPIRE=3650 .\/easyrsa build-client-full \"$client\" nopass\r\n    to\r\nEASYRSA_CERT_EXPIRE=3650 .\/easyrsa build-client-full \"$client\"\r\n<\/code><\/pre>\n<hr \/>\n<p>4. RUN the installer:<\/p>\n<pre><code>.\/openvpn-install.sh\r\n<\/code><\/pre>\n<p>5. Install PiHole<\/p>\n<pre><code>curl -sSL <a class=\"vglnk\" href=\"https:\/\/install.pi-hole.net\/\" rel=\"nofollow\">https:\/\/install.pi-hole.net<\/a> | bash\r\n<\/code><\/pre>\n<p>6. Set OVPN clients DNS to follow PiHole service<\/p>\n<pre><code>nano \/etc\/openvpn\/server\/server.conf\r\n\r\nDelete:\r\nif any previous entries of \" push \"dhcp-option DNS xxxxx\" \"\r\n\r\nAdd:\r\npush \"dhcp-option DNS 10.8.0.1\"\r\n<\/code><\/pre>\n<p>7. Finally restart both services Or better to reboot now.<\/p>\n<pre><code>pihole disable &amp;&amp; pihole enable &amp;&amp; systemctl restart openvpn-server@server<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This guide followed from : https:\/\/docs.pi-hole.net\/guides\/vpn\/openvpn\/installation\/ This script will install openVPN with PiHole with all required iptables rules enabled. This script can install with Digitalocean Anchor IP too (10.15.xx.xx). So you could access the PiHole interface via your desired hostname. 1. UPDATE the server: sudo &#8212; sh -c &#8216;apt-get update; apt-get upgrade -y; apt-get dist-upgrade [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,1],"tags":[9,8,10,7],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-linux-ubuntu","category-servers","tag-linux","tag-pihole","tag-ubuntu","tag-vpn"],"_links":{"self":[{"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":0,"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"wp:attachment":[{"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}