<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>th.oughts</title>
    <link>https://th.oughts.org/</link>
    <description>Living the fake American dream, 3 years at a time</description>
    <pubDate>Fri, 24 Jul 2026 20:35:43 +0000</pubDate>
    <image>
      <url>https://i.snap.as/ixKmaGoG.jpg</url>
      <title>th.oughts</title>
      <link>https://th.oughts.org/</link>
    </image>
    <item>
      <title>Reflecting on the Open Source Business Model</title>
      <link>https://th.oughts.org/reflecting-on-the-open-source-business-model?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[A long history&#xA;&#xA;After having spent more than a decade using and building my career around free and open source software, I feel compelled to reflect on the choices I made, the lessons I learned, and the knowledge I gained along the way. Reflection doesn’t necessarily imply regret. Rather, time has a way of revealing trade-offs that enthusiasm and passion tend to gloss over.&#xA;&#xA;I don’t clearly remember how I was first introduced to free software, but I do remember why it appealed to me. Growing up in a developing country, access to required software was either prohibitively expensive or casually copied from one user to another—how the prior user obtained it, or whether the copy was even usable, was often left to the imagination. Free software offered something rare: access without compromise. It provided a full-fledged, working version (assuming you could make it work) and access without guilt. The license explicitly permitted free and fair use. I could learn, experiment, and build without the lingering anxiety of a pop-up accusing me of using software without permission.&#xA;&#xA;The cost, of course, was time.&#xA;&#xA;I still remember the first time I decided to install Linux on a newly acquired desktop. Legacy shared interrupt conflicts—between the sound card and another device—prevented the kernel from booting. This was evident from the loud, noisy kernel boot log, something anyone coming from Windows would have found alien. The problem disappeared if I disabled sound in the BIOS. Discovering that workaround, however, took days of debugging. Yet the initial feeling of helplessness gradually gave way to something else: empowerment. With free software, there was usually a way forward, even if it wasn’t obvious at first.&#xA;&#xA;Nerd&#xA;&#xA;Through school and early academic work, I often felt like the odd one out. I gravitated toward kernel internals, memory management, and free software, while most of my peers focused on object-oriented design, design patterns, or computer vision. This gap was exacerbated by the lack of mentors in these areas—until graduate school, there were few experts I could turn to for guidance. Peers, and sometimes even advisors, weren’t quite sure what to do with those interests, and there was always a subtle nudge to “wake up” and align with more mainstream stacks and career paths. &#xA;&#xA;I ignored most of it. My peers laughed.&#xA;&#xA;By the time I reached graduate school, my interest was no longer limited to code and usability. The free software movement, the open source model, and the philosophy surrounding them had become equally compelling. I understood that just because free software benefits society does not mean it can sustain a business. That is where the open source business model steps in. History has shown that companies can build profitable models around open source, but they cannot survive by selling freedom alone. This distinction would later prove far more important than I initially imagined.&#xA;&#xA;I made compromises where they aligned with my broader goals—working at product companies that developed Linux drivers, taking internship opportunities adjacent to my interests because they offered access to teams I aspired to join, and so on. I was determined not to lose focus. Systems-level work, upstream communities, patches and reviews, and environments that valued technical clarity over hierarchy remained my priorities.&#xA;&#xA;The view from the inside&#xA;&#xA;For like-minded people, open source work can be intoxicating. It feels expansive. It allows collaboration beyond immediate teams, contributions to projects an employer may not own, and the opportunity to build an identity tied to patches, reviews, and technical discussions rather than titles. The reward is recognition and a deep sense of participation.&#xA;&#xA;Open source communities are also naturally inclusive. Academia fits easily into this model, as do independent contributors and paid engineers from industry. I leaned into this fully. Some of the most rewarding work I have done lived at the intersection of industry and academic research—projects that were technically meaningful even if they never became products.&#xA;&#xA;The open source company&#xA;&#xA;An open-source-centric company may appear exotic from the outside, but internally it faces the same pressures as any other business. Revenue matters. Survival matters. While the mission may be broader and amplified through branding, it is rarely the highest-priority concern for the business itself.&#xA;&#xA;This creates a quiet tension.&#xA;&#xA;Open source makes intellectual success more accessible. It is not bound by a single company, region, or domain. It allows engineers to build reputation, influence direction, and operate at a level of technical depth that many proprietary environments do not. Career progression, however, follows a different logic. Achievement is tied less to what one enables for the ecosystem and more to how directly one’s work maps to customer acquisition, retention, or revenue protection.&#xA;&#xA;That mapping is often indirect. An engineer may work on or maintain a critical subsystem used widely across the industry, yet find that its impact is diffuse rather than attributable. In organizations whose primary business is support, subscriptions, or services layered on top of shared infrastructure, this makes it difficult to translate community contributions and leadership into internal leverage. This is not universal, and it may not apply to everyone. It is also not malicious. It is structural. Evaluation systems are designed around business outcomes, not communal value creation. Over time, priorities drift—not because people stop caring about open source, but because incentives quietly reshape what is rewarded.&#xA;&#xA;The big trade-off&#xA;&#xA;This is the hardest realization I have come to.&#xA;&#xA;In most technology companies, engineers are treated as high-leverage assets: they own proprietary systems, accumulate tacit knowledge, and maintain code that directly anchors revenue. In many open-source-centric business models, this relationship does not hold in the same way—not because an engineer’s work is less important, but because ownership and scarcity are distributed by design.&#xA;&#xA;Open source excels at eliminating single points of failure. Knowledge becomes visible. Expertise becomes shared. This produces enormous societal benefit, but it also means that individual contributors are rarely irreplaceable in the economic sense. As a result, revenue per engineer often tends to be lower than in proprietary or product-centric companies—not because revenue does not exist, but because it is only weakly coupled to marginal technical excellence. This can affect compensation, recognition, and even self-perception. It is difficult to acknowledge, even implicitly, that work benefiting millions does not clearly move the business needle.&#xA;&#xA;This is not a post proposing solutions. The outcome is largely by design. It is not a failure of leadership or ethics, but the natural consequence of a model optimized for collective resilience rather than individual leverage.&#xA;&#xA;Choice&#xA;&#xA;None of this diminishes the value of open source. It remains one of the most effective mechanisms we have for learning, collaboration, and durable technical progress. It is an unmatched tool for intellectual growth and professional credibility.&#xA;&#xA;But it is not a neutral career choice.&#xA;&#xA;Open source amplifies opportunity, not ownership. Engineers who prioritize learning, autonomy, and community impact have much to gain from it. For those optimizing for financial upside, indispensability, or tightly coupled value creation, it may fall short unless paired with proprietary leverage—products, platforms, or distribution.&#xA;&#xA;I do not view my own path as a mistake, but as a trade-off I accepted without fully understanding its long-term implications. Understanding that trade-off does not make open source less meaningful. It makes participation a conscious choice rather than an assumed good.&#xA;&#xA;That, at least, is the model I wish I had understood earlier in my career.&#xA;&#xA;Further reading:&#xA;&#xA;– Y. Benkler, The Wealth of Networks&#xA;&#xA;– E. S. Raymond, The Cathedral and the Bazaar&#xA;&#xA;– S. Wardley, Wardley Mapping&#xA;&#xA;– N. Ravikant, essays and talks on leverage and ownership&#xA;&#xA;– Linux Foundation, Open Source Sustainability Reports&#xA;&#xA;a href=&#34;https://remark.as/p/th.oughts.org/reflecting-on-the-open-source-business-model&#34;Discuss.../a]]&gt;</description>
      <content:encoded><![CDATA[<h2 id="a-long-history">A long history</h2>

<p>After having spent more than a decade using and building my career around free and open source software, I feel compelled to reflect on the choices I made, the lessons I learned, and the knowledge I gained along the way. Reflection doesn’t necessarily imply regret. Rather, time has a way of revealing trade-offs that enthusiasm and passion tend to gloss over.</p>

<p>I don’t clearly remember how I was first introduced to free software, but I do remember why it appealed to me. Growing up in a developing country, access to required software was either prohibitively expensive or casually copied from one user to another—how the prior user obtained it, or whether the copy was even usable, was often left to the imagination. Free software offered something rare: access without compromise. It provided a full-fledged, working version (assuming you could make it work) and access without guilt. The license explicitly permitted free and fair use. I could learn, experiment, and build without the lingering anxiety of a pop-up accusing me of using software without permission.</p>

<p>The cost, of course, was time.</p>

<p>I still remember the first time I decided to install Linux on a newly acquired desktop. Legacy shared interrupt conflicts—between the sound card and another device—prevented the kernel from booting. This was evident from the loud, noisy kernel boot log, something anyone coming from Windows would have found alien. The problem disappeared if I disabled sound in the BIOS. Discovering that workaround, however, took days of debugging. Yet the initial feeling of helplessness gradually gave way to something else: empowerment. With free software, there was usually a way forward, even if it wasn’t obvious at first.</p>

<h2 id="nerd">Nerd</h2>

<p>Through school and early academic work, I often felt like the odd one out. I gravitated toward kernel internals, memory management, and free software, while most of my peers focused on object-oriented design, design patterns, or computer vision. This gap was exacerbated by the lack of mentors in these areas—until graduate school, there were few experts I could turn to for guidance. Peers, and sometimes even advisors, weren’t quite sure what to do with those interests, and there was always a subtle nudge to “wake up” and align with more mainstream stacks and career paths.</p>

<p>I ignored most of it. My peers laughed.</p>

<p>By the time I reached graduate school, my interest was no longer limited to code and usability. The free software movement, the open source model, and the philosophy surrounding them had become equally compelling. I understood that just because free software benefits society does not mean it can sustain a business. That is where the open source business model steps in. History has shown that companies can build profitable models around open source, but they cannot survive by selling freedom alone. This distinction would later prove far more important than I initially imagined.</p>

<p>I made compromises where they aligned with my broader goals—working at product companies that developed Linux drivers, taking internship opportunities adjacent to my interests because they offered access to teams I aspired to join, and so on. I was determined not to lose focus. Systems-level work, upstream communities, patches and reviews, and environments that valued technical clarity over hierarchy remained my priorities.</p>

<h2 id="the-view-from-the-inside">The view from the inside</h2>

<p>For like-minded people, open source work can be intoxicating. It feels expansive. It allows collaboration beyond immediate teams, contributions to projects an employer may not own, and the opportunity to build an identity tied to patches, reviews, and technical discussions rather than titles. The reward is recognition and a deep sense of participation.</p>

<p>Open source communities are also naturally inclusive. Academia fits easily into this model, as do independent contributors and paid engineers from industry. I leaned into this fully. Some of the most rewarding work I have done lived at the intersection of industry and academic research—projects that were technically meaningful even if they never became products.</p>

<h2 id="the-open-source-company">The open source company</h2>

<p>An open-source-centric company may appear exotic from the outside, but internally it faces the same pressures as any other business. Revenue matters. Survival matters. While the mission may be broader and amplified through branding, it is rarely the highest-priority concern for the business itself.</p>

<p>This creates a quiet tension.</p>

<p>Open source makes intellectual success more accessible. It is not bound by a single company, region, or domain. It allows engineers to build reputation, influence direction, and operate at a level of technical depth that many proprietary environments do not. Career progression, however, follows a different logic. Achievement is tied less to what one enables for the ecosystem and more to how directly one’s work maps to customer acquisition, retention, or revenue protection.</p>

<p>That mapping is often indirect. An engineer may work on or maintain a critical subsystem used widely across the industry, yet find that its impact is diffuse rather than attributable. In organizations whose primary business is support, subscriptions, or services layered on top of shared infrastructure, this makes it difficult to translate community contributions and leadership into internal leverage. This is not universal, and it may not apply to everyone. It is also not malicious. It is structural. Evaluation systems are designed around business outcomes, not communal value creation. Over time, priorities drift—not because people stop caring about open source, but because incentives quietly reshape what is rewarded.</p>

<h2 id="the-big-trade-off">The big trade-off</h2>

<p>This is the hardest realization I have come to.</p>

<p>In most technology companies, engineers are treated as high-leverage assets: they own proprietary systems, accumulate tacit knowledge, and maintain code that directly anchors revenue. In many open-source-centric business models, this relationship does not hold in the same way—not because an engineer’s work is less important, but because ownership and scarcity are distributed by design.</p>

<p>Open source excels at eliminating single points of failure. Knowledge becomes visible. Expertise becomes shared. This produces enormous societal benefit, but it also means that individual contributors are rarely irreplaceable in the economic sense. As a result, revenue per engineer often tends to be lower than in proprietary or product-centric companies—not because revenue does not exist, but because it is only weakly coupled to marginal technical excellence. This can affect compensation, recognition, and even self-perception. It is difficult to acknowledge, even implicitly, that work benefiting millions does not clearly move the business needle.</p>

<p>This is not a post proposing solutions. The outcome is largely by design. It is not a failure of leadership or ethics, but the natural consequence of a model optimized for collective resilience rather than individual leverage.</p>

<h2 id="choice">Choice</h2>

<p>None of this diminishes the value of open source. It remains one of the most effective mechanisms we have for learning, collaboration, and durable technical progress. It is an unmatched tool for intellectual growth and professional credibility.</p>

<p>But it is not a neutral career choice.</p>

<p>Open source amplifies opportunity, not ownership. Engineers who prioritize learning, autonomy, and community impact have much to gain from it. For those optimizing for financial upside, indispensability, or tightly coupled value creation, it may fall short unless paired with proprietary leverage—products, platforms, or distribution.</p>

<p>I do not view my own path as a mistake, but as a trade-off I accepted without fully understanding its long-term implications. Understanding that trade-off does not make open source less meaningful. It makes participation a conscious choice rather than an assumed good.</p>

<p>That, at least, is the model I wish I had understood earlier in my career.</p>

<p>Further reading:</p>

<p>– Y. Benkler, The Wealth of Networks</p>

<p>– E. S. Raymond, The Cathedral and the Bazaar</p>

<p>– S. Wardley, Wardley Mapping</p>

<p>– N. Ravikant, essays and talks on leverage and ownership</p>

<p>– Linux Foundation, Open Source Sustainability Reports</p>

<p><a href="https://remark.as/p/th.oughts.org/reflecting-on-the-open-source-business-model">Discuss...</a></p>
]]></content:encoded>
      <guid>https://th.oughts.org/reflecting-on-the-open-source-business-model</guid>
      <pubDate>Tue, 03 Feb 2026 05:40:46 +0000</pubDate>
    </item>
    <item>
      <title>Backup VPN tunnel using a MVNO data plan</title>
      <link>https://th.oughts.org/backup-vpn-tunnel-using-a-mvno-data-plan?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[Problem Statement&#xA;&#xA;I wanted a cheap backup VPN tunnel to reinforce my main tunnel in case things go wrong. The backup tunnel is on standby and is utilized only when I need an alternate path to investigate why my main network is down or isn&#39;t functioning when I am physically away from my systems.&#xA;&#xA;Challenges&#xA;&#xA;CG-NAT has ruined cellular network based data plans. Cellular networks have kept their eccentric design choices throughout their evolution even though they have leveraged a lot from regular internet based data networks. CG-NAT is one of those inconvenient design choices that has stayed on. To summarize, a lot of the cheap MVNO data plans operate like a NATed LAN and incoming connections aren&#39;t really possible because you do not get gifted with a public IP.  Setting up a VPN tunnel using one of these data networks becomes a bendy road to success.&#xA;&#xA;Design choices&#xA;&#xA;Using a cheap data plan is quite appealing because I would ideally want the cost to be as low as possible without sacrificing much on the minimum reliability that you would expect from a backup network. &#xA;&#xA;Owing to the design restrictions mentioned above, you cannot simply dial in to your backup VPN endpoint. The connection has to be initiated in the opposite direction. This post details how I achieved an usable setup without sacrificing too much on cost or reliability.&#xA;&#xA;Network topology&#xA;&#xA;img src=&#34;https://i.snap.as/Z5RAwYjC.jpg&#34; alt=&#34;Network Topology&#34; style=&#34;width:800px;height:600px;&#34;&#xA;&#xA;Click here for a somewhat legible image.&#xA;&#xA;Main LAN (1)&#xA;The main network gated by a OpenBSD based firewall and gateway. &#xA;&#xA;BMC (2)&#xA;The base management controller to control the gateway.&#xA;&#xA;CRS 326 (3)&#xA;This is the backup gateway using a Mikrotik CRS326. It&#39;s probably overkill for what I am trying to achieve. It provides three different functions in our setup:&#xA;&#xA;Backup firewall/gateway&#xA;Creates another smaller LAN composed of BMCs for systems that provide services. This LAN is also accessible from the main LAN. This is simple using masquerade rules.&#xA; &#xA;On Mikrotik:&#xA;chain=srcnat action=masquerade out-interface=backuplanbridge log=yes log-prefix=&#34;BackupLANBridge  &#34;&#xA;Note that, for this to work, one of the interfaces of backup gateway&#39;s bridged network should be a dhcp client on the main LAN. &#xA;&#xA;The backup firewall is connected to the internet via the LM1200 (4).&#xA;&#xA;Scheduler&#xA;We also use the scheduler function of the Mikrotik box. It checks a cookie at regular intervals in case user has requested VPN to be on. While you have a always-on tunnel, I would like to minimize data usage on the data only SIM (the backup network).&#xA;&#xA;A simple script to check a variable on remote web server(RouterOS):&#xA;Check if user has enabled cookie&#xA;&#x9;:local result [/tool fetch url=&#34;path to remote web server/radar.txt&#34; mode=https as-value output=user ]&#xA;&#x9;:delay 5&#xA;        :local dat ($result-  &#34;data&#34;)&#xA;        :log info (&#34;Wireguard, Cookie is:$dat&#34;)&#xA;&#xA;check if user wants to run tunnel&#xA;       :if ( [: pick $dat 0 1]  != &#34;0&#34;) do={&#xA;            :local status [/interface get wireguard interface disabled];&#xA;             :if ($status=true) do={&#xA;                  :log info &#34;Trying to enable wireguard interface&#34;;&#xA;                  /interface/wireguard/enable wireguard interface;&#xA;                  :delay 5;&#xA;            } else={&#xA;                         :log info &#34;Wireguard interface already enabled&#34;;&#xA;            }&#xA;             # For debugging&#xA;            /ping count=5 10.8.0.1; &#xA;        } else={&#xA;                     :log info &#34;Trying to disable wireguard interface&#34;;&#xA;                     /interface/wireguard/disable wireguard interface;       &#xA;      }&#xA;To set this to run every 5 minutes:&#xA;add disabled=no interval=5m name=myscript&#xA; &#xA;Wireguard endpoint&#xA;This is the configured interface we have referred above in the script.&#xA;&#xA;LM1200 (4)&#xA;This is most convenient device I could find for my needs. It takes in a data sim and gives you a bridged interface. &#xA;&#xA;CG-NAT (5)&#xA;The cellular network.&#xA;&#xA;AWS S3 Cookie (6)&#xA;I use a publicly accessible S3 bucket for my cookie. All it needs is writing a 0 or 1 to a text file.&#xA;&#xA;Wireguard Server (7)&#xA;This is another critical piece of the setup. It serves as a bridge between the roaming endpoint and the local site. Besides the necessary firewall rules, some masquerade and postrouting rules are required:&#xA;&#xA;iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE&#xA;iptables -t mangle -A POSTROUTING -p tcp --tcp-flags SYN,RST SYN -o wg0 -j TCPMSS --set-mss 1280&#xA;The mangle is essential since we are accessing the tunnel indirectly via another system. Note that instead of setting a --set-mss value explicitly, you can just use --clamp-mss-to-pmtu that automatically sets an appropriate value.&#xA;&#xA;Roaming system configuration&#xA;Before we get to our script that makes life a bit easier, here&#39;s the typical workflow:&#xA;&#xA;User detects that the main network is down and primary VPN does not work.&#xA;User sets cookie in the S3 bucket to 1.&#xA;User waits for the remote backup system to initiate a wireguard tunnel.&#xA;Once done, user uses a ssh tunnel or a wireguard tunnel to the wireguard server.&#xA;&#xA;Here&#39;s a script that does something similar.&#xA;&#xA;#networking #diy&#xA;&#xA;a href=&#34;https://remark.as/p/th.oughts.org/backup-vpn-tunnel-using-a-mvno-data-plan&#34;Discuss.../a]]&gt;</description>
      <content:encoded><![CDATA[<h2 id="problem-statement">Problem Statement</h2>

<p>I wanted a <em>cheap</em> backup VPN tunnel to reinforce my main tunnel in case things go wrong. The backup tunnel is on standby and is utilized only when I need an alternate path to investigate why my main network is down or isn&#39;t functioning when I am physically away from my systems.</p>

<h2 id="challenges">Challenges</h2>

<p>CG-NAT has ruined cellular network based data plans. Cellular networks have kept their eccentric design choices throughout their evolution even though they have leveraged a lot from regular internet based data networks. CG-NAT is one of those <em>inconvenient design choices</em> that has stayed on. To summarize, a lot of the cheap MVNO data plans operate like a NATed LAN and incoming connections aren&#39;t really possible because you do not get gifted with a public IP.  Setting up a VPN tunnel using one of these data networks becomes a bendy road to success.</p>

<h2 id="design-choices">Design choices</h2>

<p>Using a cheap data plan is quite appealing because I would ideally want the cost to be as low as possible without sacrificing much on the <em>minimum reliability</em> that you would expect from a backup network.</p>

<p>Owing to the design restrictions mentioned above, you cannot simply <em>dial in</em> to your backup VPN endpoint. The connection has to be initiated in the opposite direction. This post details how I achieved an usable setup without sacrificing too much on cost or reliability.</p>

<h2 id="network-topology">Network topology</h2>

<p><img src="https://i.snap.as/Z5RAwYjC.jpg" alt="Network Topology" style="width:800px;height:600px;"></p>

<p>Click <a href="https://i.snap.as/Z5RAwYjC.jpg">here</a> for a somewhat legible image.</p>

<h3 id="main-lan-1"><em>Main LAN</em> (1)</h3>

<p>The main network gated by a OpenBSD based firewall and gateway.</p>

<h3 id="bmc-2"><em>BMC</em> (2)</h3>

<p>The base management controller to control the gateway.</p>

<h3 id="crs-326-3"><em>CRS 326</em> (3)</h3>

<p>This is the backup gateway using a Mikrotik CRS326. It&#39;s probably overkill for what I am trying to achieve. It provides three different functions in our setup:</p>

<h4 id="backup-firewall-gateway">Backup firewall/gateway</h4>

<p>Creates another smaller LAN composed of BMCs for systems that provide services. This LAN is also accessible from the main LAN. This is simple using masquerade rules.</p>

<p>On Mikrotik:</p>

<pre><code>chain=srcnat action=masquerade out-interface=&lt;backuplanbridge&gt; log=yes log-prefix=&#34;BackupLANBridge&gt;&#34;
</code></pre>

<p>Note that, for this to work, one of the interfaces of backup gateway&#39;s bridged network should be a dhcp client on the main LAN.</p>

<p>The backup firewall is connected to the internet via the LM1200 (4).</p>

<h4 id="scheduler">Scheduler</h4>

<p>We also use the scheduler function of the Mikrotik box. It checks a <em>cookie</em> at regular intervals in case user has requested VPN to be on. While you have a always-on tunnel, I would like to minimize data usage on the data only SIM (the backup network).</p>

<p>A simple script to check a variable on remote web server(RouterOS):</p>

<pre><code># Check if user has enabled cookie
	:local result [/tool fetch url=&#34;&lt;path to remote web server&gt;/radar.txt&#34; mode=https as-value output=user ]
	:delay 5
        :local dat ($result-&gt;&#34;data&#34;)
        :log info (&#34;Wireguard, Cookie is:$dat&#34;)

# check if user wants to run tunnel
       :if ( [: pick $dat 0 1]  != &#34;0&#34;) do={
            :local status [/interface get &lt;wireguard interface&gt; disabled];
             :if ($status=true) do={
                  :log info &#34;Trying to enable wireguard interface&#34;;
                  /interface/wireguard/enable &lt;wireguard interface&gt;;
                  :delay 5;
            } else={
                         :log info &#34;Wireguard interface already enabled&#34;;
            }
             # For debugging
            /ping count=5 10.8.0.1; 
        } else={
                     :log info &#34;Trying to disable wireguard interface&#34;;
                     /interface/wireguard/disable &lt;wireguard interface&gt;;       
      }
</code></pre>

<p>To set this to run every 5 minutes:</p>

<pre><code>add disabled=no interval=5m name=&lt;myscript&gt;
</code></pre>

<h4 id="wireguard-endpoint">Wireguard endpoint</h4>

<p>This is the configured interface we have referred above in the script.</p>

<h3 id="lm1200-4"><em>LM1200</em> (4)</h3>

<p>This is most convenient device I could find for my needs. It takes in a data sim and gives you a bridged interface.</p>

<h3 id="cg-nat-5"><em>CG-NAT</em> (5)</h3>

<p>The cellular network.</p>

<h3 id="aws-s3-cookie-6"><em>AWS S3 Cookie</em> (6)</h3>

<p>I use a publicly accessible S3 bucket for my cookie. All it needs is writing a 0 or 1 to a text file.</p>

<h3 id="wireguard-server-7"><em>Wireguard Server</em> (7)</h3>

<p>This is another critical piece of the setup. It serves as a bridge between the roaming endpoint and the local site. Besides the necessary firewall rules, some masquerade and postrouting rules are required:</p>

<pre><code>iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
iptables -t mangle -A POSTROUTING -p tcp --tcp-flags SYN,RST SYN -o wg0 -j TCPMSS --set-mss 1280
</code></pre>

<p>The <em>mangle</em> is essential since we are accessing the tunnel indirectly via another system. Note that instead of setting a —set-mss value explicitly, you can just use —clamp-mss-to-pmtu that automatically sets an appropriate value.</p>

<h2 id="roaming-system-configuration">Roaming system configuration</h2>

<p>Before we get to our script that makes life a bit easier, here&#39;s the typical workflow:</p>
<ol><li>User detects that the main network is down and primary VPN does not work.</li>
<li>User sets cookie in the S3 bucket to 1.</li>
<li>User waits for the remote backup system to initiate a wireguard tunnel.</li>
<li>Once done, user uses a ssh tunnel or a wireguard tunnel to the wireguard server.</li></ol>

<p>Here&#39;s a <a href="https://gist.github.com/whitebrandy/52ffa91abb2232ed0e541dbd386b1bd3">script</a> that does something similar.</p>

<p><a href="https://th.oughts.org/tag:networking" class="hashtag"><span>#</span><span class="p-category">networking</span></a> <a href="https://th.oughts.org/tag:diy" class="hashtag"><span>#</span><span class="p-category">diy</span></a></p>

<p><a href="https://remark.as/p/th.oughts.org/backup-vpn-tunnel-using-a-mvno-data-plan">Discuss...</a></p>
]]></content:encoded>
      <guid>https://th.oughts.org/backup-vpn-tunnel-using-a-mvno-data-plan</guid>
      <pubDate>Mon, 26 Dec 2022 06:50:59 +0000</pubDate>
    </item>
    <item>
      <title>Getting into tape backups (Part 2)</title>
      <link>https://th.oughts.org/getting-into-tape-backups-part-2?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[In Part 1, we had a quick introduction to tapes and tape drives and why you would choose one for your backups. In this part, we talk about actually using tapes to create a backup strategy using simple scripting.&#xA;&#xA;Of course,  there are plenty of readily available tools that might suit your needs. Writing your own does have a few advantages though: first, it keeps it simple, highly customized and second, when things go wrong, you would probably have a better idea of why the damn thing isn&#39;t working!&#xA;&#xA;A look at tape&#39;s workings&#xA;&#xA;If this is your first time dealing with tapes(as it was for me), there&#39;s a few prerequisites. &#xA;&#xA;Tools&#xA;Tape operations are carried out via the mt tool. Data is written with tar.&#xA;Both of these are probably already installed on your system.&#xA;&#xA;Writing data to tapes&#xA;Do you remember the good old days of cassette players ? Tapes are similar. A magnetic head reads and writes data from a magnetic ribbon spooled in an enclosure. With that in mind, there are a few operations that you would do frequently:&#xA;&#xA;  rewind: rewinds(of course!) the tape and points the tape head to the beginning of the magnetic ribbon.&#xA;Example command: mt -f /dev/nst0 rewind&#xA;  &#xA;  forward:  Move forward count files. Every time data is written, a marker is set at the end. Let&#39;s say, you write some data to the beginning of the tap