Thursday, July 5, 2018

DDNS with Cloudflare with some network automation sprinkled in

Over the weekend I have been messing around with my home lab, trying to figure out a better way to make it accessible over the Internet. The issue I was having was with providing multiple web services and having only 1 public IP. I obviously could have just set up reverse proxy, but that wasn't interesting enough. I also felt like I could utilize somehow the fact that my home ISP is providing me with IPv6 prefix.

I have realized that Cloudflare could use IPv6-only server as endpoint and then proxy it to both IPv6 and IPv4 users. So I wrote some code that would get the IPv6 address of the system and then update Cloudflare with that data. I also figured that I wanted to be more restrictive with my inbound firewall rules, so I added in some automation in order to update firewall rules with the data.

So, without further due, the code can be found here: https://github.com/eoprede/cf\_dynamic

And if you want a little more information in the form of the blog post, I have put it on packetpushers: https://packetpushers.net/simple-ddns-solution-supporting-ipv6-domains-using-cloudflare-python/

Hopefully this will be useful for somebody. Any comments are welcome!



No comments:

Post a Comment