dhairyashah
Portfolio

May 7th, 2025

How I Connected My Home Network with AWS Regions Using Tailscale and VPC Peering

Author Picture

Dhairya Shah

Software Engineer

Hey there, fellow tech tinkerers! As a developer and cloud enthusiast, I love messing around in my home lab—a trusty Raspberry Pi 5 running my self-hosted setup. But sometimes, I need to tap into the power of AWS for testing, dev work, or hybrid projects. In this post, I’m spilling the beans on how I bridged my home network with two AWS regions (ap-south-1 and us-east-1) using Tailscale, EC2, and VPC Peering. The result? A secure, low-latency network that feels like magic. Let’s dive in!


🧠 Why I Did This

My home lab is my sandbox for coding, experimenting, and breaking things (gently). But when I need AWS’s managed services—like serverless functions or storage—I don’t want to deal with public IPs or clunky SSH setups. My goal was to create a private, secure, and dead-simple network bridge connecting:

No public exposure, no VPN headaches—just smooth, encrypted access from my home terminal to the cloud.


🛠️ My Toolkit

Here’s what I used to pull this off:


🔗 Step 1: Getting Tailscale Up and Running

First things first, I installed Tailscale on:

After signing both into my Tailscale account (super quick setup, by the way), I told the EC2 instance to advertise the VPC’s CIDR block so my home network could see it:

tailscale up --advertise-routes=172.31.0.0/16 --accept-routes

Screenshot of Tailscale subnet routes configuration showing advertised routes

Boom! My home network could now reach private resources in ap-south-1 through Tailscale—no VPN, no bastion host, just pure simplicity.


🌍 Step 2: Routing VPC Traffic Back Home

To let my home network talk to the ap-south-1 VPC, I turned on IP forwarding on the EC2 instance (because it’s gotta play traffic cop):

sudo sysctl -w net.ipv4.ip_forward=1

Then, on my Raspberry Pi, I added a route to send VPC-bound traffic through the EC2’s Tailscale IP (mine was 100.104.53.61—yours will differ):

sudo ip route add 172.31.0.0/16 via 100.104.53.61

Screenshot of AWS EC2 instance with private IP address highlighted

Terminal output showing successful ping to AWS private IP address

After this, I could curl or ping internal VPC endpoints from my home lab. It felt like my Pi was living in the cloud!


🌐 Step 3: Hooking Up us-east-1 with VPC Peering

Now, I wanted my us-east-1 VPC (172.15.0.0/16) to join the party. Enter VPC Peering:

I set up the peering connection in the AWS console (pretty straightforward) and updated the route tables:

AWS console screenshot showing route table configuration for ap-south-1 region

AWS console screenshot showing VPC peering connection details

This let my EC2 instance in ap-south-1 talk to us-east-1 resources. To make us-east-1 accessible from my home network, I updated the EC2’s Tailscale route advertisement to include both VPCs:

tailscale up --advertise-routes=172.31.0.0/16,172.15.0.0/16 --accept-routes

Now my home lab could reach both AWS regions through the EC2 relay. Mind blown!


🔒 Locking It Down

Security’s a big deal, so I made sure to:


✅ What It All Looks Like

Here’s the final network setup:

                            +-----------------------------+
                            |     Home Network (LAN)     |
                            |    CIDR: 192.168.0.0/24     |
                            |   Devices (Raspberry Pi,    |
                            |     Laptop, etc.)           |
                            +-------------+---------------+
                                          |
                                (Tailscale VPN Tunnel)
                                          |
                                          v
                  +----------------------------+
                  |     EC2 Relay Instance     |
                  |  Region: ap-south-1 (Mumbai)|
                  | Private IP: 172.31.x.x      |
                  +-------------+--------------+
                                |
     +--------------------------+---------------------------+
     |                                                      |
     v                                                      v
+------------------+                          +----------------------------+
| ap-south-1 VPC   |                          |  VPC Peering Connection     |
| CIDR: 172.31.0.0/16 |<--------------------->| us-east-1 VPC               |
| Internal Services |                         | CIDR: 172.15.0.0/16         |
| or Subnet A       |                         | Backend / Analytics         |
+------------------+                          +----------------------------+


It’s all private, encrypted, and surprisingly fast—no VPN appliances or public NAT nonsense.

Network diagram showing the Tailscale connectivity between home network and AWS regions


🎯 Wrapping Up

Setting this up has completely transformed my dev workflow. I can now access AWS resources from my home lab just like they’re part of my local network. Tailscale makes hybrid networking super smooth, and VPC Peering keeps traffic between regions fast and private.

If you’re thinking about connecting your home lab to the cloud, I highly recommend giving this a shot—it’s secure, scalable, and honestly, kinda fun to build.

Got questions or cool tips of your own? Let’s chat in the comments or feel free to reach out. Happy networking! 🚀

Cover Photo by Growtika on Unsplash