<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kushagra arora on Medium]]></title>
        <description><![CDATA[Stories by Kushagra arora on Medium]]></description>
        <link>https://medium.com/@kastrahl?source=rss-242ad7e7b789------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*19xXsj5O7oIcP9yX</url>
            <title>Stories by Kushagra arora on Medium</title>
            <link>https://medium.com/@kastrahl?source=rss-242ad7e7b789------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:54:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kastrahl/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Automating JioFiber IPv6 Firewall Updates with Python, Playwright, and DuckDNS]]></title>
            <link>https://medium.com/@kastrahl/automating-jiofiber-ipv6-firewall-updates-with-python-playwright-and-duckdns-70a5a99b3715?source=rss-242ad7e7b789------2</link>
            <guid isPermaLink="false">https://medium.com/p/70a5a99b3715</guid>
            <category><![CDATA[india]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[information-technology]]></category>
            <dc:creator><![CDATA[Kushagra arora]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 06:20:15 GMT</pubDate>
            <atom:updated>2025-03-06T06:20:15.456Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>If you’re using JioFiber and have hosted a VM on your laptop for web services, you might have faced a challenge: JioFiber assigns dynamic IPv6 addresses, making it difficult to keep firewall rules updated for external access. In this article, I’ll show how I automated IPv6 firewall rule updates using Python, Playwright, and DuckDNS to ensure seamless access to my VM-hosted services.</p><h3>The Problem</h3><p>JioFiber does not offer a static IPv6 address for home users. Each time the router reboots or the ISP resets connections, a new IPv6 address is assigned. Manually updating the firewall rules every time is tedious, so I built an automation script to:</p><ul><li>Detect IPv6 address changes</li><li>Update the JioFiber firewall rules via its web interface</li><li>Remove outdated rules</li><li>Log all actions for debugging</li></ul><h3>The Solution: Python, Playwright, and DuckDNS</h3><p>To automate this process, I used:</p><ul><li><strong>Python</strong> as the scripting language</li><li><strong>Playwright</strong> to interact with the JioFiber web interface</li><li><strong>DuckDNS</strong> for dynamic domain resolution to maintain access</li><li><strong>Ubuntu VM</strong> on my laptop to run services</li></ul><h3>Setting Up the VM and DuckDNS</h3><p>I host my applications inside an <strong>Ubuntu VM</strong> on <strong>VMware Workstation</strong>. To ensure a stable domain, I use <strong>DuckDNS</strong>, which maps a dynamic IP to a fixed domain.</p><p>Steps:</p><ol><li>Create an account on <a href="https://www.duckdns.org/">DuckDNS</a></li><li>Set up a subdomain and configure the DuckDNS script to auto-update your external IPv6</li><li>Install the DuckDNS client inside the VM to update the DNS entry periodically</li></ol><h4>Open a terminal in your <strong>Ubuntu VM</strong>.</h4><ul><li>Install curl if it&#39;s not installed:</li></ul><pre>sudo apt update &amp;&amp; sudo apt install curl -y</pre><ul><li>Create a DuckDNS update script:</li></ul><pre>mkdir -p ~/duckdns &amp;&amp; cd ~/duckdns<br>nano duckdns.sh</pre><ul><li>Add the following content to duckdns.sh (replace with your subdomain &amp; token):</li></ul><pre>#!/bin/bash echo url=&quot;https://www.duckdns.org/update?domains=myserver&amp;token=YOUR_DUCKDNS_TOKEN&amp;ip=&quot; | curl -k -o ~/duckdns/duck.log -K -</pre><ul><li>Replace myserver with your chosen domain.</li><li>Replace YOUR_DUCKDNS_TOKEN with your actual DuckDNS token.</li><li>Save and exit (CTRL+X, then Y, then Enter).</li></ul><h4>Make the Script Executable &amp; Test It</h4><ul><li>Give execution permission:</li></ul><pre>chmod +x duckdns.sh</pre><ul><li>Run the script to update your IP:</li></ul><pre>./duckdns.sh</pre><ul><li>Check the log:</li></ul><pre>cat duck.log</pre><ul><li>If successful, it should say OK.</li></ul><h3>Set Up Auto-Update Every 5 Minutes</h3><ul><li>Open the crontab:</li></ul><pre>crontab -e</pre><ul><li>Add this line at the end:</li></ul><pre>*/5 * * * * ~/duckdns/duckdns.sh &gt;/dev/null 2&gt;&amp;1</pre><ul><li>This runs the script every 5 minutes to update your IP.</li><li>Save and exit (CTRL+X, then Y, then Enter).</li></ul><h3>Automating IPv6 Firewall Updates with Python &amp; Playwright</h3><h4>Installing Playwright:</h4><pre>pip install playwright<br>playwright install</pre><h4>Python Script to Update Firewall Rules</h4><p>download script from my github —</p><p><a href="https://github.com/kastrahl/JioFiberwebhosting/tree/main">GitHub - kastrahl/JioFiberwebhosting: Repo to collect data on how to host web services primarily on Jio fiber home connection</a></p><h3>Automating Execution</h3><p>To ensure the script runs periodically:</p><pre>crontab -e</pre><p>add below entry to the crontab</p><pre>*/10 * * * * python3 /path/to/script.py</pre><p>This executes the script every 10 minutes, keeping the firewall rules up to date.</p><h3>Conclusion</h3><p>With this setup, I can now access my VM-hosted services via DuckDNS without worrying about dynamic IPv6 changes. The automation ensures the firewall rules are updated seamlessly, eliminating manual intervention. If you’re running a home server behind JioFiber, this solution can save you a lot of hassle!</p><p>Let me know if you try it out or have suggestions to improve the setup!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70a5a99b3715" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>