Skip to content

Tunnel

Medium — good to knowNetworking

ELI5 — The Vibe Check

A tunnel is when you wrap one type of network traffic inside another. Imagine mailing a letter inside another letter. The outer envelope gets it across the network, and when it arrives, you open it to find the real message inside. VPNs and SSH both use tunneling.

Real Talk

Tunneling encapsulates one protocol's packets inside another protocol's packets to route traffic across incompatible networks or to add encryption. Common tunneling protocols include SSH tunneling, GRE, L2TP, and WireGuard.

Show Me The Code

# SSH tunnel: forward remote port to local
# Access remote MySQL locally on port 3307
ssh -L 3307:localhost:3306 user@remote-server

# Then connect locally:
mysql -h 127.0.0.1 -P 3307 -u myuser -p

When You'll Hear This

"Set up an SSH tunnel to access the database on the private server." / "The VPN tunnel encrypts all traffic between offices."

Made with passive-aggressive love by manoga.digital. Powered by Claude.