{"id":155,"date":"2024-01-10T15:45:58","date_gmt":"2024-01-10T23:45:58","guid":{"rendered":"https:\/\/blog.sacko.dev\/?p=155"},"modified":"2024-01-25T17:23:00","modified_gmt":"2024-01-26T01:23:00","slug":"ipv6-only-vps-how-to-get-working-with-ipv4","status":"publish","type":"post","link":"https:\/\/blog.sacko.dev\/?p=155","title":{"rendered":"IPv6-only VPS: How to Get Working with IPv4"},"content":{"rendered":"\n<p>In my quest to figure out getting IPv6 to talk to IPv4, I looked into adding nameservers to my linux VPS that use DNS64\/NAT64 such as NAT64.net, but that did not seem to make much difference. I also heard of a service called Tunnelbroker through Hurricane Electric, or possibly using a VPN with IPv4 and IPv6 support and having the server talk through that.<\/p>\n\n\n\n<p>But in my research, I discovered Cloudflare. They have a few nice services to help out with web hosting.  For this article, we will be looking at their free DNS service. This resolved all of my issues with getting this IPv6 web server to talk to IPv4 clients after a bit of configuration in Cloudflare and my Linux server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Configure Cloudflare DNS with Existing Domain<\/h2>\n\n\n\n<p>First off, you will want to create a free Cloudflare account. Once you finish that up, add your domain through the top-right <strong>Add Site<\/strong> button. During this process, it will tell you to change your nameservers to the ones they provide you with; just log into your domain&#8217;s DNS provider and configure the domain to use them. They will also auto-fill your DNS records from your old DNS provider, which is convenient.<\/p>\n\n\n\n<p>Once you are finished up with that, go into <strong>DNS<\/strong> on the left to configure some records. For any domains you want to be able to talk to IPv4, you will want to <strong>keep Proxy ON<\/strong>. SSH does not work with Proxy on, so you will want to <strong>make a new AAAA record<\/strong> for the name <strong>&#8216;ssh&#8217;<\/strong> with your <strong>server&#8217;s IPv6<\/strong>. Make sure to connect to your server via SSH with that domain from now on. You will still need IPv6 support for SSH.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Disabling Cloudflare&#8217;s Automatic SSL Service<\/h2>\n\n\n\n<p>Cloudflare offers a service where they can take care of your website&#8217;s SSL certificates for you. This can be nice for simpler websites since you won&#8217;t have to work with certbot and validating a certification yourself, but it ended up breaking this website using WordPress. Even with some website configuration, I could not get it working with Cloudflare&#8217;s SSL as it would not let me login to wp-admin. So you still may want to do certifications yourself.<\/p>\n\n\n\n<p><strong>To disable Cloudflare&#8217;s automatic SSL service<\/strong>, you would go to the <strong>SSL\/TLS<\/strong> section on the left, and you should be in <strong>Overview<\/strong>. Select <strong>Full<\/strong> for SSL\/TLS encryption, then your certbot certifications should be working again, or you may have to renew them. It should also unbreak your WordPress sites, which was my case. The Full setting lets you do self-signed certificates, allowing certbot certifications to function.<\/p>\n\n\n\n<p>If your server still has trouble communicating, you may need to configure your web server&#8217;s nameservers. You may have a different way of doing it with whatever network manager your server uses, but this method worked for me on Debian. Open your <strong>\/etc\/resolv.conf<\/strong>, then add in Cloudflare&#8217;s IPv6 nameservers; erase the remaining ones:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nameserver 2606:4700:4700::1111\nnameserver 2606:4700:4700::1001<\/code><\/pre>\n\n\n\n<p>After this, I ran this command to disable any installed network managers from messing with the \/etc\/resolv.conf and resetting your changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/makes file immutable\nchattr +i \/etc\/resolv.conf\n\n\/\/to undo, use the same command, but with -i<\/code><\/pre>\n\n\n\n<p>To test if your nameserver settings are working, you can run this command to make sure it matches up with the newly-added nameservers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dig example.org | grep SERVER<\/code><\/pre>\n\n\n\n<p>If it doesn&#8217;t work, try to reboot your server, then try it again.<\/p>\n\n\n\n<p>Your websites should be working fine from there with the new configuration, and should be working with IPv4-only clients. To test this myself, I would go into network settings of the network I am using on my computer and disable IPv6, disconnect and reconnect, then open my website in my browser. A ping from an IPv4-only client would work, too.<\/p>\n\n\n\n<div class=\"important-links\">\n<div class=\"il-box\">\n<a href=\"https:\/\/themeisle.com\/blog\/cloudflare-for-wordpress-tutorial\/\">Configuring Cloudflare to work with WordPress<\/a>\n<a href=\"https:\/\/gist.github.com\/unixfox\/bb299ce4f862fad66ee2e6d9024bef98\">GitHub on Configuring DNS64 nameservers<\/a>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In my quest to figure out getting IPv6 to talk to IPv4, I looked into adding nameservers to my linux VPS that use DNS64\/NAT64 such as NAT64.net, but that did not seem to make much difference. I also heard of a service called Tunnelbroker through Hurricane Electric, or possibly using a VPN with IPv4 and <a href=\"https:\/\/blog.sacko.dev\/?p=155\" class=\"more-link\">&#8230;<span class=\"screen-reader-text\">  IPv6-only VPS: How to Get Working with IPv4<\/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":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.sacko.dev\/index.php?rest_route=\/wp\/v2\/posts\/155"}],"collection":[{"href":"https:\/\/blog.sacko.dev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.sacko.dev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.sacko.dev\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.sacko.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=155"}],"version-history":[{"count":9,"href":"https:\/\/blog.sacko.dev\/index.php?rest_route=\/wp\/v2\/posts\/155\/revisions"}],"predecessor-version":[{"id":205,"href":"https:\/\/blog.sacko.dev\/index.php?rest_route=\/wp\/v2\/posts\/155\/revisions\/205"}],"wp:attachment":[{"href":"https:\/\/blog.sacko.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.sacko.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.sacko.dev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}