<?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 Mahmood Rohani on Medium]]></title>
        <description><![CDATA[Stories by Mahmood Rohani on Medium]]></description>
        <link>https://medium.com/@rome-rohani?source=rss-2f1641689444------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*haUny4jGNPur1VHO8q3fcw.jpeg</url>
            <title>Stories by Mahmood Rohani on Medium</title>
            <link>https://medium.com/@rome-rohani?source=rss-2f1641689444------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 18:48:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rome-rohani/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[Optimizing PHP-FPM: Metrics-Driven Right-Sizing]]></title>
            <link>https://rome-rohani.medium.com/optimizing-php-fpm-metrics-driven-right-sizing-374b5aefbf08?source=rss-2f1641689444------2</link>
            <guid isPermaLink="false">https://medium.com/p/374b5aefbf08</guid>
            <category><![CDATA[resource-utilization]]></category>
            <category><![CDATA[php-fpm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Mahmood Rohani]]></dc:creator>
            <pubDate>Sun, 07 Sep 2025 07:25:30 GMT</pubDate>
            <atom:updated>2025-09-14T05:43:05.169Z</atom:updated>
            <content:encoded><![CDATA[<p>After reading Hatam excellent post on <a href="https://medium.com/@hatamabolghasemi/how-i-reduced-php-fpm-based-backend-stack-memory-utilization-by-over-80-without-changing-a-line-a22dd983c6ea">reducing PHP-FPM memory usage by over 80% without touching code</a>, I realized his approach could be made even more robust for production environments. His method — using php-fpm-exporter metrics to detect underutilized workers—is brilliant, but combining it with smarter metrics analysis, safety buffers, and automation makes it safer and more effective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*JGQhsS4T-OE3QfGOPPYTXQ.png" /></figure><h3>What We Want to Improve</h3><p>The original workflow identifies over-provisioned PHP-FPM workers using average metrics and adjusts configs accordingly. While effective, it has some limitations:</p><ol><li>Short metric windows may miss spikes.</li><li>Only memory usage is considered; CPU saturation isn’t tracked.</li><li>No automated validation in staging.</li><li>Configs are applied without safety buffers.</li><li>No integration with Kubernetes horizontal scaling.</li></ol><h3>v2 Method: Smarter Metrics, Safer Configs</h3><h4>Step 1: Collect Longer and Smarter Metrics</h4><ul><li>Use php-fpm-exporter for at least 2–4 weeks.</li><li>Track active, idle processes, CPU, and memory.</li><li>Export metrics to a time-series database like VictoriaMetrics or Prometheus.</li></ul><blockquote><strong><em>Note:</em></strong><em> php-fpm-exporter does </em><strong><em>not</em></strong><em> emit latency histograms or percentiles. If you need latency p95/p99, collect them from your ingress/load balancer (NGINX, Envoy, etc.) or instrument PHP directly.</em></blockquote><h4>Step 2: Analyze Percentiles and Averages</h4><ul><li>Use p95/p99 of <strong>active processes</strong> (not averages) to account for spikes.<br> Include CPU usage to ensure worker counts won’t overload a pod.</li></ul><p>Example PromQL:</p><pre>quantile_over_time(0.95, phpfpm_active_processes[4w])</pre><h4>Step 3: Use Advisor Script with Safety Buffers</h4><ul><li>Adjust pm.max_children based on historical peak values.</li><li>Add a configurable buffer (e.g., 10–20%) to handle unexpected bursts.</li><li>Factor in both memory and CPU metrics.</li></ul><h3>The Improved Advisor Script</h3><p>Code available on GitHub: <a href="https://github.com/mahmoodr/php-fpm-advisor-v2/">php-fpm-advisor-v2</a></p><pre>#!/bin/bash<br>INPUT_FILE=&quot;./input.json&quot;<br><br># Pre-flight checks<br>command -v jq &gt;/dev/null || { echo &quot;jq is required&quot;; exit 1; }<br>[[ -f $INPUT_FILE ]] || { echo &quot;$INPUT_FILE not found&quot;; exit 1; }<br><br># Read input<br>env=$(jq -r &#39;.env&#39; &quot;$INPUT_FILE&quot;)<br>constant_traffic=$(jq -r &#39;.constant_traffic // false&#39; &quot;$INPUT_FILE&quot;)<br>max_active_p95=$(jq -r &#39;.max_active_p95&#39; &quot;$INPUT_FILE&quot;)<br>process_memory_max=$(jq -r &#39;.process_memory_max&#39; &quot;$INPUT_FILE&quot;)<br>cpu_usage_max=$(jq -r &#39;.cpu_usage_max // 0.7&#39; &quot;$INPUT_FILE&quot;) # 0-1<br>served_request_mean=$(jq -r &#39;.served_request_mean // 0&#39; &quot;$INPUT_FILE&quot;)<br>overhead_factor=$(jq -r &#39;.overhead_factor // 1.2&#39; &quot;$INPUT_FILE&quot;)<br>buffer_factor=$(jq -r &#39;.buffer_factor // 1.1&#39; &quot;$INPUT_FILE&quot;)<br><br># Validate numeric inputs<br>for var in max_active_p95 process_memory_max cpu_usage_max served_request_mean overhead_factor buffer_factor; do<br>  if ! [[ ${!var} =~ ^[0-9]+(\.[0-9]+)?$ ]]; then<br>    echo &quot;Invalid value for $var: ${!var}&quot;; exit 1<br>  fi<br>done<br><br># Determine PM mode<br>pm_mode=&quot;&quot;<br>if [[ &quot;$env&quot; == &quot;dev&quot; ]]; then<br>  pm_mode=&quot;ondemand&quot;<br>elif [[ &quot;$env&quot; == &quot;prod&quot; ]]; then<br>  [[ &quot;$constant_traffic&quot; == &quot;true&quot; ]] &amp;&amp; pm_mode=&quot;static&quot; || pm_mode=&quot;dynamic&quot;<br>else<br>  echo &quot;Invalid env: $env&quot;; exit 1<br>fi<br>echo &quot;pm = $pm_mode&quot;<br><br># Calculate max_children considering CPU and memory<br>estimated_total_memory=$(awk &quot;BEGIN { printf \&quot;%.0f\&quot;, $process_memory_max * $max_active_p95 * $overhead_factor * $buffer_factor }&quot;)<br>max_children_memory=$(awk &quot;BEGIN { printf \&quot;%.0f\&quot;, $estimated_total_memory / $process_memory_max }&quot;)<br>max_children_cpu=$(awk &quot;BEGIN { printf \&quot;%.0f\&quot;, $max_active_p95 / $cpu_usage_max }&quot;)<br>max_children=$(( max_children_memory &lt; max_children_cpu ? max_children_memory : max_children_cpu ))<br>echo &quot;pm.max_children = $max_children&quot;<br><br># Max requests heuristic<br>if (( served_request_mean &lt; 10 )); then<br>  max_requests=200<br>elif (( served_request_mean &lt; 200 )); then<br>  max_requests=500<br>else<br>  max_requests=1000<br>fi<br>echo &quot;pm.max_requests = $max_requests&quot;<br><br># Dynamic extra settings<br>if [[ &quot;$pm_mode&quot; == &quot;dynamic&quot; ]]; then<br>  start_servers=$(awk &quot;BEGIN { printf \&quot;%.0f\&quot;, $max_children * 0.2 }&quot;)<br>  min_spare_servers=$start_servers<br>  max_spare_servers=$(awk &quot;BEGIN { printf \&quot;%.0f\&quot;, $max_children * 0.3 }&quot;)<br>  [[ $max_spare_servers -gt $max_children ]] &amp;&amp; max_spare_servers=$max_children<br>  echo &quot;pm.start_servers = $start_servers&quot;<br>  echo &quot;pm.min_spare_servers = $min_spare_servers&quot;<br>  echo &quot;pm.max_spare_servers = $max_spare_servers&quot;<br>fi</pre><h4>Step 4: Validate in Staging</h4><ul><li>Apply the generated configs to a staging environment.</li><li>Run load and stress tests to confirm latency and throughput.</li><li>Check memory, CPU, and worker utilization.</li></ul><h4>Step 5: Combine With Kubernetes Scaling</h4><ul><li>Use <strong>Horizontal Pod Autoscaler (HPA)</strong> to scale pods based on CPU/memory or request rates.</li><li>Right-sized pods plus HPA ensure optimal resource usage and burst handling.</li></ul><h4>Step 6: Monitor Continuously</h4><ul><li>Keep collecting metrics after applying changes.</li><li>Iteratively adjust pm.max_children, pm.start_servers, and other values based on updated traffic patterns.</li></ul><h3>Conclusion</h3><p>With these enhancements — longer metric windows, CPU awareness, safety buffers, automated validation, and Kubernetes scaling — you can safely right-size PHP-FPM configurations, reduce memory waste, and improve overall reliability without changing your application code.</p><p>Metrics-driven tuning, staged validation, and continuous monitoring are the keys to making PHP-FPM perform efficiently in modern microservice architectures.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=374b5aefbf08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Diagnosing Random API Timeouts in Kubernetes Pods: A BGP Troubleshooting Story!]]></title>
            <link>https://rome-rohani.medium.com/diagnosing-random-api-timeouts-in-kubernetes-pods-a-bgp-troubleshooting-story-41109dd836ba?source=rss-2f1641689444------2</link>
            <guid isPermaLink="false">https://medium.com/p/41109dd836ba</guid>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[routing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[bgp]]></category>
            <dc:creator><![CDATA[Mahmood Rohani]]></dc:creator>
            <pubDate>Mon, 28 Apr 2025 07:40:55 GMT</pubDate>
            <atom:updated>2025-04-28T07:40:55.756Z</atom:updated>
            <content:encoded><![CDATA[<h3>Diagnosing Random API Timeouts in Kubernetes Pods: A BGP Troubleshooting Story</h3><p>A few months ago, in one of our staging environments used for pre-production testing, developers reported that their pods were intermittently unable to communicate with other services. A simple API call between two microservices would randomly fail with a <strong>connection timeout</strong>. The issue was unpredictable — sometimes it worked, and sometimes it didn’t.</p><p>This blog post describes the troubleshooting approach I took, the root cause of the problem, and the lessons learned from the experience. If you’ve ever encountered similar issues in your Kubernetes environment, I hope this post will provide some insights into how to approach the problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V_7sD50ReayNVV4bvkOBOg.png" /></figure><h3>The Problem</h3><p>The issue was that pods in the staging environment were unable to communicate with other services on occasion. The problem seemed random, and sometimes an API call between microservices would succeed, but other times it would fail due to a <strong>timeout</strong>. This inconsistency made it hard to pin down the issue at first glance.</p><h3>Debugging Approach</h3><p>Here’s a step-by-step breakdown of the troubleshooting process:</p><h3>1. Checking Events</h3><p>My first step was to inspect the events in the cluster to see if any nodes or pods were in an abnormal state. Using the command:</p><pre>kubectl get events</pre><p>I was able to confirm that there were no major issues with node health or obvious pod failures. This didn’t rule out networking problems, but it was an early indication that the issue might not be related to pod failures or node crashes.</p><h3>2. Investigating Pod Network</h3><p>Next, I began testing the network connectivity from within the affected pods. I executed ping, curl, and nc commands using kubectl exec.</p><p>During this step, I discovered that <strong>some pods couldn’t resolve DNS</strong>, while others had no issue. This was a crucial clue — it pointed to a problem in the <strong>networking layer</strong> of the cluster rather than an issue with the services or microservices themselves.</p><h3>3. Checking CoreDNS</h3><p>I immediately checked the logs of <strong>CoreDNS</strong>, as DNS resolution is a critical part of service discovery in Kubernetes. Using the following command, I inspected the logs for DNS errors:</p><pre>kubectl logs -n kube-system -l k8s-app=kube-dns</pre><p>I found errors such as <strong>“no route to host”</strong>, which indicated that the DNS server was inaccessible for some pods. This confirmed that DNS resolution issues were at the root of the problem.</p><h3>4. Investigating the CNI Plugin (Calico)</h3><p>Since we were using <strong>Calico</strong> as the CNI (Container Network Interface) plugin for networking, I checked the logs for the <strong>Calico node daemonset</strong>:</p><pre>kubectl logs -n kube-system daemonset/calico-node</pre><p>Here, I discovered several errors related to <strong>BGP (Border Gateway Protocol) session downtimes</strong> and <strong>Felix errors</strong>. BGP is used by Calico to manage routing between nodes, so when BGP sessions drop, routing between nodes can be disrupted, leading to connectivity issues.</p><p>In our Kubernetes environment, <strong>BGP </strong>was used as part of the <strong>Calico CNI plugin</strong> to enable <strong>dynamic routing</strong> between nodes. BGP allows Calico to manage the network’s IP routes efficiently, ensuring that traffic can be routed between pods on different nodes. By using BGP, we were able to scale the cluster and maintain resilient networking across multiple nodes, as it provides a robust and flexible routing mechanism that adapts to changes in the network topology. However, when BGP sessions flapped due to a misconfiguration, it caused intermittent connectivity issues, affecting communication between pods and leading to random API timeouts.</p><h3>5. Cross-Layer Debugging</h3><p>At this point, I suspected an issue with the <strong>underlying network infrastructure</strong> — specifically, the physical switches. After some investigation, I discovered that a recent change had been made to the networking layer, which caused <strong>BGP flapping</strong>. Calico relies on BGP to route traffic between nodes, and when BGP peers drop, routing for certain IP ranges becomes unavailable.</p><h3>Immediate Fixes</h3><h3>1. Fixing the BGP Sessions</h3><p>The first step was to communicate with the network team to resolve the <strong>BGP configuration mismatch</strong> on the switches. The root cause of the BGP flapping was an MTU (Maximum Transmission Unit) configuration issue. Once this was fixed, BGP sessions stabilized, and the routing between the nodes was restored.</p><h3>2. Temporary Workaround</h3><p>While the network team worked on the fix, I implemented a temporary solution. We enabled <strong>IP-in-IP encapsulation</strong> in Calico to reduce the dependency on BGP until the physical network was fully stabilized. This allowed the pods to continue communicating while we resolved the issue with the switches.</p><pre>calicoctl patch ipamconfig default - patch &#39;{&quot;spec&quot;:{&quot;ipv4ipip&quot;:{&quot;enabled&quot;:true}}}&#39;</pre><h3>Postmortems and Retro</h3><p>After the issue was resolved, we implemented the following preventive measures to avoid similar problems in the future:</p><p><strong>Monitoring and Alerting for BGP Sessions</strong>:</p><ul><li>We integrated <strong>Prometheus</strong> metrics and <strong>Alertmanager</strong> alerts for monitoring the health of BGP sessions. This allows us to proactively identify any BGP issues before they escalate.</li></ul><p><strong>Hardening the Calico Configuration</strong>:</p><ul><li>We tweaked the <strong>Calico configuration</strong> to allow faster failover for BGP sessions, ensuring that if a session goes down, traffic can still be routed with minimal disruption.</li></ul><p><strong>Network Change Policy</strong>:</p><ul><li>We introduced a <strong>network change policy</strong> to ensure that any changes to the underlying network infrastructure (including switches) would be coordinated with the DevOps/SRE team, even in the staging environment. This helped prevent unexpected network changes from causing issues.</li></ul><h3>Challenges and Lessons Learned</h3><h3>Challenges:</h3><p>The main challenge in this incident was the <strong>randomness</strong> of the issue. Since some pods worked fine and others didn’t, it was easy to mistakenly assume the problem was with the application. However, my experience with Kubernetes networking and CNI plugins helped me quickly narrow down the problem to the networking layer. By ruling out the application as the cause, I was able to focus my efforts on fixing the networking issue without wasting time.</p><h3>Lessons Learned:</h3><ol><li><strong>Random Network Failures Can Be Deceptive</strong>: When connectivity failures are intermittent, it’s easy to misattribute the issue to the application or pods themselves. Always start by testing network connectivity and examining logs from the networking layer (e.g., CoreDNS and CNI plugins).</li><li><strong>Collaborate with Network Teams</strong>: In a multi-layered environment like Kubernetes, network issues often lie outside the cluster itself. Collaboration with the <strong>networking team</strong> is essential for resolving issues related to the underlying physical infrastructure.</li><li><strong>Proactive Monitoring is Crucial</strong>: Setting up proper monitoring for BGP sessions, Calico health, and DNS resolution can help catch these issues early, before they affect application performance.</li><li><strong>Document Network Changes</strong>: Establishing a <strong>network change policy</strong> helps ensure that any changes made to the network infrastructure are communicated to the DevOps team, reducing the risk of accidental disruptions.</li></ol><h3>Conclusion</h3><p>In Kubernetes, networking issues can sometimes be tricky to diagnose, especially when they appear randomly. By following a structured debugging approach, you can narrow down the cause and resolve the problem more effectively. This incident was a valuable reminder that while Kubernetes abstracts much of the complexity, issues at the networking layer still require careful investigation and collaboration with other teams.</p><p>I hope you found this post helpful! If you’ve encountered similar issues or have additional tips, feel free to share your experiences in the comments below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41109dd836ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS CLI Command Completion in Fish Shell]]></title>
            <link>https://rome-rohani.medium.com/aws-cli-command-completion-in-fish-shell-e3e0a7b4b29c?source=rss-2f1641689444------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3e0a7b4b29c</guid>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[fishshell]]></category>
            <category><![CDATA[command-completion]]></category>
            <category><![CDATA[aws-cli]]></category>
            <dc:creator><![CDATA[Mahmood Rohani]]></dc:creator>
            <pubDate>Tue, 04 Mar 2025 10:10:39 GMT</pubDate>
            <atom:updated>2025-03-04T10:17:01.627Z</atom:updated>
            <content:encoded><![CDATA[<p>If you use <strong>AWS CLI v2</strong>, you might already know that it comes with several improvements, including better command completion. However, if you’re using the <strong>fish shell</strong>, you might have noticed that AWS CLI does not natively provide completion support for it. Luckily, fish is incredibly powerful when it comes to handling completions, and enabling AWS CLI autocompletion requires just a single line in your configuration file. Once set up, it works seamlessly, making AWS command-line operations much more efficient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*cMVcv93bTqEGRALxCrygQg.png" /></figure><h4>Step 1: Install AWS CLI v2 Using Homebrew</h4><pre>brew install awscli</pre><p>verify that it’s working:</p><pre>aws --version</pre><h4>Step 2: Enable AWS CLI Command Completion for Fish Shell</h4><p><strong>AWS CLI v2</strong> doesn’t natively provide command completion for fish. to fix it:</p><ol><li>Open your fish shell configuration file:</li></ol><pre>vim ~/.config/fish/config.fish</pre><ol><li>Add the following line to the end of file to enable AWS CLI command completion. This line ensures that AWS CLI completions are loaded when you start a new fish session.</li></ol><pre>test -x (which aws_completer); and complete --command aws --no-files --arguments &#39;(begin; set --local --export COMP_SHELL fish; set --local --export COMP_LINE (commandline); aws_completer | sed \&#39;s/ $//\&#39;; end)&#39;</pre><h3>Step 3: Source Your Fish Config</h3><p>Once you’ve added the line to your config.fish file, reload your fish configuration to apply the changes.</p><pre>source ~/.config/fish/config.fish</pre><h3>Step 4: Test AWS CLI Command Completion</h3><p>Now that the completion is enabled, test it by typing an AWS CLI command, such as:</p><pre>aws ec2 create-&lt;Tab&gt;</pre><p>After pressing <strong>Tab</strong>, you should see a list of available options like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eT_cKp8aEViseIkH2EN-UQ.png" /></figure><p>If you’re an AWS user and fish shell enthusiast, this setup is a must-try!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3e0a7b4b29c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Pragmatic Engineer: Striking the Balance Between Perfection and Practicality]]></title>
            <link>https://rome-rohani.medium.com/the-pragmatic-engineer-striking-the-balance-between-perfection-and-practicality-dcb251a6aa72?source=rss-2f1641689444------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcb251a6aa72</guid>
            <category><![CDATA[pragmatics]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[mindset]]></category>
            <category><![CDATA[practicality]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Mahmood Rohani]]></dc:creator>
            <pubDate>Sun, 02 Mar 2025 13:27:54 GMT</pubDate>
            <atom:updated>2025-03-16T07:11:34.992Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of engineering, whether it’s software development, DevOps, or infrastructure management, how we approach problem-solving and decision-making can drastically affect the outcome of our projects. One of the key distinctions that often arises in the engineering community is the difference between pragmatic engineers and those who are non-pragmatic.</p><p>While both types of engineers can be highly skilled, their mindsets, approaches to challenges, and overall effectiveness can vary significantly. Understanding these differences can help engineers refine their own practices, improve team collaboration, and enhance overall project success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*Wh9ZOv0drgCYKn-_6M85yg.jpeg" /></figure><h3>What Makes an Engineer Pragmatic?</h3><p>A pragmatic engineer is rooted in practicality. They focus on real-world constraints — time, resources, team capabilities, and organizational goals. Their approach is grounded in delivering working solutions, even if those solutions aren’t the most elegant or complex. Pragmatic engineers prioritize what works in practice, understanding that perfection can often be the enemy of progress.</p><h4>Key Traits of a Pragmatic Engineer:</h4><p><strong>Focus on Outcomes: </strong>Pragmatic engineers understand that the goal is to solve the problem, not to create the most complex or ideal solution. They prioritize solutions that work, ensuring they address the problem efficiently and effectively.</p><p><strong>Adaptability: </strong>In the fast-paced world of engineering, things change quickly. Pragmatic engineers are flexible and can adjust their approach based on real-time feedback and constraints. Whether it’s time, budget, or technical limitations, they know how to pivot and deliver solutions that align with the current context.</p><p><strong>Simplicity Over Complexity: </strong>A key principle of pragmatism is simplicity. Pragmatic engineers are often the first to recognize that simple solutions tend to be the most effective. They avoid over-engineering and create systems that are easy to maintain, troubleshoot, and scale.</p><p><strong>Efficiency in Decision-Making: </strong>Instead of trying to find the perfect, most complex solution, pragmatic engineers look for solutions that can be executed quickly and efficiently. They are mindful of the time and resources at their disposal and always aim to do more with less.</p><p><strong>Calculated Risk-Taking: </strong>Pragmatic engineers don’t shy away from risks, but they take calculated risks. Instead of waiting for a perfect solution, they are willing to make incremental improvements, learning from small mistakes rather than attempting to avoid risk entirely.</p><p><strong>Effective Communication and Collaboration: </strong>Pragmatic engineers are able to bridge the gap between technical and non-technical stakeholders. They understand the business impact of their decisions and communicate clearly to ensure that their solutions align with organizational goals.</p><h3>What Happens When Engineers Are Not Pragmatic?</h3><p>On the flip side, non-pragmatic engineers often focus too much on idealism or theoretical perfection. While striving for excellence is admirable, sometimes this pursuit leads to overcomplication and unnecessary delays. Non-pragmatic engineers may pursue solutions that look great in theory but are impractical when applied to real-world situations.</p><h4>Key Traits of a Non-Pragmatic Engineer:</h4><p><strong>Perfectionism: </strong>Non-pragmatic engineers can get caught up in the pursuit of the perfect solution, spending too much time designing complex systems that are difficult to implement or maintain. This over-engineering often leads to delays and missed opportunities for faster, simpler solutions.</p><p><strong>Idealism Over Realism:</strong> Non-pragmatic engineers may aim for perfectly clean code or cutting-edge technologies, even when such solutions aren’t necessary for the current project. They can lose sight of the immediate goals in favor of theoretical ideals that are time-consuming or unrealistic.</p><p><strong>Unnecessary Complexity: </strong>Instead of simplifying problems, non-pragmatic engineers might introduce unnecessary complexity. This can result in systems that are harder to understand, maintain, and troubleshoot, leading to higher costs and longer timelines.</p><p><strong>Inflexibility in Approach: </strong>A non-pragmatic engineer may struggle to adapt to changing circumstances, resisting quick decisions or adaptations based on evolving requirements. They may be more focused on executing their plan as originally conceived, even if it’s no longer the most effective approach.</p><p><strong>Ignoring Constraints: </strong>Non-pragmatic engineers often overlook real-world constraints like time, resources, or team expertise. They might advocate for using the latest technology or implementing features that sound great but are impractical given the project’s scope or the team’s current skillset.</p><p><strong>Reluctance to Take Risks: </strong>Non-pragmatic engineers may shy away from risk-taking entirely, waiting for a “perfect” solution that might never come. They may hesitate to make small, manageable changes that could lead to greater improvements, fearing that even minor risks could lead to failure.</p><h3>Why Pragmatism is Essential in Engineering</h3><p>While idealism and perfectionism have their place in some contexts, being pragmatic in engineering allows for faster progress, better results, and sustainable solutions. Pragmatic engineers know that delivering working software or systems — even if not perfect — has far more value than striving for a theoretical ideal that could take months to implement.</p><p>In fast-moving fields like DevOps, cloud engineering, and software development, agility and adaptability are crucial. Pragmatic engineers are more likely to embrace continuous improvement, making incremental changes that allow for faster feedback loops and ensuring they stay aligned with business needs and technological advancements.</p><h3>Common Pitfalls and Solutions</h3><p>From what we observe, some common pitfalls arise when engineers focus too much on perfection or overcomplicate solutions. These include:</p><ol><li><strong>Overengineering</strong> — Instead of solving the problem with the simplest possible solution, they might be trying to design an overly complex system that isn’t necessary.</li><li><strong>Focusing too much on tools instead of the actual goal</strong> — The team might be caught up in “tool obsession,” prioritizing selecting the best tool or architecture rather than solving the core problem.</li><li><strong>Analysis Paralysis</strong> — Too many options might be on the table, and the team is struggling to make a decision.</li><li><strong>Lack of an MVP or incremental improvement</strong> — Instead of delivering a simple, working solution first, they may be waiting to build a “perfect” system from the start.</li><li><strong>Misalignment with real business needs</strong> — They might not be engaging enough with stakeholders and end-users, focusing too much on technical aspects in isolation.</li></ol><h3>Suggested Solutions:</h3><p><strong>Follow the “KISS” principle (Keep It Simple, Stupid)</strong> — Always aim for the simplest effective solution.</p><p><strong>Focus on the actual problem, not just the tools</strong> — Identify the core issue first, then pick the appropriate technology, not the other way around.</p><p><strong>Build an MVP and iterate</strong> — Deliver a basic working solution first, then refine and scale it.</p><p><strong>Take action instead of endless discussions</strong> — Sometimes, making a decision and moving forward is better than spending weeks debating.</p><p><strong>Get fast feedback and optimize</strong> — Maintain constant interaction with users and stakeholders to ensure you’re solving the right problem.</p><p><strong>Prioritize maintainability</strong> — Solutions should not only work today but be maintainable and scalable in the future.</p><p><strong>Balance trade-offs wisely</strong> — Understand when to compromise on speed, performance, or cost without sacrificing long-term sustainability.</p><h3>Conclusion</h3><p>The difference between a pragmatic engineer and a non-pragmatic engineer boils down to practicality versus perfection. A pragmatic engineer understands the value of simplicity, adaptability, and efficiency. They focus on delivering results in the real world while still striving for improvement. In contrast, a non-pragmatic engineer might be more focused on creating ideal solutions, potentially at the cost of time, resources, and practicality.</p><p>Ultimately, pragmatism is not about sacrificing quality; it’s about balancing technical excellence with real-world feasibility. Engineers who embrace this mindset are more likely to succeed in dynamic, fast-paced environments, driving meaningful results while adapting to the ever-evolving world of technology.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcb251a6aa72" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving Google Cloud 403 Errors: The IPv6 Issue]]></title>
            <link>https://rome-rohani.medium.com/solving-google-cloud-403-errors-the-ipv6-issue-d2fc8b72998a?source=rss-2f1641689444------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2fc8b72998a</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[permission]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[403]]></category>
            <category><![CDATA[error]]></category>
            <dc:creator><![CDATA[Mahmood Rohani]]></dc:creator>
            <pubDate>Sat, 01 Mar 2025 06:51:18 GMT</pubDate>
            <atom:updated>2025-03-01T06:51:18.105Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I encountered a strange issue while trying to pull an image from Google Artifact Registry on my server in Germany. Despite using a proxy and tunneling methods, I kept receiving this error:</p><pre>403: Your client does not have permission to get URL...</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*p3BQijagqO7aQI0rfxiaXA.png" /></figure><p>After several debugging attempts, I discovered that disabling <strong>IPv6</strong> solved the issue immediately.</p><p>But why does this happen? Let’s explore some possible reasons.</p><p>1- Google might use GeoIP-based restrictions for some of its services. When a request is made, Google checks the IP location and decides whether to allow or block the request. However, GeoIP databases for IPv6 could be incomplete or outdated, leading to false blocks.</p><ul><li>Some IPv6 addresses might be mistakenly mapped to sanctioned countries.</li><li>Certain IPv6 blocks may not be correctly registered in the GeoIP database, making Google unable to verify their origin, so access gets denied.</li></ul><p>2- Although Google advocates for IPv6, some of its services may handle IPv6 differently:</p><ul><li>Edge servers could reject unauthenticated IPv6 requests to prevent abuse.</li><li>Some internal firewall or CDN configurations might behave differently for IPv6, causing unexpected blocks.</li></ul><p>3- If you’re using a <strong>VPN, proxy, or tunneling</strong>, there’s a possibility that:</p><ul><li>IPv6 requests bypass the proxy and expose your real location, leading to access issues.</li><li>The assigned IPv6 range may be unknown or flagged, causing Google to reject the request.</li></ul><p>4- Many modern operating systems prioritize IPv6 over IPv4 when both are available. This means:</p><ul><li>Even if your VPN/proxy assigns a valid IPv4 address, your system might still use an IPv6 address that Google blocks.</li><li>You may think your request is coming from a safe IPv4 location, but Google actually sees an IPv6 address from an unwanted range.</li></ul><h3>How to Fix It? Disable IPv6</h3><p>To force your Linux system to use only IPv4 and bypass these issues, disable IPv6 using the following commands:</p><p><strong>For a temporary fix:</strong></p><pre>sysctl -w net.ipv6.conf.all.disable_ipv6=1<br>sysctl -w net.ipv6.conf.default.disable_ipv6=1</pre><p><strong>For a permanent fix:</strong></p><pre>echo &quot;net.ipv6.conf.all.disable_ipv6 = 1&quot; | sudo tee -a /etc/sysctl.conf<br>echo &quot;net.ipv6.conf.default.disable_ipv6 = 1&quot; | sudo tee -a /etc/sysctl.conf<br>sudo sysctl -p</pre><p>After applying these changes, retry accessing Google Cloud services, and the 403 errors should be resolved.</p><p>To check which IPv6 address your system is using before disabling it, try:</p><pre>curl -6 https://ifconfig.co/json</pre><p>or</p><pre>curl -6 https://ipinfo.io</pre><p>These services will show your IPv6 address and its associated location, which might explain why Google is blocking access.</p><h3>Conclusion</h3><p>If you’re running into unexplained <strong>403 errors on Google Cloud services</strong>, consider disabling IPv6. Due to possible issues with outdated GeoIP databases, regional restrictions, and internal Google policies, IPv6 requests may be rejected even when IPv4 works fine. This simple fix could save you hours of frustration!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2fc8b72998a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Merge vs. Rebase and Branching Strategies- The Never-Ending Debate!]]></title>
            <link>https://rome-rohani.medium.com/merge-vs-rebase-and-branching-strategies-the-never-ending-debate-7d886aabeb43?source=rss-2f1641689444------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d886aabeb43</guid>
            <category><![CDATA[merge]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[squash]]></category>
            <category><![CDATA[rebase]]></category>
            <dc:creator><![CDATA[Mahmood Rohani]]></dc:creator>
            <pubDate>Mon, 24 Feb 2025 11:46:03 GMT</pubDate>
            <atom:updated>2025-02-24T11:46:03.614Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve been working with Git long enough, you’ve probably seen heated discussions about whether to use merge or rebase, whether developers should always work on personal branches, or if commits should be squashed before merging. These debates never seem to end, and that&#39;s exactly why I decided to write this post—to break down the key points and help you navigate these decisions effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l7UyvWdRBkbuYxsdIMyCnA.jpeg" /></figure><h3>Merge vs. Rebase: When to Use What?</h3><p>Both merging and rebasing have their place in a Git workflow, and the right choice depends on the context:</p><ul><li><strong>Merge</strong>: Preserves the commit history and creates a new commit to integrate changes. Ideal for maintaining a clear history in shared branches like main or develop.</li><li><strong>Rebase</strong>: Reapplies commits on top of a new base, leading to a cleaner, linear history. Best for local feature branches before merging to avoid unnecessary merge commits.</li></ul><h3>The Effect of Merge and Rebase on Git History</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Hbsw0e8IjNWvTbVWtolgg.png" /></figure><h3>Personal Branches vs. Shared Feature Branches</h3><p>A common approach is to have a shared feature branch where multiple developers contribute. However, this comes with risks:</p><ul><li>If developers directly rebase a shared branch, they rewrite history, potentially causing conflicts for others.</li><li>A better approach is for each developer to work on a <strong>sub-branch</strong> of the feature branch. This keeps individual histories intact and allows seamless collaboration.</li><li>If a developer leaves the project, another developer can continue from the last known state of their sub-branch without disrupting the feature branch.</li><li>If a developer rebases their sub-branch, their commit history changes, but the feature branch remains stable, reducing potential conflicts.</li></ul><h3>Squash Commits: To Do or Not to Do?</h3><p>Squashing commits before merging can make the history cleaner, but at the cost of losing detailed commit messages. A good rule of thumb:</p><ul><li><strong>Squash if the commits are small, incremental changes that don’t need to be preserved individually.</strong></li><li><strong>Avoid squashing if commit history provides valuable context for debugging or auditing.</strong></li></ul><h3>Conclusion</h3><p>There’s no one-size-fits-all solution when it comes to Git workflows. Whether you prefer merge or rebase, personal branches or shared branches, the key is to understand their implications and apply them strategically. Choose what works best for your team while keeping history clean, collaboration smooth, and potential headaches to a minimum.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d886aabeb43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevOps: The Art of Engineering Beyond Tools]]></title>
            <link>https://rome-rohani.medium.com/devops-the-art-of-engineering-beyond-tools-5f4c8d7236b1?source=rss-2f1641689444------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f4c8d7236b1</guid>
            <category><![CDATA[culture]]></category>
            <category><![CDATA[sdlc]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[mindset]]></category>
            <dc:creator><![CDATA[Mahmood Rohani]]></dc:creator>
            <pubDate>Mon, 24 Feb 2025 10:25:44 GMT</pubDate>
            <atom:updated>2025-02-24T10:25:44.663Z</atom:updated>
            <content:encoded><![CDATA[<p>Years have passed since the emergence of DevOps, yet there is still a lot of confusion about what it really is. At its core, DevOps is about the Software Development Lifecycle (SDLC), focusing on improving collaboration, automation, and efficiency across all stages of development and operations. Some believe it’s all about tools — learning Terraform, Kubernetes, or Jenkins and calling it a day. Others think it’s just a fancy name for system administration. Still, there is a lot of confusion about what DevOps really is around me. The reality is far more nuanced. While tools play an important role, DevOps is not just about automation; it’s about <strong>culture</strong>, <strong>processes</strong>, and <strong>problem-solving</strong>. Let’s break it down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vQx5yQ1z3QYAVg5EwIxmCQ.png" /></figure><h3>1. Tools &amp; Automation (30–40%)</h3><p>There’s no doubt that tools are essential for DevOps. Automation is a key principle, and we rely on various technologies to make processes efficient and scalable. Some of the critical tools and technologies include:</p><ul><li><strong>CI/CD Pipelines</strong> — GitHub Actions, Jenkins, ArgoCD</li><li><strong>Configuration Management</strong> — Ansible, Chef, Puppet</li><li><strong>Infrastructure as Code</strong> — Terraform, CloudFormation</li><li><strong>Containerization &amp; Orchestration</strong> — Docker, Kubernetes</li><li><strong>Monitoring &amp; Logging</strong> — Prometheus, Grafana, ELK Stack</li><li><strong>Cloud Platforms</strong> — AWS, GCP, Azure</li></ul><p>However, knowing tools alone doesn’t make someone a DevOps engineer. Tools are enablers, not the goal.</p><h3>2. Culture &amp; Collaboration (20–30%)</h3><p>DevOps is fundamentally about breaking down silos between development and operations teams. If an organization still has a rigid separation between Dev and Ops, no amount of automation can fix underlying inefficiencies.</p><ul><li><strong>Encouraging collaboration</strong> — DevOps teams work closely with developers, SREs, and security engineers.</li><li><strong>Blameless postmortems</strong> — Instead of finger-pointing, teams analyze incidents constructively to prevent future issues.</li><li><strong>Automation-first mindset</strong> — Instead of manual processes, teams focus on repeatability and self-service solutions.</li></ul><h3>3. Processes &amp; Best Practices (20–30%)</h3><p>Adopting DevOps is not just about using tools but also about following best practices:</p><ul><li><strong>SRE Principles</strong> — Setting SLOs, defining error budgets, and improving incident response.</li><li><strong>Agile &amp; Scrum</strong> — DevOps integrates with agile methodologies to improve software delivery speed and feedback loops.</li><li><strong>Security (DevSecOps)</strong> — Shifting security left by integrating security checks early in the development lifecycle.</li><li><strong>Compliance &amp; Governance</strong> — Implementing policies as code and incorporating FinOps strategies to optimize cloud spending.</li></ul><h3>4. Problem-Solving &amp; Architecture (20–30%)</h3><p>One of the most critical aspects of DevOps is the ability to design and troubleshoot complex systems:</p><ul><li><strong>Designing scalable and resilient systems</strong> — Making trade-offs between performance, availability, and cost.</li><li><strong>Performance optimization</strong> — Identifying bottlenecks and improving efficiency.</li><li><strong>Root cause analysis</strong> — Diagnosing failures and preventing them in the future.</li><li><strong>Cloud vs. On-Prem Strategies</strong> — Choosing the right approach based on business needs.</li></ul><h3>The Bottom Line</h3><p>DevOps is not just about tools, nor is it just a cultural shift. It’s a combination of automation, collaboration, best practices, and architectural problem-solving. Tools are important, but they’re only part of the equation. The real value of DevOps lies in improving how teams work together to build and maintain reliable, scalable, and secure systems.</p><p>So the next time someone tells you DevOps is just about knowing Kubernetes or Terraform, remind them — it’s much more than that.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f4c8d7236b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring the Feasibility of Starlink’s Satellite-to-Cell Service]]></title>
            <link>https://rome-rohani.medium.com/exploring-the-feasibility-of-starlinks-satellite-to-cell-service-5d588c234ba3?source=rss-2f1641689444------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d588c234ba3</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[satellite]]></category>
            <category><![CDATA[direct-to-cell]]></category>
            <category><![CDATA[starlink]]></category>
            <dc:creator><![CDATA[Mahmood Rohani]]></dc:creator>
            <pubDate>Sun, 26 Jan 2025 08:30:49 GMT</pubDate>
            <atom:updated>2025-01-26T08:30:49.331Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Elon Musk announced the upcoming beta tests for Starlink’s satellite-to-cell communication service starting on January 27, 2025! <a href="https://www.indiatoday.in/technology/news/story/starlink-satellite-to-cell-phone-service-testing-starts-on-january-27-elon-musk-confirms-2669766-2025-01-24">Source</a></blockquote><p>Naturally, when I heard the news, one of my friend had a strong reaction: “I still think Elon Musk is full of it!”. He’s deeply skeptical about the concept, particularly because he believes that satellites in Low Earth Orbit (LEO) can’t remain at lower altitudes for long without eventually falling back to Earth. He argues that to stay in orbit at these lower altitudes, satellites would need to travel at incredibly high speeds, which wouldn’t be sustainable due to atmospheric drag. And if they stayed too low, they’d burn up in the atmosphere. With LEO satellites typically positioned around 500 kilometers above Earth’s surface, I wonder — how feasible is this satellite-to-cell concept, really?</p><p>However, since <a href="https://ast-science.com/spacemobile-network/">AST SpaceMobile</a> company has also been working on and testing a similar satellite-to-cell communication concept called the SpaceMobile Network, it suggests that Starlink’s ambitions may not be as far-fetched as they initially seemed!</p><p>In this post, I teamed up with several of my colleagues in the telecommunications industry, who are researchers and experts in telecommunications technologies, to explore and examine this topic. Our goal was to address the questions and doubts we’ve had regarding the feasibility of satellite-to-cell communication. They preferred to remain anonymous, but their insights were invaluable in shaping this discussion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OTwcVirMzUhuCdCE7iSl9g.png" /></figure><p>To assess the feasibility of satellite-to-cell communication, we’ll break down the technology into its core components and evaluate the challenges and solutions proposed for each aspect of the system. Here’s how we’ll approach it:</p><h3>Orbital Limitations:</h3><p><strong>Challenge:</strong><br>Starlink satellites are positioned in <strong>Low Earth Orbit (LEO)</strong>, ranging from <strong>500 to 1200 km</strong> above Earth. While this provides low-latency communication and broad coverage, the problem is the <strong>orbital decay</strong> due to <strong>atmospheric drag</strong>. At lower altitudes, satellites would need to maintain incredibly high speeds to avoid falling back to Earth.</p><p><strong>Solution:</strong><br>Satellites in LEO undergo <strong>regular orbital maneuvers</strong> to maintain altitude and counteract atmospheric drag. These maneuvers are performed by the satellites themselves or controlled from the ground. With the <strong>Starlink constellation</strong>, SpaceX has implemented an efficient orbital management system where constellations of satellites work in tandem to ensure operational stability. They continually adjust their orbits to prevent decay and maintain connectivity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-afRFc05TLvRs4H4gM66lQ.jpeg" /></figure><p>While satellites in LEO face the risk of orbital decay, maintaining <strong>sufficient altitude</strong> with <strong>automated correction mechanisms</strong> ensures they stay in orbit long enough to deliver service.</p><h3>Phased Array Antennas: How to Communicate with Mobile Phones in Remote Areas?</h3><p><strong>Challenge:</strong><br>The idea of satellites communicating directly with mobile phones is exciting, but the challenge lies in transmitting signals effectively over vast distances. Mobile phones have very limited power for sending signals, around <strong>0.1 watts</strong>, which could limit their ability to communicate effectively with satellites that are located thousands of kilometers away. Additionally, satellites need to <strong>target mobile devices</strong> across large geographical areas, which is complicated when you consider the vast coverage required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*NC_nnxly4o8q5Q_QZawQ1A.png" /></figure><p><strong>Solution:</strong><br>To solve this, <strong>phased array antennas</strong> are used. These advanced antennas allow satellites to <strong>focus their signal beams</strong> precisely on mobile phones, ensuring high <strong>signal strength</strong> despite the <strong>low power</strong> of mobile phones. The technology behind phased array antennas enables the satellites to <strong>dynamically adjust their beams</strong> without physically moving the antenna, allowing them to track and communicate with devices as they move across the globe. This innovation is central to ensuring effective communication between LEO satellites and mobile phones.</p><h3>Laser Inter-Satellite Links: Enhancing Satellite Communication</h3><p><strong>Challenge:</strong><br>One of the challenges with a satellite constellation like Starlink is ensuring high-speed communication between satellites themselves to maintain continuous service coverage, especially when they pass over areas with no ground-based infrastructure.</p><p><strong>Solution:</strong><br>This is where <strong>laser inter-satellite links (ISLs)</strong> come into play. These links allow <strong>satellites to communicate with each other using lasers</strong>, transmitting data at high speeds. Laser ISLs enable faster and more efficient communication between satellites, bypassing ground stations and reducing latency. For Starlink, this means maintaining continuous data flow across its LEO satellites without waiting for ground-based stations to relay information.</p><p>Laser ISLs are not new but are rapidly advancing, with projects like <strong>AST SpaceMobile</strong> leading the way in ensuring that satellite constellations can handle the massive data throughput required for direct-to-cell communication. These links also enhance redundancy, ensuring that data can be rerouted through other satellites in the constellation if one is temporarily out of range or experiencing issues.</p><h3>Frequency Bands: How Do Satellites and Mobile Devices Communicate?</h3><p><strong>Challenge:</strong><br>Satellites need to communicate using the <strong>right frequency bands</strong> that match those used by mobile devices (such as <strong>4G/5G bands</strong>). Additionally, the satellite signal must be strong enough to reach a mobile phone despite its low transmission power. Without proper frequency coordination, there’s a risk of <strong>interference</strong>, which could disrupt communication.</p><p><strong>Solution:</strong><br>The solution lies in <strong>frequency coordination</strong>. Starlink’s satellites utilize frequencies like <strong>Ku, Ka,</strong> and <strong>V-bands</strong>, which are compatible with the mobile phone bands. By using <strong>high-gain antennas</strong> on both satellites and mobile phones, and with <strong>beamforming</strong> technology to direct the signal efficiently, it becomes possible to provide strong signals to even devices with low power. Coordination with <strong>telecom companies</strong> is also necessary to ensure seamless integration with existing infrastructure.</p><h3>Link Budget: Ensuring Effective Signal Transmission</h3><p><strong>Challenge:</strong><br>To make satellite-to-cell communication work, it’s essential to have a <strong>positive link budget</strong>, which refers to the balance between the signal’s strength when transmitted from the satellite and the strength when received by the mobile device. This involves considering various factors such as <strong>transmit power</strong>, <strong>antenna gains</strong>, and <strong>path losses</strong>.</p><p><strong>Solution:</strong><br>The <strong>link budget</strong> is carefully calculated to ensure that the <strong>signal strength</strong> remains strong enough for communication, even over long distances. Factors like the <strong>distance between satellite and mobile device</strong>, the <strong>elevation angle</strong>, and the <strong>transmission frequency</strong> are considered when designing the communication systems. <strong>Laser ISLs</strong> and <strong>phased array antennas</strong> contribute to improving the link budget by ensuring that signals remain strong and reliable even when dealing with low-power mobile devices.</p><h3>Latency: Can Starlink Offer Low-Latency Communication for Real-Time Use?</h3><p><strong>Challenge:</strong><br>Latency is a significant concern when providing communication services. Satellite-based systems are known for having higher latency due to the <strong>distance</strong> between the satellite and the Earth. For <strong>mobile communication</strong>, a low-latency connection is critical for a smooth user experience.</p><p><strong>Solution:</strong><br>Starlink’s <strong>LEO satellites</strong> offer <strong>low-latency communication</strong>, typically in the range of <strong>25–40 milliseconds</strong>, which is suitable for most applications such as <strong>voice calls</strong>, <strong>instant messaging</strong>, and <strong>internet browsing</strong>. The low altitude of the satellites, combined with high-speed <strong>signal transmission</strong>, allows Starlink to keep the latency low enough to make satellite-to-cell communication viable for real-time interaction.</p><h3>Ground Infrastructure Coordination: How Will Starlink Interact with Existing Telecom Networks?</h3><p><strong>Challenge:</strong><br>For satellite-to-cell communication to be feasible, there needs to be coordination with existing <strong>telecom networks</strong> and <strong>gateway stations</strong>. The Gateway Stations on Earth relay signals between satellites and the internet, and mobile devices will rely on these stations for internet access.</p><p><strong>Solution:</strong><br>Starlink’s system is designed to work with <strong>ground-based telecom infrastructure</strong>. By integrating the <strong>satellite network</strong> with <strong>telecom operators</strong>, Starlink ensures that <strong>frequency coordination</strong> and signal management are handled efficiently. Additionally, <strong>Gateway Stations</strong> will provide the <strong>backhaul connections</strong> to ensure seamless service from the satellite to the user’s device.</p><h3><strong>Recent Research Insights</strong></h3><p>Several recent research papers have provided valuable insights into the potential and challenges of satellite-to-cell communication:</p><ul><li><a href="https://dl.acm.org/doi/pdf/10.1145/3697253.3697265">A Survey on Direct-to-Device Satellite Communications: Advances, Challenges, and Prospects</a></li><li><a href="https://arxiv.org/pdf/2308.04818">Enhancement of Satellite-to-Phone Link Budget by Using Distributed Beamforming</a></li></ul><h3>Conclusion:</h3><p>Now, it’s clear that <strong>satellite-to-cell communication</strong> is technically feasible but faces significant challenges. Starlink, with its <strong>phased array antennas</strong>, <strong>laser ISLs</strong>, <strong>low-latency LEO satellites</strong>, and <strong>advanced frequency coordination</strong>, is addressing these challenges head-on.</p><p>While the technology is still evolving, Starlink’s Direct-to-Cell service is a step toward global connectivity, particularly in remote areas or during disasters. The key challenges include orbital management, power efficiency, coordination with telecom infrastructure, and overcoming environmental factors.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d588c234ba3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Falco: A Powerful Tool for Kubernetes Security]]></title>
            <link>https://rome-rohani.medium.com/falco-a-powerful-tool-for-kubernetes-security-adf920c2110d?source=rss-2f1641689444------2</link>
            <guid isPermaLink="false">https://medium.com/p/adf920c2110d</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[syscalls]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[falco]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Mahmood Rohani]]></dc:creator>
            <pubDate>Mon, 20 Jan 2025 12:16:34 GMT</pubDate>
            <atom:updated>2025-01-20T12:16:34.327Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve worked with Kubernetes, you probably know how important security is for managing clusters. One tool I’ve found incredibly helpful in this space is Falco. It’s an open-source runtime security tool that’s become my go-to for keeping Kubernetes environments safe.</p><p>In this post, I’ll share what Falco is, how it works, and why I think it’s worth adding to your toolbox.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EW4vYw8E6paQcBeopyIFJg.png" /></figure><h3>What is Falco?</h3><p>Falco was originally developed by Sysdig and is now part of the Cloud Native Computing Foundation (CNCF). It’s designed to monitor your applications, containers, and Kubernetes clusters, and alert you when something unexpected happens. Basically, it keeps an eye on system calls made by your containers and nodes, and if anything suspicious pops up, it lets you know.</p><h3>How Does Falco Work?</h3><p>Falco hooks into the Linux kernel to watch system calls. It compares these calls against a set of rules — you can use the default ones or customize your own. If something violates a rule, Falco sends an alert so you can act fast.</p><h3>Key Components of Falco:</h3><ol><li><strong>Kernel Module or eBPF Probe</strong>: Captures system calls and feeds them to Falco.</li><li><strong>Rules Engine</strong>: Matches captured events against defined rules.</li><li><strong>Alerting Mechanism</strong>: Sends alerts through Slack, email, webhooks, or other channels you configure.</li></ol><h3>Why Use Falco for Kubernetes Security?</h3><p>Kubernetes gives you some basic security features, but it doesn’t cover everything, especially when it comes to runtime security. That’s where Falco shines. Here’s why I think it’s a must-have:</p><ol><li><strong>Runtime Threat Detection</strong>: It spots things like unexpected file access, privilege escalation, or config changes.</li><li><strong>Kubernetes Audit Log Monitoring</strong>: Keeps tabs on Kubernetes audit logs for any shady activity.</li><li><strong>Customizable Rules</strong>: You can tailor the rules to fit your specific needs.</li><li><strong>Lightweight</strong>: It’s efficient and doesn’t slow down your cluster.</li></ol><h3>Falco Enrichment: Transforming System Calls into Meaningful Insights</h3><p>One of the standout features of Falco is its enrichment capability. This feature transforms raw Linux system calls into meaningful, human-readable insights, making it much easier to understand what’s happening in your system.</p><h3>What is Enrichment?</h3><p>Enrichment is Falco’s process of collecting metadata and adding it to its output. It involves:</p><ul><li>Observing Linux system calls (syscalls).</li><li>Mapping raw syscall data to user-friendly information (e.g., file descriptors to file names).</li><li>Presenting enriched data through “enrichment fields” in Falco’s output.</li></ul><h3>Why is Enrichment Important?</h3><p>Syscalls are how applications communicate with the operating system, but raw syscall data is hard to interpret. For example, knowing that a process is reading from file descriptor 3 doesn’t tell you which file is being accessed. Enrichment bridges this gap by adding context, like:</p><blockquote><em>“If you had only this read syscall you’d have no idea if /etc/shadow was being read.”</em></blockquote><h3>How Does Enrichment Work?</h3><ol><li><strong>Initial State Table Creation</strong>: When Falco starts, its libscap library scans system resources (like the process list and /proc filesystem) to build an initial “state table” containing metadata about running processes and open files.</li><li><strong>State Table Updates</strong>: Falco’s libinsp (inspection library) constantly monitors system activity to keep the state table up-to-date. It tracks events like file openings, closures, and process creations.</li><li><strong>Output Generation</strong>: When Falco generates output (e.g., for an alert), it uses the state table to enrich the raw syscall data with meaningful information, like file names, user names, and process names.</li></ol><h3>Enrichment Beyond Linux</h3><p>Falco’s enrichment extends beyond Linux resources to include Kubernetes and container information. It achieves this by:</p><ul><li>Monitoring the Kubernetes API server for changes in cluster state.</li><li>Interacting with the container runtime to gather container-specific data.</li></ul><h3>Examples of What Falco Can Do</h3><h3>1. Detecting Privilege Escalation</h3><p>Say a container tries to mess with sensitive files like /etc/passwd. Falco can catch that and alert you.</p><p><strong>Example Rule:</strong></p><pre>- rule: Write to /etc<br>  desc: Detect any writes to files in /etc<br>  condition: evt.type = write and fd.name startswith &quot;/etc&quot;<br>  output: &quot;File write detected to /etc: user=%user.name command=%proc.name file=%fd.name&quot;<br>  priority: WARNING<br>  tags: [filesystem, privilege_escalation]</pre><h3>2. Monitoring Network Activity</h3><p>It’s great for spotting unusual network activity, like a container trying to talk to an external IP it shouldn’t.</p><h3>3. Protecting Kubernetes Control Plane</h3><p>Falco can alert you if someone tries to access the Kubernetes API server or change critical resources like RoleBindings or ClusterRoles.</p><h3>Getting Started with Falco</h3><h3>Installation</h3><p>Installing Falco on Kubernetes is pretty straightforward. You can use Helm to set it up as a DaemonSet, which ensures it runs on all your cluster nodes:</p><pre>helm repo add falcosecurity https://falcosecurity.github.io/charts<br>helm repo update<br>helm install falco falcosecurity/falco</pre><h3>Configuration</h3><p>Once it’s installed, you can tweak its settings by editing the config files (found in /etc/falco in the Falco pod). Add custom rules or modify existing ones to match your security needs.</p><h3>Integration</h3><p>Falco plays well with other tools, so you can send alerts to Slack, PagerDuty, Syslog, or even custom webhooks. Setting up integrations is easy and adds a lot of flexibility.</p><h3>Troubleshooting Enrichment Issues</h3><p>Incomplete or stale data in state tables can lead to issues like “file name = NA” in Falco output. Common causes include:</p><ul><li><strong>Overloaded CPU</strong>: Falco may drop system call input if the CPU is overloaded, leading to incomplete state tables.</li><li><strong>Insufficient Resources for Containers</strong>: Low resource limits for Falco in containerized environments can also cause problems.</li></ul><p>Solutions include increasing resource limits for Falco, offloading workloads, or increasing CPU capacity.</p><h3>Wrapping Up</h3><p>Falco is one of those tools that’s simple to set up but super effective. It’s perfect for keeping an eye on your Kubernetes clusters and catching issues before they become big problems. Its enrichment feature, in particular, transforms raw system calls into actionable insights, making it easier to detect and respond to security threats.</p><p>If you haven’t tried it yet, I highly recommend giving it a shot. Have you used Falco before? I’d love to hear your thoughts or tips in the comments. Let’s keep our clusters secure together!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adf920c2110d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google WiFi AC-1304 with OpenWrt: A Smooth and Powerful Experience]]></title>
            <link>https://rome-rohani.medium.com/google-wifi-ac-1304-with-openwrt-a-smooth-and-powerful-experience-fb372be8ff5b?source=rss-2f1641689444------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb372be8ff5b</guid>
            <category><![CDATA[openwrt]]></category>
            <category><![CDATA[freedom]]></category>
            <category><![CDATA[google-wifi-setup]]></category>
            <category><![CDATA[flash]]></category>
            <category><![CDATA[router]]></category>
            <dc:creator><![CDATA[Mahmood Rohani]]></dc:creator>
            <pubDate>Mon, 16 Dec 2024 10:48:22 GMT</pubDate>
            <atom:updated>2025-12-03T10:29:59.979Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re looking for a router that’s well-suited for running OpenWrt, the Google WiFi AC-1304 also known by its internal name “Google Wifi Gale” is one of the best options available. With a robust hardware, it offers a great platform to take advantage of OpenWrt’s advanced features. In this post, I’ll share my experience of flashing and running OpenWrt on this router.</p><blockquote>This post will be updated gradually over time.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vJx25-DfvqtixCcEm80a-A.jpeg" /></figure><h3>Why Google WiFi AC-1304?</h3><p>Although the Google WiFi AC-1304 is considered an older device (released in 2016) and lacks modern features like Wi-Fi 6 found in today’s routers, its robust hardware makes it an ideal choice for OpenWrt enthusiasts who want to unlock the full potential of their routers and enjoy wireless freedom. Here are some key highlights:</p><ul><li><strong>Processor</strong>: Qualcomm ARM v7 Quad-Core Processor rev 5 (v7l) 716 MHz and Qualcomm IPQ4019 SOC</li><li><strong>Dual-Band Wi-Fi</strong>: Supports both 2.4 GHz and 5 GHz bands, (QCA4019 2.4GHz 802.11bgn + QCA4019 5GHz 802.11ac), ensuring stable and fast connections across your devices.</li><li><strong>4GB eMMC</strong> <strong>Internal Storage and 512 MiB RAM</strong>: Unlike many routers, the AC-1304 includes 4GB of internal storage, providing ample space for installing OpenWrt packages and custom configurations.</li><li><strong>2x 10/100/1000 Mbit/s Ethernet Ports</strong></li><li><strong>1x USB-C / 3.0</strong></li><li><strong>Compact Design</strong>: A sleek and minimalistic look that fits any setup.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7LEgGzX6iZkAiTO7bZOnBQ.png" /></figure><h3>OpenWrt on Google WiFi AC-1304</h3><p>To unlock advanced features like VPN support and traffic shaping, you can flash the Google WiFi AC-1304 router with OpenWrt. This process is particularly beneficial for power users who want more control and customization over their network.</p><p>I followed the <a href="https://openwrt.org/toh/google/wifi">OpenWrt wiki</a> guide for flashing the Google WiFi AC-1304 and also found a YouTube video that offers step-by-step instructions, making the process easy to follow, even for beginners.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fe1TdP1WKSoY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3De1TdP1WKSoY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fe1TdP1WKSoY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/df7ea5461765b080211be52581da4ed8/href">https://medium.com/media/df7ea5461765b080211be52581da4ed8/href</a></iframe><h3>Flashing Google WiFi AC-1304</h3><h4><strong>1. Tools Required:</strong></h4><p>here is the tools required for flashing Google WiFi AC-1304 with OpenWrt:</p><ul><li><strong>A Compatible USB-C Power Adapter (5V 3A):</strong> A proper USB-C power adapter (5V 3A) is essential for stable operation. Without it, you may experience issues such as frequent reboots due to insufficient power.</li><li><strong>A USB Hub with Power Delivery:</strong> You’ll need a USB hub with both USB-C and standard USB ports to support both USB storage and USB-C power supply. I used an ORICO USB hub device for this purpose.</li><li><strong>A USB-C Cable:</strong> Necessary for connecting your power adapter to the USB hub or router.</li><li><strong>A 4GB USB Flash Drive or Larger:</strong> Note that Recovery mode may not work with all USB drives (e.g., some newer USB 3.0 drives). If the device doesn’t accept your USB drive, try using a different one.</li><li><strong>An Ethernet Cable and Converter:</strong> You’ll need a converter to connect the Ethernet cable to a USB or Thunderbolt port in order to link it to your computer.</li><li><strong>A PH0 Screwdriver:</strong> Required to open the router case.</li><li><strong>Chrome Browser:</strong> To install the “OnHub Recovery Utility” extension (note that this utility doesn’t support GNU/Linux, but works fine on macOS/Windows).</li><li><strong>SSH Client:</strong> A terminal program like Terminal (macOS), PuTTY (Windows), or any other SSH client to access the device and copy necessary files.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IUAbpYiO600JvdJHOslvcw.jpeg" /></figure><h4><strong>2. Required Softwares:</strong></h4><ul><li><strong>Download </strong><a href="https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_9334.41.3_gale_recovery_stable-channel_mp.bin.zip"><strong>OEM Firmware</strong></a><strong> and </strong><a href="https://downloads.openwrt.org/releases/23.05.5/targets/ipq40xx/chromium/openwrt-23.05.5-ipq40xx-chromium-google_wifi-squashfs-factory.bin"><strong>Factory image</strong></a><strong>:</strong> First, download the OEM firmware and factory image from the relevant <a href="https://openwrt.org/toh/google/wifi">OpenWRT wiki page for google WiFi</a>.</li></ul><blockquote><strong><em>Note:</em></strong><em> Before flashing OpenWrt, you must restore the Google WiFi to its factory default software. This is important because the stock firmware is based on ChromeOS, which includes a bootloader based on Coreboot and Depthcharge. You’ll need to enable Developer Mode to run non-Google-signed software like OpenWrt.</em></blockquote><ul><li><strong>Install the OnHub Recovery Utility:</strong> Open Chrome and install the OnHub Recovery Utility extension <a href="https://chromewebstore.google.com/detail/onhub-recovery-utility/fmgkgdalfapcmjnanilfcpkhkhedmpdm?hl=en">here</a></li><li><strong>Launch the OnHub Recovery Utility:</strong> Once installed, open the extension and select “Use Local Image” from the top-right menu.</li><li><strong>Select the Factory Image:</strong> Choose the factory image you downloaded earlier (named something like <em>chromeos_</em>**).</li><li><strong>Create the Recovery Image:</strong> Insert your USB flash drive and select it from the menu to create the recovery image.</li></ul><h4>3. Factory Reset</h4><p>Once you have the Recovery USB image, follow these steps to begin the recovery procedure:</p><ul><li><strong>Connect the Power Adapter:</strong> Plug the power adapter into the USB hub using the USB-C port.</li><li><strong>Press and Hold the Reset Button:</strong> While holding the Reset button (located on the front of the device), connect the USB hub’s power cable to the Google WiFi device.</li><li><strong>Wait for the LED to Blink Orange:</strong> After about 16 seconds, the LED should blink orange. At this point, release the Reset button.</li><li><strong>Insert the USB Flash Drive:</strong> Plug the USB flash drive containing the recovery image into the USB hub.</li><li><strong>Recovery Begins:</strong> The LED will turn off, and the recovery process will start.</li><li><strong>Wait for the Device to Reboot:</strong> After approximately 5–6 minutes, the device will automatically reboot, and the LED will pulse blue, indicating that recovery is complete.</li><li><strong>Check for the WiFi SSID:</strong> A WiFi network named “Setup****” should appear in the nearby WiFi scanning results.</li></ul><p><strong>Important:</strong> Do not remove the flash drive until you confirm that the “Setup****” WiFi network appears in the scan results.</p><h4>4. Flashing OpenWrt</h4><p><strong>Launch the OnHub Recovery Utility:</strong> Open the OnHub Recovery Utility extension you installed earlier, and select “Use Local Image” from the top-right menu. This time, choose the OpenWrt image you downloaded previously.</p><ul><li><strong>Select the USB Flash Drive:</strong> From the menu, select the USB flash drive to create the OpenWrt recovery image.</li><li><strong>Opening the device case back door:</strong></li><li><strong>Remove the Screw:</strong> Take out the single screw located at the bottom of the device.</li><li><strong>Pry Open the Cover:</strong> Using a flat screwdriver or guitar pick, gently insert it into the gap between the edge and the base cover, and carefully ease off the cover.</li></ul><p>Inside the device, you’ll find the following components:</p><ul><li><strong>Yellow:</strong> SW7, Developer Mode switch</li><li><strong>Red:</strong> Write-Protect screw</li><li><strong>White Button (on the side of the case, not pictured):</strong> Reset button</li></ul><p>The image below shows the opened router case and its interior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5T87RruWdVIdrtyu825c7w.jpeg" /></figure><h4><strong>5. Booting device with OpenWrt</strong></h4><ul><li><strong>Attach Power to the USB Hub:</strong> Connect the power to the USB hub, but <strong>do not</strong> connect the hub to the device yet. Also, insert the USB storage containing the OpenWrt image into the USB hub.</li><li><strong>Press and Hold the Reset Button:</strong> Press and hold the reset button on the device, then connect the USB hub’s power cable to the device.</li><li><strong>LED Status Indicators:</strong> The LED will go through various stages. Initially, it will be solid white, then flashing blue. After approximately 16 seconds, the LED should blink orange. At this point, release the reset button.</li><li><strong>LED Pulsing Orange and Amber:</strong> After about 3 seconds, the LED should pulse orange and amber.</li><li><strong>Press the SW7 Button:</strong> Use a screwdriver to press the SW7 button (the yellow point highlighted in the image above).</li><li><strong>Device Reboot:</strong> The device will blink purple once or twice and then restart. Wait a few seconds for it to finish booting (it will pulse blue). The LED will start blinking purple again.</li><li><strong>Press SW7 Again:</strong> Press the SW7 button once more. The LED should turn off, and the device should begin booting from the USB image. If this step fails, flashing the Google recovery image and starting over may help.</li><li><strong>Final Boot and Ethernet Connection:</strong> The device will restart and boot from the USB image, with the LED blinking blue. After about 30 seconds, connect the cable to the LAN/Ethernet port with the Earth icon on the case door (not any other Ethernet port!).</li></ul><h4><strong>6. Program OpenWrt image to the </strong>eMMC storage<strong>:</strong></h4><ul><li><strong>Connect the Ethernet Cable:</strong> Connect the Ethernet port on the device to your computer.</li><li><strong>Access the Device Web Interface:</strong> In your web browser, enter 192.168.1.1 in the URL bar and hit Enter (no password is required).</li><li><strong>Note:</strong> Ensure that any Wi-Fi interfaces on the computer are turned off to avoid connection issues.</li><li><strong>Copy the OpenWrt Firmware:</strong> Open a terminal on your computer and copy the OpenWrt firmware binary file to the device.</li></ul><pre>scp -O openwrt-23.05.5-ipq40xx-chromium-google_wifi-squashfs-factory.bin root@192.168.1.1:/tmp/</pre><ul><li>and write the firmware to eMMC storage</li></ul><pre>ssh root@192.168.1.1 -C &quot;dd if=/dev/zero bs=512 seek=7634911 of=/dev/mmcblk0 count=33 &amp;&amp; dd if=/tmp/openwrt-23.05.5-ipq40xx-chromium-google_wifi-squashfs-factory.bin of=/dev/mmcblk0&quot;</pre><ul><li>Now remove the power cable and USB drive from device and close the device case back door. reboot the device.</li><li>Plug the USB power adaptor directly to the device and wait until LED become solid blue. it’s ready now, enjoy it!</li></ul><h4>7. OpenWrt initial Configuration</h4><ul><li><strong>Connect the Ethernet Cable:</strong> Plug the Ethernet cable into the Ethernet port marked with the Earth icon on the device’s back door, and connect the other end to your computer’s Ethernet port. Ensure that any Wi-Fi interfaces on the computer are turned off.</li><li><strong>Access the Web Interface:</strong> In your browser, enter 192.168.1.1 in the URL bar and hit Enter (no password is required).</li><li><strong>Set a Strong Password:</strong> Set a strong password for the OpenWrt router.</li><li><strong>Configure Wireless Settings:</strong> You can now set the wireless interface name and password, and enable it.</li><li><strong>Change LAN Interface Settings:</strong> It’s recommended to edit the LAN interface and change the IPv4 address from 192.168.1.1 to another unused address, such as 192.168.1.120, to avoid conflicts with the gateway.</li><li><strong>Update Gateway and DNS:</strong> Update the gateway IPv4 address to your gateway address (e.g., 192.168.1.1) and add custom DNS servers (such as 1.1.1.1 and 8.8.8.8).</li><li><strong>Reconnect the Device:</strong> Unplug the power cable, then connect the device directly to your gateway router/modem using an Ethernet/LAN port.</li><li><strong>Login to Luci:</strong> Access the Luci web interface via the IP address you set (e.g., 192.168.1.120) in your browser.</li><li><strong>Set Timezone and Sync:</strong> Set the correct timezone, date, and time, and sync it accordingly.</li></ul><h4>8. Expanding the root filesystem partition:</h4><p>You can expand your storage to the full 4GB this device has by executing the following through SSH. first we need to update the repositories and installing some packages:</p><ul><li>update the repositories:</li></ul><pre>opkg update</pre><ul><li>install below packages for expanding the device internal storage:</li></ul><pre>opkg install cfdisk resize2fs fdisk</pre><ul><li>run below command to expand the internal storage:</li></ul><pre>cfdisk /dev/mmcblk0</pre><ul><li>now select the /dev/mmcblk0p2 partition from the menu and select the resize. It should automatically select enough space to take up the rest of the empty space.</li><li>select Write to write the partition table, type “yes” to confirm and the exit.</li><li>Reboot the device again and update the filesystem with below command:</li></ul><pre>resize2fs /dev/loop0</pre><h4>installing OpenVPN on OpenWrt:</h4><pre>opkg install openvpn-openssl luci-app-openvpn</pre><p>you can check openvpn logs by:</p><pre>logread -f | grep openvpn</pre><h4>installing SSHTunnel on OpenWrt:</h4><pre>opkg install openssh-keygen sshtunnel luci-app-sshtunnel</pre><ul><li>generate a new ssh key:</li></ul><pre>ssh-keygen -b 2048 -t rsa</pre><ul><li>Copy the SSH key to the SSH server’s authorized keys file.</li><li>To configure the SSH tunnel, you can either use the Luci app or edit the configuration file below via the command line:</li></ul><pre>vi /etc/config/sshtunnel</pre><ul><li>Uncomment the following items and set their respective values:</li></ul><pre>config server disney<br> option user root<br> option hostname SSH_SERVER_IP<br> option port 22<br> option retrydelay 5<br> option IdentityFile /root/.ssh/id_rsa<br> option LogLevel DEBUG<br> option ServerAliveCountMax 30<br> option ServerAliveInterval 30<br><br>config tunnelD proxy<br> option server disney<br> option localaddress *<br> option localport 9090</pre><ul><li>Enable sshtunnel and start the service:</li></ul><pre>/etc/init.d/sshtunnel enable<br>/etc/init.d/sshtunnel start</pre><ul><li>Set up the SOCKS proxy on the client side (e.g., Chrome or Firefox) by configuring the host to the OpenWrt IP address and the port number you set for the tunnelD localport as the SOCKS proxy.</li></ul><p>You can use Passwall2 to route all traffic through the router, eliminating the need for configuration on the client side.</p><h4>installing and configuring Passwall2 on OpenWrt:</h4><pre>opkg update</pre><ul><li>removing dnsmasq and installing dnsmasq-full:</li></ul><pre>opkg remove dnsmasq &amp;&amp; opkg install dnsmasq-full</pre><ul><li>installing dependencies:</li></ul><pre>opkg install kmod-nft-tproxy kmod-nft-socket wget-ssl</pre><ul><li>get and add repo key:</li></ul><pre>wget -O passwall.pub https://master.dl.sourceforge.net/project/openwrt-passwall-build/passwall.pub &amp;&amp; opkg-key add passwall.pub</pre><ul><li>add the repo:</li></ul><pre>read release arch &lt;&lt; EOF<br>$(. /etc/openwrt_release ; echo ${DISTRIB_RELEASE%.*} $DISTRIB_ARCH)<br>EOF<br>for feed in passwall_luci passwall_packages passwall2; do<br>  echo &quot;src/gz $feed https://master.dl.sourceforge.net/project/openwrt-passwall-build/releases/packages-$release/$arch/$feed&quot; &gt;&gt; /etc/opkg/customfeeds.conf<br>done</pre><ul><li>update repo and install main packages:</li></ul><pre>opkg update &amp;&amp; opkg install luci-app-passwall2 v2ray-geosite-ir</pre><ul><li>installing some extra packages:</li></ul><pre>opkg install v2ray-core xray-core ipset ipt2socks iptables iptables-legacy iptables-mod-conntrack-extra iptables-mod-iprange iptables-mod-socket iptables-mod-tproxy kmod-ipt-nat</pre><p>Note: any issue to update from sourceforge repository you can manually download the packages from sourceforge and install it:</p><pre>opkg install **package_name**</pre><h4>Adding a new node to Passwall2:</h4><p><em>type: xray</em></p><p><em>protocol: Socks</em></p><p><em>Address (Support Domain Name): 127.0.0.1</em></p><p><em>Port: 9090</em></p><p><em>Node Socks Listen Port: 1070</em></p><p><em>check “Main switch” and “Client Proxy”</em></p><p><em>save and apply, then click use to use added node.</em></p><h4>installing Wireguard on OpenWrt:</h4><ul><li>To install openVPN, below packages are required:</li></ul><pre>opkg install wireguard-tools kmod-wireguard luci-app-wireguard luci-i18n-wireguard-en luci-proto-wireguard</pre><h3><strong>Route Iran Traffic Directly</strong></h3><h4>1: Download GeoIP and Geosite Data</h4><p>PassWall 2 relies on <strong>V2Ray-core</strong> data files to make routing decisions. First, SSH into your OpenWrt router and navigate to the V2Ray data directory and download the necessary files:</p><pre>cd /usr/share/v2ray/<br>wget -O geoip.dat https://raw.githubusercontent.com/Chocolate4U/Iran-v2ray-rules/release/geoip.dat<br>wget -O geosite.dat https://raw.githubusercontent.com/Chocolate4U/Iran-v2ray-rules/release/geosite.dat<br>mv geoip.dat geoip_IR.dat<br>mv geosite.dat geosite_IR.dat</pre><blockquote><strong><em>Tip:</em></strong><em> These files are regularly updated. Always ensure you download from trusted sources to maintain security.</em></blockquote><h4>2: Create a Shunt Rule</h4><ol><li>Open your <strong>OpenWrt Web UI → PassWall 2 → Rule Management → Sing-Box/Xray Shunt Rule → Add Shunt Rule</strong>.</li><li>Set the following:</li></ol><ul><li><strong>Remark:</strong> Iran_whitelist</li><li><strong>Domain rules:</strong></li></ul><pre>regexp: .*\.ir$<br>regexp: .*\.xn--mgba3a4f16a$<br>ext: geosite_IR.dat:ir</pre><ul><li><strong>IP rules:</strong></li></ul><pre>ext: geoip_IR.dat:ir</pre><p>Save and apply the rule.</p><h4>3: Add a Shunt Node</h4><p>Now, we need to configure a <strong>Shunt Node</strong>:</p><p>Navigate to <strong>PassWall 2 → Node List → Add Node</strong>.</p><p>Set the node configuration:</p><ul><li><strong>Type:</strong> Xray</li><li><strong>Protocol:</strong> Shunt</li><li><strong>Rule:</strong> Iran_whitelist → Direct connection</li><li><strong>Default:</strong> Any node you’ve previously configured for general proxy traffic</li></ul><p>Save and apply.</p><h4>4: Configure Basic Settings</h4><p>Finally, set your <strong>main routing node</strong>:</p><ol><li>Go to <strong>PassWall 2 → Basic Settings</strong>.</li><li>Set:</li></ol><ul><li><strong>Node:</strong> xray_shunt (the Shunt Node you just created)</li><li><strong>Default:</strong> Any other node for non-Iran traffic</li></ul><p>Save and apply.</p><p>After completing these steps all <strong>Iran traffic</strong> (based on IP and domain rules) will connect <strong>directly. </strong>All other traffic will use your <strong>proxy nodes</strong>. This setup improves routing efficiency and ensures local traffic doesn’t go through unnecessary proxies.</p><h4>Keep Data Files Updated</h4><p>To keep routing rules accurate, regularly update geoip.dat and geosite.dat.</p><h4>Conclusion:</h4><p>The Google WiFi AC-1304 is an excellent choice for anyone looking to explore the capabilities of OpenWrt. Its strong hardware foundation ensures a smooth experience.</p><p>Have you tried using OpenWrt on your router? Share your experiences in the comments below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb372be8ff5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>