<?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 nyxrabb!tor on Medium]]></title>
        <description><![CDATA[Stories by nyxrabb!tor on Medium]]></description>
        <link>https://medium.com/@nyxfinder?source=rss-9110d9dc626b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mt-k9M3aF-JF8Rh-N9Qesw.jpeg</url>
            <title>Stories by nyxrabb!tor on Medium</title>
            <link>https://medium.com/@nyxfinder?source=rss-9110d9dc626b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 20:49:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nyxfinder/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[Setting Up EDB PostgreSQL 13 on Ubuntu: A Complete Operations Guide]]></title>
            <link>https://medium.com/@nyxfinder/setting-up-edb-postgresql-13-on-ubuntu-a-complete-operations-guide-f05464129ae6?source=rss-9110d9dc626b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f05464129ae6</guid>
            <dc:creator><![CDATA[nyxrabb!tor]]></dc:creator>
            <pubDate>Sun, 03 May 2026 03:16:08 GMT</pubDate>
            <atom:updated>2026-05-03T03:16:08.070Z</atom:updated>
            <content:encoded><![CDATA[<p><em>From repository setup to role management — everything you need to get production-ready.</em></p><h3>Why EDB PostgreSQL?</h3><p>EnterpriseDB (EDB) extends vanilla PostgreSQL with enterprise tooling — failover managers, backup agents, cross-database replication, and more. Whether you’re running EDB Advanced Server (edb-as) or plain community PostgreSQL via the EDB APT mirror, the setup process is similar but with a few important differences worth knowing.</p><p>This guide walks through the full lifecycle: install, configure, manage directories, control services, and provision roles and databases.</p><h3>1. Register the EDB APT Repository</h3><p>EDB distributes packages through a private APT repository. You’ll need a free account at <a href="https://www.enterprisedb.com/accounts/profile">enterprisedb.com</a> to get credentials.</p><pre># Add the EDB repository for your distro codename<br>sudo su -c &#39;echo &quot;deb [arch=amd64] https://apt.enterprisedb.com/$(lsb_release -cs)-edb/ $(lsb_release -cs) main&quot; \<br>  &gt; /etc/apt/sources.list.d/edb-$(lsb_release -cs).list&#39;<br># Store your credentials (replace with your own)<br>sudo su -c &#39;echo &quot;machine apt.enterprisedb.com login YOUR_USERNAME password YOUR_PASSWORD&quot; \<br>  &gt; /etc/apt/auth.conf.d/edb.conf&#39;<br># Enable HTTPS transport for APT<br>sudo apt-get -y install apt-transport-https<br># Import the EDB signing key<br>sudo wget -q -O - https://apt.enterprisedb.com/edb-deb.gpg.key | sudo apt-key add -<br># Refresh package metadata<br>sudo apt update</pre><p>&gt; <strong>Security note:</strong> The auth file at /etc/apt/auth.conf.d/edb.conf should be readable only by root (chmod 600). Never commit it to version control.</p><h3>2A. Install EDB Advanced Server 13 (Full Stack)</h3><p>For environments needing EDB’s enterprise tooling — Bart for backup, EFM for failover, XDB for replication:</p><pre>sudo apt-get -y install \<br>  edb-as13-server \<br>  barman \<br>  edb-bart \<br>  edb-jdbc \<br>  postgresql-13-pg-catcheck \<br>  edb-xdb \<br>  edb-livecompare \<br>  postgresql-13-pldebugger \<br>  postgresql-13</pre><p>Connect to the EDB Advanced Server instance:</p><pre>sudo su - enterprisedb<br>psql postgres</pre><h3>2B. Install EDB Advanced Server 13 + EFM Only</h3><p>Lighter setup for a high-availability pair using EDB Failover Manager:</p><pre>sudo apt-get -y install edb-as13-server edb-efm43</pre><h3>2C. Install Community PostgreSQL 13 via EDB Mirror</h3><p>If you only need vanilla PostgreSQL (no EDB extensions), you can still use the EDB APT mirror for a clean apt-managed install:</p><pre>sudo apt-get -y install postgresql-13-pldebugger postgresql-13</pre><p>Connect as the postgres superuser:</p><pre>sudo su - postgres<br>psql postgres</pre><h3>3. Prepare Directory Structure</h3><p>Both EDB and PostgreSQL need dedicated directories for WAL, logs, replication slots, and archive storage. Set these up with strict permissions before initializing:</p><p><strong>EDB Advanced Server paths:</strong></p><pre>mkdir -p /var/lib/edb-as/13/main/{pg_wal,pg_log,pg_replslot,archive}<br>chmod 700 /var/lib/edb-as/13/main/{pg_wal,pg_log,pg_replslot,archive}</pre><p><strong>Community PostgreSQL paths:</strong></p><pre>mkdir -p /var/lib/postgresql/13/main/{pg_wal,pg_log,pg_replslot,archive}<br>chmod 700 /var/lib/postgresql/13/main/{pg_wal,pg_log,pg_replslot,archive}</pre><p>chmod 700 ensures only the database process owner can read or write these directories. This is required by PostgreSQL&#39;s startup checks.</p><h3>4. Configure WAL Archiving</h3><p>Add this to postgresql.conf (or edb-as.conf) under archive_command:</p><p><strong>EDB:</strong></p><pre>archive_command = &#39;test ! -f /var/lib/edb-as/13/main/archive/%f &amp;&amp; cp -i %p /var/lib/edb-as/13/main/archive/%f&#39;</pre><p><strong>PostgreSQL:</strong></p><pre>archive_command = &#39;test ! -f /var/lib/postgresql/13/main/archive/%f &amp;&amp; cp -i %p /var/lib/postgresql/13/main/archive/%f&#39;</pre><p>The test ! -f guard prevents overwriting an existing archive file — an important safety check that prevents silent corruption of your WAL archive.</p><h3>5. Service Management</h3><p><strong>EDB Advanced Server (systemd):</strong></p><pre>systemctl start   edb-as.service<br>systemctl stop    edb-as.service<br>systemctl restart edb-as.service<br>systemctl status  edb-as.service</pre><p>Unit files live at /usr/lib/systemd/system/.</p><p><strong>Community PostgreSQL (init.d):</strong></p><pre>/etc/init.d/postgresql start<br>/etc/init.d/postgresql stop<br>/etc/init.d/postgresql restart<br>/etc/init.d/postgresql status</pre><h3>6. Provision Roles and Databases</h3><p>Once the cluster is running, connect as the superuser and provision your access model.</p><h3>Create Roles</h3><pre>CREATE ROLE usr          WITH PASSWORD &#39;your_strong_password&#39;;<br>CREATE ROLE readonly     WITH PASSWORD &#39;your_strong_password&#39;;<br>CREATE ROLE replicator   WITH PASSWORD &#39;your_replication_password&#39;;<br>CREATE ROLE schema_rep   WITH PASSWORD &#39;your_replication_password&#39;;<br>CREATE ROLE rabbit       WITH PASSWORD &#39;your_strong_password&#39;;</pre><h3>Enable Login</h3><pre>ALTER ROLE usr        LOGIN;<br>ALTER ROLE readonly   LOGIN;<br>ALTER ROLE replicator LOGIN;<br>ALTER ROLE schema_rep LOGIN;<br>ALTER ROLE rabbit     LOGIN;</pre><h3>Grant Replication Privileges</h3><pre>ALTER ROLE replicator REPLICATION;<br>ALTER ROLE schema_rep REPLICATION;</pre><h3>Create Databases</h3><pre>CREATE DATABASE dev;<br>CREATE DATABASE staging;</pre><h3>Configure Search Path</h3><pre>ALTER ROLE usr IN DATABASE dev<br>  SET search_path TO alpha, bravo, core, delta, echo, public;</pre><h3>Grant Permissions</h3><pre>-- Superuser access for admin roles<br>GRANT ALL ON DATABASE dev     TO enterprisedb;<br>GRANT ALL ON DATABASE staging TO enterprisedb;<br>GRANT ALL ON DATABASE dev     TO postgres;<br>GRANT ALL ON DATABASE staging TO postgres;<br>-- Application role access<br>GRANT ALL ON DATABASE dev     TO usr;<br>GRANT ALL ON DATABASE staging TO usr;<br>GRANT ALL ON DATABASE dev     TO schema_rep;<br>-- Read-only connect<br>GRANT CONNECT ON DATABASE dev TO readonly;<br>-- Public connect + temp<br>GRANT TEMPORARY, CONNECT ON DATABASE dev TO PUBLIC;</pre><h3>7. Uninstall</h3><h3>Remove EDB Advanced Server</h3><pre>sudo apt-get purge edb*<br>sudo apt-get --purge remove postgresql postgresql-doc postgresql-common<br># Verify nothing remains<br>dpkg -l | grep edb<br># Remove data and config directories<br>sudo rm -rf /var/lib/edb-as/<br>sudo rm -rf /var/log/edb-as/<br>sudo rm -rf /etc/edb-as/</pre><h3>Remove Community PostgreSQL</h3><pre>sudo apt-get purge postgresql*<br>sudo apt-get --purge remove postgresql postgresql-doc postgresql-common<br># Verify<br>dpkg -l | grep postgres<br># Remove data and config directories<br>sudo rm -rf /var/lib/postgresql/<br>sudo rm -rf /var/log/postgresql/<br>sudo rm -rf /etc/postgresql/</pre><p>&gt; <strong>Warning:</strong> rm -rf on data directories is irreversible. Always confirm you have a backup before running these commands in production.</p><h3>Summary</h3><p>TaskEDB Advanced ServerCommunity PostgreSQLData dir/var/lib/edb-as/13//var/lib/postgresql/13/Service userenterprisedbpostgresService managersystemctlinit.dConnect asenterprisedbpostgres</p><p>The key operational difference is the service user and data path. Everything else — SQL role management, WAL archiving logic, directory permissions — follows the same patterns regardless of which flavour you install.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f05464129ae6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[k8scheck v5.1: The Ultimate Kubernetes Troubleshooter That Saves You Hours]]></title>
            <link>https://medium.com/@nyxfinder/k8scheck-v5-1-the-ultimate-kubernetes-troubleshooter-that-saves-you-hours-3e5e52604d56?source=rss-9110d9dc626b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e5e52604d56</guid>
            <dc:creator><![CDATA[nyxrabb!tor]]></dc:creator>
            <pubDate>Sat, 07 Feb 2026 12:50:28 GMT</pubDate>
            <atom:updated>2026-02-07T12:50:28.590Z</atom:updated>
            <content:encoded><![CDATA[<p>A battle-tested bash script that gives you cluster health at a glance — no more digging through kubectl output</p><p>As a Linux admin managing production Kubernetes clusters, I was tired of the ritual: `kubectl get all -A`, squinting at STATUS columns, cross-referencing nodes, hunting events. What I needed was a doctor’s diagnosis, not raw lab results.</p><p>Enter k8scheck v5.1 — my 500+ line bash weapon that delivers:</p><pre>[+] CLUSTER HEALTH<br>✅ API Server reachable<br>✅ 12 Namespaces healthy<br>[+] NODE HEALTH  <br>✅ worker-1 Ready    ✅ worker-2 Ready<br>Summary: 3/3 Nodes Ready<br>[+] OVERALL CLUSTER STATUS<br>✅ HEALTHY - All good<br></pre><p>The Problem It Solves</p><p>“Is my cluster OK, or do I need to page someone RIGHT NOW?”</p><p>In high-stakes environments (e-commerce, fintech, healthcare), you can’t afford:</p><p>•	5-minute manual checks during incidents</p><p>•	Missing degraded states before they cascade</p><p>•	Context-switching between 10 kubectl commands</p><p>•	Alert fatigue from scattered metrics</p><p>k8scheck gives you one command, 30-second diagnosis.</p><p>Core Philosophy: Summary-First, Details-on-Demand</p><pre>$ ./k8scheck                    # 30-second cluster pulse<br>$ ./k8scheck --more ecommerce   # Deep dive into problematic namespace<br></pre><p>5 Production Use Cases Where k8scheck Shines</p><ol><li>PagerDuty Handoffs (The “What’s broken?” call)</li></ol><pre>18:43 📱 &quot;Hey team, cluster alert fired. Running k8scheck now...&quot;<br><br>[+] POD HEALTH<br>❌ 3 Problematic Pods<br>  - nginx-abc-123: CrashLoopBackOff<br>  - redis-cache: ImagePullBackOff<br><br>[+] OVERALL CLUSTER STATUS<br>⚠️ DEGRADED - Check warnings/events<br></pre><p>Saves: 10 minutes of “kubectl get pods | grep -v Running”</p><p>2. Pre-Deployment Safety Check</p><pre>$ ./k8scheck &amp;&amp; echo &quot;✅ Safe to deploy&quot;<br></pre><p>Run in CI/CD. Blocks deploys when:</p><p>•	Nodes NotReady</p><p>•	HelmReleases failing</p><p>•	Shipments blocked (custom CRD)</p><p>3. Namespace Deep Dives</p><pre>$ ./k8scheck --more payments<br>[+] RESOURCE ALLOCATION<br>Pods: 45 (Running: 42, Pending: 2, Failed: 1)<br><br>[+] UNHEALTHY PODS<br>❌ Pod: payment-api-7f8b9c<br>  Node: worker-2<br>  Containers:<br>    - api-container: ImagePullBackOff<br></pre><p>Replaces: 8 separate kubectl commands.</p><p>4. Flux/Helm GitOps Monitoring</p><pre>[+] HELMRELEASE HEALTH<br>✅ 18/20 HelmReleases Ready<br>❌ 2 Degraded/Failed HelmReleases<br>  - cert-manager (NS: cert-manager, Ready=False)<br></pre><p>Custom for GitOps: Tracks HelmReleases + your Shipments CRD.</p><p>5. Daily Standup Dashboard</p><pre>$ watch -n 30 ./k8scheck<br></pre><p>30-second refresh. One screen shows:</p><p>•	Cluster API status</p><p>•	Node readiness</p><p>•	Pod problems</p><p>•	Events (last 1h)</p><p>•	Custom workload health</p><p>How It Works (The Secret Sauce)</p><ol><li>Global Health Scoring</li></ol><pre>CLUSTER_CRITICAL=0  # Red flags (API down, nodes NotReady)<br>CLUSTER_DEGRADED=1  # Yellow flags (warnings, failed pods)<br></pre><p>2. Smart Aggregation</p><p>•	Nodes: JSONPath + conditions parsing</p><p>•	Pods: Pattern matching (CrashLoopBackOff, OOMKilled)</p><p>•	Events: Warning/Error only, top-5 reasons</p><p>•	Custom CRDs: Shipments, HelmReleases with blockers</p><p>3. Namespace Autopsy ( — more &lt;ns&gt;)</p><pre>[+] WORKLOAD &amp; SERVICE HEALTH<br>❌ Deployment: mysql (Desired: 3, Available: 2)<br>[+] PVC STATUS<br>❌ Unbound PVC: mysql-data (Pending)<br>[+] OVERALL STATUS: UNHEALTHY<br></pre><p>Why Bash? Why Not Go/Python?</p><p>1.	Zero deps — runs on any kube bastion</p><p>2.	Copy-paste debugging — no “pip install” drama</p><p>3.	kubectl native — pure JSONPath/jq</p><p>4.	GitOps friendly — curl | bash deployment</p><p>5.	Battle-tested — 6 months, 50+ clusters</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e5e52604d56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up Multi-Site pfSense with ProtonVPN Integration]]></title>
            <link>https://medium.com/@nyxfinder/setting-up-multi-site-pfsense-with-protonvpn-integration-527704698ff0?source=rss-9110d9dc626b------2</link>
            <guid isPermaLink="false">https://medium.com/p/527704698ff0</guid>
            <dc:creator><![CDATA[nyxrabb!tor]]></dc:creator>
            <pubDate>Sun, 29 Dec 2024 12:50:15 GMT</pubDate>
            <atom:updated>2024-12-29T12:50:15.095Z</atom:updated>
            <content:encoded><![CDATA[<p>pfSense is a versatile open-source firewall and router platform that can be adapted for a variety of complex network scenarios. In this guide, we’ll set up a multi-site network using pfSense and integrate it with ProtonVPN for enhanced security. This setup ensures that traffic between sites is securely routed, with all external traffic passing through ProtonVPN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*Qkd2ZkkEoEsgtYjLofs_hw.png" /><figcaption>Sample overview</figcaption></figure><h3>Network Overview</h3><p>For simplicity, we’ll use the following random IP addresses in our setup:</p><ul><li><strong>Headquarters (HQ)</strong>: 10.0.1.0/24</li><li><strong>Branch 1 (Floor 1)</strong>: 10.0.2.0/24</li><li><strong>Branch 2 (Floor 2)</strong>: 10.0.3.0/24</li><li><strong>VPN Subnet (ProtonVPN)</strong>: 172.16.0.0/24</li></ul><p>The configuration will include:</p><ul><li>VPN tunnels between ProtonVPN and all pfSense devices.</li><li>IPsec tunnels for inter-site communication.</li><li>A default gateway on each site routing internet-bound traffic through ProtonVPN.</li></ul><h3>Step 1: Installing and Configuring pfSense</h3><ol><li><strong>Install pfSense:</strong></li></ol><ul><li>Download the pfSense ISO from the <a href="https://www.pfsense.org/">official website</a>.</li><li>Install pfSense on your hardware or virtual machine following the installation wizard.</li></ul><p><strong>2. Basic Network Configuration:</strong></p><ul><li>Configure the LAN and WAN interfaces.</li><li>Assign the LAN IP addresses as follows:</li><li>HQ: 10.0.1.1</li><li>Branch 1: 10.0.2.1</li><li>Branch 2: 10.0.3.1</li></ul><p><strong>3. DNS and Gateway Settings:</strong></p><ul><li>Use public DNS servers like 1.1.1.1 or 8.8.8.8.</li><li>Verify the internet connection on each pfSense device.</li></ul><h3>Step 2: Configuring Inter-Site IPsec Tunnels</h3><p>To establish secure communication between sites:</p><ol><li><strong>HQ Configuration (Site A):</strong></li></ol><ul><li>Navigate to <strong>VPN &gt; IPsec</strong> and click <strong>Add Phase 1</strong>.</li><li>Set the following:</li><li><strong>Remote Gateway</strong>: 10.0.2.1 (Branch 1).</li><li><strong>Authentication Method</strong>: Pre-Shared Key.</li><li><strong>Pre-Shared Key</strong>: Use a strong, unique key.</li><li>Configure <strong>Phase 2</strong> for traffic between the subnets:</li><li><strong>Local Network</strong>: 10.0.1.0/24.</li><li><strong>Remote Network</strong>: 10.0.2.0/24.</li></ul><p><strong>2. Branch 1 Configuration (Site B):</strong></p><ul><li>Repeat the process, swapping the <strong>Remote Gateway</strong> to 10.0.1.1 (HQ).</li><li>Set up Phase 2 for 10.0.2.0/24 (local) to 10.0.1.0/24 (remote).</li></ul><p><strong>3. Repeat for Branch 2 (Floor 2):</strong></p><ul><li>Establish a similar tunnel between HQ and Branch 2.</li></ul><p><strong>4. Testing Inter-Site Connectivity:</strong></p><ul><li>Use ping to verify connectivity between subnets.</li></ul><h3>Step 3: Setting Up ProtonVPN Integration</h3><p>To route internet-bound traffic through ProtonVPN:</p><ol><li><strong>Obtain ProtonVPN Configuration:</strong></li></ol><ul><li>Log in to your ProtonVPN account and download the OpenVPN configuration files for your preferred server.</li></ul><p><strong>2. Upload OpenVPN Configuration:</strong></p><ul><li>Navigate to <strong>VPN &gt; OpenVPN &gt; Clients</strong>.</li><li>Click <strong>Add</strong> and configure the following:</li><li><strong>Server Address/Port</strong>: As specified in the configuration file.</li><li><strong>Authentication</strong>: Use your ProtonVPN credentials.</li><li>Upload the downloaded .ovpn file.</li></ul><p><strong>3. Create an Interface for ProtonVPN:</strong></p><ul><li>Navigate to <strong>Interfaces &gt; Assignments</strong>.</li><li>Assign the ProtonVPN client to a new interface (e.g., OPT1).</li><li>Enable the interface and rename it (e.g., VPN_WAN).</li></ul><p><strong>4. Routing Internet Traffic through ProtonVPN:</strong></p><ul><li>Go to <strong>System &gt; Routing &gt; Gateways</strong>.</li><li>Set the default gateway to the ProtonVPN interface.</li></ul><p><strong>5. Firewall Rules:</strong></p><ul><li>Navigate to <strong>Firewall &gt; Rules</strong>.</li><li>On the LAN interface, add a rule to route all traffic to the VPN_WAN gateway.</li></ul><h3>Step 4: Testing and Verifying</h3><ol><li><strong>VPN Status:</strong></li></ol><ul><li>Navigate to <strong>Status &gt; OpenVPN</strong> and ensure the ProtonVPN tunnel is established.</li></ul><p><strong>2. Traffic Routing:</strong></p><ul><li>Use an IP-checking service (e.g., <a href="https://ipinfo.io/">ipinfo.io</a>) to confirm your public IP is from ProtonVPN.</li></ul><p><strong>3. Inter-Site Connectivity:</strong></p><ul><li>Verify that inter-site traffic routes through the IPsec tunnels and not ProtonVPN.</li></ul><h3>Conclusion</h3><p>This multi-site setup with pfSense and ProtonVPN enhances security by encrypting both inter-site and internet traffic. By carefully configuring each site and routing policies, you ensure that sensitive data remains protected and internet-bound traffic is anonymized through ProtonVPN.</p><p><a href="https://protonvpn.com/support/pfsense-2-6-x-vpn-setup?srsltid=AfmBOoqXnUa7s4N66M3v5TzfF2ULbLo0iYSJffxUocjBzlRaUV6yxqm5">How to set up Proton VPN on pfSense 2.6.x | Proton VPN</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FrssrfcY5Qko%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrssrfcY5Qko&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FrssrfcY5Qko%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/171145c3a2eb37388e5ec3766c337c32/href">https://medium.com/media/171145c3a2eb37388e5ec3766c337c32/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=527704698ff0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up a Kafka Cluster Using Docker Compose]]></title>
            <link>https://medium.com/@nyxfinder/setting-up-a-kafka-cluster-using-docker-compose-37f2d6d226c9?source=rss-9110d9dc626b------2</link>
            <guid isPermaLink="false">https://medium.com/p/37f2d6d226c9</guid>
            <dc:creator><![CDATA[nyxrabb!tor]]></dc:creator>
            <pubDate>Mon, 02 Dec 2024 03:06:07 GMT</pubDate>
            <atom:updated>2024-12-02T03:06:07.126Z</atom:updated>
            <content:encoded><![CDATA[<p>Apache Kafka is a powerful distributed messaging system used for building real-time data pipelines and streaming applications. In this blog, we’ll walk through setting up a simple Kafka cluster with Docker Compose, which consists of two Kafka nodes and a Zookeeper instance.</p><h3>Prerequisites</h3><p>Before we get started, ensure you have the following installed on your system:</p><ol><li><strong>Docker</strong>: To containerize and manage our services.</li><li><strong>Docker Compose</strong>: To define and run multi-container Docker applications.</li></ol><h3>Kafka Cluster Architecture</h3><p>Our Kafka cluster will include:</p><ol><li><strong>Zookeeper</strong>: Manages the coordination between Kafka brokers.</li><li><strong>Kafka Node 1</strong>: The primary Kafka broker.</li><li><strong>Kafka Node 2</strong>: An additional Kafka broker for clustering and replication.</li></ol><h3>Docker Compose Configuration</h3><p>Here’s the docker-compose.yml configuration for our Kafka cluster:</p><h3>Kafka Node 1 with Zookeeper</h3><pre>version: &#39;3&#39;<br>services:<br>  zookeeper:<br>    image: wurstmeister/zookeeper:3.4.6<br>    container_name: zookeeper<br>    hostname: zookeeper<br>    ports:<br>      - &quot;2182:2181&quot;<br><br>  kafka1:<br>    image: lensesio/fast-data-dev:2.6.2-L0<br>    container_name: kafka-node-1<br>    environment:<br>      - KAFKA_BROKER_ID=0<br>      - KAFKA_LISTENERS=PLAINTEXT://kafka-node-1:9092<br>      - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://10.1.130.7:9062<br>      - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT<br>      - KAFKA_INTER_BROKER_LISTENER_NAME=PLAINTEXT<br>      - KAFKA_ZOOKEEPER_CONNECT=10.1.130.7:2182<br>      - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1<br>      - USER=admin<br>      - PASSWORD=kafka<br>      - TZ=Asia/Kuala_Lumpur<br>      - SAMPLEDATA=0<br>      - RUNTESTS=0<br>      - TOPIC_DELETE=1<br>      - BROWSECONFIGS=1<br>      - SUPERVISORWEB=1<br>    volumes:<br>      - config:/run/broker<br>    ports:<br>      - &quot;9062:9092&quot;<br>      - &quot;10052:3030&quot;<br><br>volumes:<br>  config:</pre><h3>Kafka Node 2</h3><pre>version: &#39;3&#39;<br>services:<br>  kafka2:<br>    image: lensesio/fast-data-dev:2.6.2-L0<br>    container_name: kafka-node-2<br>    environment:<br>      - KAFKA_BROKER_ID=1<br>      - KAFKA_LISTENERS=PLAINTEXT://kafka-node-2:9092<br>      - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://10.1.128.28:9062<br>      - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT<br>      - KAFKA_INTER_BROKER_LISTENER_NAME=PLAINTEXT<br>      - KAFKA_ZOOKEEPER_CONNECT=10.1.130.7:2182<br>      - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1<br>      - USER=admin<br>      - PASSWORD=kafka<br>      - TZ=Asia/Kuala_Lumpur<br>      - SAMPLEDATA=0<br>      - RUNTESTS=0<br>      - TOPIC_DELETE=1<br>      - BROWSECONFIGS=1<br>      - SUPERVISORWEB=1<br>    volumes:<br>      - config:/run/broker<br>    ports:<br>      - &quot;9062:9092&quot;<br>      - &quot;10052:3030&quot;<br><br>volumes:<br>  config:</pre><h3>Setting Up the Cluster</h3><h3>Step 1: Clone or Create Your Project</h3><p>Place the above docker-compose.yml configurations in your project directory.</p><h3>Step 2: Start the Services</h3><p>Run the following command to spin up your Kafka cluster:</p><pre>docker-compose up -d</pre><p>This will start Zookeeper, Kafka Node 1, and Kafka Node 2.</p><h3>Step 3: Verify the Setup</h3><p>To confirm that all services are running:</p><pre>docker ps</pre><p>You should see three containers: <strong>zookeeper</strong>, <strong>kafka-node-1</strong>, and <strong>kafka-node-2</strong>.</p><h3>Testing the Cluster</h3><ol><li><strong>Create a Topic</strong>: Use Kafka’s command-line tools or a GUI like Kafka Manager to create a topic. For example:</li></ol><pre>kafka-topics.sh --create --topic test-topic --bootstrap-server 10.1.130.7:9062</pre><p><strong>2. Produce Messages</strong>: Produce messages to the topic using a producer script.</p><p><strong>3. Consume Messages</strong>: Consume messages from the topic using a consumer script.</p><h3>Key Configuration Highlights</h3><ul><li><strong>Zookeeper Coordination</strong>: Essential for Kafka’s broker management.</li><li><strong>Multi-Broker Setup</strong>: Enables scalability and fault tolerance.</li><li><strong>Custom Environment Variables</strong>: Configured for secure and regional settings (TZ, USER, etc.).</li></ul><h3>Conclusion</h3><p>By following this guide, you’ve successfully set up a Kafka cluster using Docker Compose. This setup can be expanded further by adding more brokers, implementing SSL, or integrating with external monitoring tools. Kafka is an incredibly robust platform for streaming applications, and a containerized approach makes it even more flexible and portable.</p><p>Happy streaming! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37f2d6d226c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up Tor with obfs4proxy for Enhanced Privacy and Censorship Bypass]]></title>
            <link>https://medium.com/@nyxfinder/setting-up-tor-with-obfs4proxy-for-enhanced-privacy-and-censorship-bypass-1d98f3c3f935?source=rss-9110d9dc626b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d98f3c3f935</guid>
            <dc:creator><![CDATA[nyxrabb!tor]]></dc:creator>
            <pubDate>Wed, 27 Nov 2024 03:44:04 GMT</pubDate>
            <atom:updated>2024-11-27T09:16:03.104Z</atom:updated>
            <content:encoded><![CDATA[<h3>Setting Up Tor with obfs4proxy for Enhanced Privacy and Censorship Bypass</h3><p>Tor (The Onion Router) is a powerful tool for maintaining online privacy and circumventing censorship. By encrypting your traffic and routing it through a series of volunteer-operated servers, Tor ensures anonymity. When paired with pluggable transports like obfs4proxy, it becomes even more robust, enabling users to bypass censorship in regions where direct Tor connections are blocked.</p><p>This article outlines how to set up Tor, configure obfs4proxy, and test the setup on a Linux system.</p><h4>Prerequisites</h4><p>Before you start, ensure you have:</p><ol><li>A Linux-based operating system with apt package management (e.g., Ubuntu or Debian).</li><li>Root or sudo access.</li></ol><h4>Step 1: Installing Tor and obfs4proxy</h4><p>First, install Tor and the obfs4proxy pluggable transport:</p><pre>sudo apt update<br>sudo apt install -y tor obfs4proxy</pre><ul><li><strong>Tor:</strong> Enables anonymous communication.</li><li><strong>obfs4proxy:</strong> A pluggable transport that disguises Tor traffic to evade censorship.</li></ul><h4>Step 2: Download and Extract Tor Browser</h4><p>The Tor Browser is a user-friendly way to access the Tor network. Download and extract the latest version:</p><pre>wget https://www.torproject.org/dist/torbrowser/13.0/tor-browser-linux-x86_64-13.0.tar.xz<br>tar -xvf tor-browser-linux-x86_64-13.0.tar.xz<br>sudo mv tor-browser-linux-x86_64-13.0 /opt/</pre><p>This moves the browser to /opt/ for centralized access.</p><h4>Step 3: Enable torsocks for Network Traffic Redirection</h4><p>torsocks is a utility that forces application traffic through the Tor network. Enable it using:</p><pre>source torsocks on</pre><p>With torsocks active, all commands executed in the terminal will route through Tor.</p><h4>Step 4: Verify Tor Connection</h4><p>To confirm your traffic is routed through Tor, check your public IP address. First, verify using the wget command:</p><pre>wget -qO - https://api.ipify.org ; echo</pre><p>This will display your IP address. If Tor is working, the displayed IP should differ from your regular one.</p><h4>Step 5: Launch Tor Browser</h4><p>Navigate to the Tor Browser’s directory and start it:</p><pre>cd /opt/tor-browser/Browser<br>./start-tor-browser</pre><p>Follow the on-screen instructions to connect to the Tor network. If you’re in a heavily censored region, you may need to configure bridges. The browser’s setup wizard can assist you in obtaining and setting up obfs4 bridges.</p><h4>Step 6: Disable torsocks</h4><p>When you’re done using Tor for command-line operations, disable torsocks to return to direct network connections:</p><pre>source torsocks off</pre><h4>Step 7: Confirm Network Changes</h4><p>To verify that your direct connection is restored, use the curl command:</p><pre>curl ifconfig.me</pre><p>This will display your public IP, confirming the network has switched back to its normal route.</p><h3>Conclusion</h3><p>Setting up Tor with obfs4proxy ensures your online activity remains private and accessible, even in restrictive environments. By following these steps, you can enhance your online security, bypass censorship, and explore the internet with greater freedom.</p><p>For further assistance, visit the <a href="https://www.torproject.org/">Tor Project website</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d98f3c3f935" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elasticsearch Clustering with Docker Compose: A Comprehensive Guide]]></title>
            <link>https://medium.com/@nyxfinder/elasticsearch-clustering-with-docker-compose-a-comprehensive-guide-e61b00e17a92?source=rss-9110d9dc626b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e61b00e17a92</guid>
            <dc:creator><![CDATA[nyxrabb!tor]]></dc:creator>
            <pubDate>Wed, 27 Nov 2024 03:30:30 GMT</pubDate>
            <atom:updated>2024-12-02T02:51:48.979Z</atom:updated>
            <content:encoded><![CDATA[<p>Elasticsearch, a powerful open-source distributed search and analytics engine, is designed to handle large amounts of data in a scalable manner. To fully utilize its capabilities, deploying Elasticsearch as a cluster is often necessary, especially for production environments. This article will guide you through setting up an Elasticsearch cluster using Docker Compose, simplifying the deployment process and ensuring easy scalability.</p><h3>What is Elasticsearch Clustering?</h3><p>An Elasticsearch cluster consists of multiple nodes working together to distribute data and handle search and indexing operations efficiently. Each node serves a unique role within the cluster:</p><ol><li><strong>Master Nodes</strong>: Manage cluster-wide operations such as creating/deleting indices and tracking node availability.</li><li><strong>Data Nodes</strong>: Store data and handle search, indexing, and aggregation operations.</li><li><strong>Client/Coordinator Nodes</strong>: Act as load balancers to distribute requests among other nodes without storing data themselves.</li></ol><p>A well-configured Elasticsearch cluster ensures high availability, fault tolerance, and scalability.</p><h3>Why Use Docker Compose?</h3><p>Docker Compose allows you to define and run multi-container Docker applications. By using a docker-compose.yml file, you can easily configure multiple nodes for an Elasticsearch cluster, simplifying the deployment and management process.</p><h3>Prerequisites</h3><ol><li><strong>Docker</strong>: Ensure Docker is installed on your system.</li><li><strong>Docker Compose</strong>: Install Docker Compose for managing multi-container applications.</li><li><strong>Sufficient Resources</strong>: Elasticsearch nodes can be resource-intensive. Allocate adequate CPU and memory to your Docker environment.</li></ol><h3>Docker Compose File for Elasticsearch Cluster</h3><p>Below is an example docker-compose.yml file for setting up a basic Elasticsearch cluster with three nodes: one master node and two data nodes.</p><pre>version: &#39;3.7&#39;<br>services:<br>  es-node2:<br>    image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3<br>    container_name: es-node2<br>    environment:<br>      - ELASTIC_USERNAME=elastic<br>      - ELASTIC_PASSWORD=elastic<br>      - xpack.security.enabled=true<br>      - node.name=node2<br>      - network.bind_host=0.0.0.0<br>      - cluster.name=es-cluster<br>      - discovery.seed_hosts=10.1.128.28:9375<br>      - network.publish_host=10.1.130.7<br>      - http.publish_host=10.1.130.7<br>      - http.publish_port=9275<br>      - transport.publish_host=10.1.130.7<br>      - transport.publish_port=9375<br>      - cluster.initial_master_nodes=10.1.128.28:9375,10.1.130.7:9375<br>      - cluster.routing.allocation.enable=all<br>      - bootstrap.memory_lock=true<br>      - &quot;ES_JAVA_OPTS=-Xms4g -Xmx4g&quot;<br>    ulimits:<br>      memlock:<br>        soft: -1<br>        hard: -1<br>    volumes:<br>      - es-node2-data:/usr/share/elasticsearch/data<br>    ports:<br>      - &quot;9275:9200&quot;<br>      - &quot;9375:9300&quot;<br><br>volumes:<br>  es-node2-data:<br>    driver: local<br><br><br><br>version: &#39;3.7&#39;<br>services:<br>  es-node1:<br>    image: docker.elastic.co/elasticsearch/elasticsearch:7.17.3<br>    container_name: es-node1<br>    environment:<br>      - ELASTIC_USERNAME=elastic<br>      - ELASTIC_PASSWORD=elastic<br>      - xpack.security.enabled=true<br>      - node.name=node1<br>      - network.bind_host=0.0.0.0<br>      - cluster.name=es-cluster<br>      - discovery.seed_hosts=10.1.130.7:9375<br>      - network.publish_host=10.1.128.28<br>      - http.publish_host=10.1.128.28<br>      - http.publish_port=9275<br>      - transport.publish_host=10.1.128.28<br>      - transport.publish_port=9375<br>      - cluster.initial_master_nodes=10.1.130.7:9375,10.1.128.28:9375<br>      - cluster.routing.allocation.enable=all<br>      - bootstrap.memory_lock=true<br>      - &quot;ES_JAVA_OPTS=-Xms4g -Xmx4g&quot;<br>    ulimits:<br>      memlock:<br>        soft: -1<br>        hard: -1<br>    volumes:<br>      - es-node1-data:/usr/share/elasticsearch/data<br>    ports:<br>      - &quot;9275:9200&quot;<br>      - &quot;9375:9300&quot;<br><br>  kibana-cluster:<br>    container_name: kibana-cluster<br>    image: docker.elastic.co/kibana/kibana:7.17.3<br>    environment:<br>      - ELASTICSEARCH_HOSTS=http://10.1.128.28:9275<br>      - ELASTICSEARCH_HOSTS=http://10.1.130.7:9275<br>      - ELASTICSEARCH_USERNAME=elastic<br>      - ELASTICSEARCH_PASSWORD=elastic<br>    ports:<br>      - &quot;5675:5601&quot;<br>    volumes:<br>      - kibana-config:/usr/share/kibana<br><br>volumes:<br>  es-node1-data:<br>    driver: local<br>  kibana-config:<br>    driver: local</pre><h3>Overview of the Configuration</h3><ol><li><strong>Elasticsearch Nodes (</strong><strong>es-1 and </strong><strong>es-2)</strong>:</li></ol><ul><li>Both nodes are part of the same cluster (es-docker-cluster).</li><li>Each node is configured with unique node.name and network settings for communication.</li><li>Security is enabled (xpack.security.enabled=true), and communication between nodes is secured (xpack.security.transport.ssl.enabled=true).</li></ul><p><strong>2. Cluster Discovery</strong>:</p><ul><li>Each node specifies discovery.seed_hosts to ensure proper cluster formation.</li><li>cluster.initial_master_nodes lists the addresses of both nodes to bootstrap the cluster.</li></ul><p><strong>3. Kibana Integration</strong>:</p><ul><li>Kibana connects to Elasticsearch using the credentials provided.</li><li>The Kibana container maps port 5601 to 5677 for external access.</li></ul><h3>Key Adjustments and Recommendations</h3><h4>1. Environment Variables</h4><ul><li>Ensure sensitive credentials like ELASTIC_PASSWORD are securely managed (e.g., using Docker secrets or environment variable files).</li></ul><h4>2. Resource Allocation</h4><ul><li>Each Elasticsearch node has 4GB memory allocated via ES_JAVA_OPTS. Ensure your host system has sufficient memory to avoid swapping.</li><li>Both Elasticsearch and Kibana might require more memory for heavy workloads. Monitor and adjust as needed.</li></ul><h4>3. Network Configuration</h4><ul><li>The network.publish_host and transport.publish_host settings ensure that nodes advertise the correct IP addresses for inter-node communication. Verify that the provided IPs are reachable.</li></ul><h4>4. Volumes for Persistence</h4><ul><li>Elasticsearch data is stored in named volumes (es-1-index, es-2-index), which ensures data persistence across container restarts.</li><li>Kibana’s configuration is stored in a separate volume (kibana-es).</li></ul><h4>5. Cluster Bootstrapping</h4><ul><li>cluster.initial_master_nodes should only be defined during the initial cluster formation. After the cluster is up, this setting can be removed to avoid configuration conflicts.</li></ul><h4>6. Security and TLS</h4><ul><li>While xpack.security.transport.ssl.enabled=true is configured, full TLS implementation (for HTTPS endpoints and node-to-node communication) requires certificates. Use Elasticsearch’s bin/elasticsearch-certutil to generate and manage these.</li></ul><h4>7. Kibana</h4><ul><li>Update elasticsearch.password to match the ELASTIC_PASSWORD used in Elasticsearch.</li><li>Kibana’s default configurations are minimal. For production, consider adding kibana.yml to configure logging, SSL, and other advanced settings.</li></ul><h3>Deployment Instructions</h3><ol><li><strong>Ensure Docker and Docker Compose Are Installed</strong><br>Verify Docker and Docker Compose are correctly set up on your system.</li><li><strong>Deploy Elasticsearch and Kibana</strong><br>Use the following commands to bring up the stack:</li></ol><p>docker-compose up -d</p><p><strong>3. Verify Cluster Health</strong><br>Access the Elasticsearch API to check the cluster’s health:</p><p>curl -u elastic:uU3xFpS425k2 “http://&lt;node-ip&gt;:9277/_cluster/health?pretty”</p><p><strong>4. Access Kibana</strong><br>Open Kibana in your browser:</p><p>http://&lt;host-ip&gt;:5677</p><p>5. Monitor Logs</p><p>docker logs es-1</p><p>docker logs kibana-es-cluster</p><h3>Final Thoughts</h3><p>This Docker Compose setup provides a robust starting point for an Elasticsearch cluster with integrated Kibana. As you scale, consider adding more data nodes, enabling TLS for all communications, and setting up monitoring tools like Elastic APM or Prometheus. Regular backups and performance tuning are essential for maintaining the health of your Elasticsearch deployment in production.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e61b00e17a92" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Regex Learn]]></title>
            <link>https://medium.com/@nyxfinder/regex-learn-1d3598c5328e?source=rss-9110d9dc626b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d3598c5328e</guid>
            <category><![CDATA[pcre]]></category>
            <category><![CDATA[syslog]]></category>
            <category><![CDATA[regex]]></category>
            <dc:creator><![CDATA[nyxrabb!tor]]></dc:creator>
            <pubDate>Mon, 16 Sep 2024 05:16:46 GMT</pubDate>
            <atom:updated>2024-09-16T05:16:46.527Z</atom:updated>
            <content:encoded><![CDATA[<p>Simple regex with simple log</p><p>[+] regex pcre2<br> — — — — — — — -</p><p>### 1. Log<br>Sep 16 11:42:52 d45a-s0 ntpd[304]: receive: Unexpected origin timestamp 0xea9227bd.6ba13aa4 does not match aorg 0000000000.00000000 from server@185.125.190.56 xmt 0xea9227bc.43056563</p><p>&lt;timestamp&gt;<br>[A-Za-z]{3}\s\d{2}\s\d{2}:\d{2}:\d{2}</p><p>&lt;hostname&gt;<br>[a-z]\d{2}[a-z]-[a-z]\d</p><p>*** custom hostname(by group regex)<br>(?&lt;hostname&gt;[a-z]\d{2}[a-z]-[a-z]\d)</p><p>&lt;protocol and error&gt;<br>[a-z]+\[\d+]</p><p>&lt;message&gt;<br>:\s.*$</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d3598c5328e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MultiCloud AWS & GCP]]></title>
            <link>https://medium.com/@nyxfinder/multicloud-aws-gcp-835aba0e564b?source=rss-9110d9dc626b------2</link>
            <guid isPermaLink="false">https://medium.com/p/835aba0e564b</guid>
            <category><![CDATA[multi-cloud]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[nyxrabb!tor]]></dc:creator>
            <pubDate>Mon, 16 Sep 2024 05:13:23 GMT</pubDate>
            <atom:updated>2024-09-16T05:13:23.916Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*uS6VJKXgAIEKz7-o.png" /></figure><p>In this article, you will get a brief idea about how to create highly available VPN connections between Google Cloud and Amazon Web Services (AWS) for direct communication between VPC networks across the two cloud platforms.</p><p>VPN creates a secure connection between your on premise or any cloud resources using IP Security (IPSec) tunnels.</p><p>Here, we are going to deploy 2 VPC’s on AWS and GCP and connect the private instances in both the clouds which will be having private ip using secured managed high available VPN.</p><p>As you can see in the above diagram, deploying two tunnels is not sufficient, because HA on AWS is done through the redundancy of the Customer Gateway, and each GW provides two tunnels. So, to accomplish HA we need to deploy 4 tunnels to connect AWS and GCP.</p><h3>Step by Step process to create HA VPN Connection between GCP and AWS</h3><ol><li><strong>Create a VPC and Subnet in GCP</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*0Idp1gX0TB0WhYuW.png" /></figure><p>Created a VPC named “gcp-vpn-vpc” and add a subnet to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*LGcFMIsTUSCMjQu5.png" /></figure><p>Add a subnet and specify any region (us-east1) where you want your compute engine to launch. Add an ip address range as per your convenience (“10.0.0.0/24”).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*Zk93DshS9NkJGDYg.png" /></figure><p>Select Dynamic Routing mode as “Global” which helps to dynamically detect routes from all regions if you are using VPN or Cloud Router and then create VPC .</p><p>See, now a VPC is created in GCP Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*_Zzf0SiJ80vU_dco.png" /></figure><p><strong>2. Create Firewall rules for the VPC created in GCP</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/0*CMVw2S91UQO9KQgl.png" /></figure><p>Add icmp rule firewall to “gcp-vpn-vpc” VPC where add source as “0.0.0.0/0”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*FKTkxmv3SNE-ryxv.png" /></figure><p>Add another firewall rule to allow ssh access using Cloud IAP Tunnel in the source block.</p><p><strong>3. Create a VPC , Subnet and Internet Gateway and update your default route table in AWS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*4c7SaWcv7KcIheRf.png" /></figure><p>Create a VPC named as “aws-vpn-vpc” in AWS Cloud in us-east-1 region and add the cidr block as per your convenience and click create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*JYFNoZsHaOiTkPhZ.png" /></figure><p>Then create a subnet (aws-subnet-1) in us-east-1 region and add the cidr block range to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*mEgxijBWvqVnY6zT.png" /></figure><p>You will see that a default route table automatically gets created . Now you need to do some modifications to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*qKGSlyiZk82yxlm9.png" /></figure><p>Attach your AWS subnet (aws-subnet-1) to route table in explicit subnet association field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*_fmeEi6k_sT7IYSr.png" /></figure><p>Select the Subnet and click Save association.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*g7n_yeOq1HEa6sSn.png" /></figure><p>Create an Internet gateway named as “aws-vpn-igw” and attach it to the new VPC which is created . It will allows communication between your VPC and the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*Mx8pYKI35zfFEKE_.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*qNNeVzJLawkpOV7i.png" /></figure><p>Then you need to edit your route table routes . Add another route which tells if any traffic comes from any ip apart from 10.1.0.0/16 will go to Internet Gateway .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*tcMGQZ8VNFzxdzfq.png" /></figure><p>4. <strong>Create a Cloud Router in GCP Cloud.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*QRkjt2WElH9H498c.png" /></figure><p>Create a cloud router named as “gcp-router-vpn” and attach it to the newly created VPN and assign a Google ASN number , it can be any private ASN in the range 64512–65534 or 4200000000–4294967294 that you aren’t already using as a peer ASN in the same region and network. Remember this Google ASN as same ASN number will be added in customer gateway in AWS Cloud too. This cloud router will provide dynamic routing using BGP for your VPC networks.</p><p>5. <strong>Create a HA VPN in GCP Cloud.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*yLx4EiXKkCAAsJyz.png" /></figure><p>Choose High-availability (HA) VPN which supports dynamic routing and high availability and supports IPv4 and IPv6 traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*WaWp5t-VdxLjeGCr.png" /></figure><p>Create Cloud HA VPN Gateway — add VPN Gateway name “gcp-vpn-gateway-demo” , add your network and region as “us-east-1” where our new VPC is created and then select create and continue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*uQNO5o3wAe4_wXxf.png" /></figure><p>Now you can see that 2 public ip’s are automatically allocated for each of our gateway interfaces.</p><p><strong>6. Create 2 Customer Gateway and Virtual Private Gateway in AWS Cloud</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*ZUVKmLUFiK8PUka7.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*58a_33U2OVpnWpMp.png" /></figure><p>Create two customer gateways and add the same ASN number “65420” which you have assigned during VPN gateway creation in GCP. Add the same IP address which you got in GCP Console — those public ip’s which are automatically allocated for each of our gateway interfaces. The <em>customer gateway</em> that you created in AWS represents the customer gateway device in your GCP network. When you create a customer gateway, you provide information about your device to AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*Q3vZ3KKaYjHerZVr.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*Yf9FbgKs68kKVLU7.png" /></figure><p>Then create a VPG named as “aws-vpg-demo” and add a custom ASN no (64512) in the range 64512–65534 or 4200000000–4294967294 and attach this to AWS VPC we created .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*jdBn5C5UbCJyjEAB.png" /></figure><p>Virtual private gateway is the VPN concentrator on the Amazon side of the Site-to-Site VPN connection. You create a virtual private gateway and attach it to the VPC from which you want to create the Site-to-Site VPN connection.</p><p>Then go to the default route table and enable the Propagation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*bqfLg86yjKmCfw-u.png" /></figure><p><strong>7.</strong> <strong>Create VPN Connection in AWS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*VzdstWbS4nC4SFrc.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*mCnSQYHX_dxJPeEa.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*0cDWBMY19W92qtBR.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*a-ZdS0sryL60oAsi.png" /></figure><p>Go to Site-to-Site VPN Connection and create 2 connections and add</p><p>Virtual private gateway which we created earlier. Then attach the customer gateways we created to create a connection between GCP and AWS and select dynamic routing. Select the same options for the tunnel which are described in the images.</p><p>Each VPN connection includes two VPN tunnels which you can simultaneously use for high availability. Site-to-Site VPN supports Internet Protocol security (IPsec) VPN connections.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*AwYhmjwyYkMAP98j.png" /></figure><p>Now, download the configuration for each of the VPN Connections you created.</p><p><strong>8.</strong> <strong>Add VPN Tunnels in your Google Cloud</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*QpGNx81JrnJjaO3D.png" /></figure><p>Create 4 tunnels to connect to AWS and select “On-prem or Non Google Cloud option” and a peer gateway and all 4 interface IP address which you will get from the configuration file which you downloaded from AWS Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*a9sEQakGoNFjnTAI.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*lESqzxeqRH6Mu4VO.png" /></figure><p>If you open one configuration then go to Tunnel Interface Configuration and attach Virtual Private Gateway IP’s into the GCP Interface addresses. In total there are 4 tunnels , you need to all 4 from the 2 configuration file you downloaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*kFWqrQxCOMS_EYBR.png" /></figure><p>Then configure each VPN tunnel and add IKE-pre-shared-key for each of the 4 tunnels which you will get in the downloaded configuration file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*ywmt__zaXCDcDHho.png" /></figure><p>See, in this configuration file copy the Pre-Shared Key and add it in GCP Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*_KFfKHEQ0W3Nij34.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*48E3enORRe_Pakct.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*GuYrh-8n6lNG4_zM.png" /></figure><p>After you add the key for each of the 4 tunnels and selected the cloud router we created earlier  Click save and continue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*FdywiGxXyjZXkixx.png" /></figure><p>Now we will be configuring BGP sessions for each of the tunnels . Click configure BGP Session</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*REjRb549vqr80BvV.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*Ief-nPHOQPiOJ3R0.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*0Wkc8lwPkiBgrPfv.png" /></figure><p>Add the same ASN number which you have added while creating Virtual Private Gateway in AWS Cloud. Then add the Cloud Router and BGP Peer IP Address which you will get from the downloaded configuration file. Add the “Inside IP Address”</p><p>Cloud Router IP — -&gt; Customer Gateway IP</p><p>BGP Peer IP  — -&gt; Virtual Private Gateway IP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*m3XACn5EANVUqSzZ.png" /></figure><p>Then click save BGP Configuration</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*JXpY5pmCOCUdCqN0.png" /></figure><p>Now see that the VPN Connection is established between AWS and GCP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*7nDxd-FFRXdcIjdv.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*XGWzcLHeRl4GCnAJ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*uipnV6NFhtNRcSOa.png" /></figure><p>If we go into AWS Console and click on Site-to-Site VPN and click on any vpn connections. You can see the tunnel is UP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*H6veUwggw04ifxcG.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*wS4HJIUVDsF_Ap_i.png" /></figure><p><strong>9. Create EC2 Instance in GCP and AWS and check connectivity</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*GRYrrr-fpD3i2GCR.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*vfQwzH0aadY9Rhjd.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*e_EUA92ZU0iRAkAb.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*xhdqQ99eRzRm4YM7.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*L0jC7QFxgfh2WRbh.png" /></figure><p>Create an EC2 Instance with the same configuration as added in the images. Enable the public IP and add 2 security groups , one for SSH and add your own IP address and another for ICMP for ping .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*k3mtMVizGuakcNx8.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*9cr1t6W3t8K12Mt7.png" /></figure><p>Then create a compute engine in GCP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*HZ3gY5legk2ONfRR.png" /></figure><p>Let’s check the connectivity between AWS and GCP Instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*WjrSivzOnOFblYk0.png" /></figure><p>We have login into GCP Compute engine instance and pinging AWS Instance using its private IP and see the packets are getting transferred without and data loss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*3PazmzZ3BurUqw6D.png" /></figure><p>If I am pinging from my local system to AWS Instance and getting request timeout error.</p><p>Let’s check the reverse part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*l2qM0YVzQVjZbd9O.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*XdhFdO0fJsU69YYu.png" /></figure><p>I logged in to the AWS Instance and pinging the GCP Instance and it is working .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*sbtPZPPVDhXeMsXO.png" /></figure><p>If I am pinging from my local system to GCP Instance and getting request timeout error.</p><p>To get a detailed understanding , go through these links : <a href="https://cloud.google.com/architecture/build-ha-vpn-connections-google-cloud-aws">Build HA VPN</a> , <a href="https://docs.aws.amazon.com/vpn/latest/s2svpn/how_it_works.html">Site-to-Site VPN</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=835aba0e564b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>