전체 셋업, end to end
최소지만 완전한 WireGuard 셋업 걸어가기 — 서버 한 대 (항상 도달 가능, public IP 가짐), 클라이언트 한 대 (네 노트북). 같은 패턴이 [Peer] block 더 추가해서 많은 클라이언트로 확장.
~18 min · wireguard, wg-quick, keys, config
최소지만 완전한 WireGuard 셋업 걸어가기 — 서버 한 대 (항상 도달 가능, public IP 가짐), 클라이언트 한 대 (네 노트북). 같은 패턴이 [Peer] block 더 추가해서 많은 클라이언트로 확장.
# On the server
wg genkey | tee server-private.key | wg pubkey > server-public.key
# On the client (laptop)
wg genkey | tee client-private.key | wg pubkey > client-public.key
# Each side keeps its private key secret, shares only the public key
cat server-public.key
cat client-public.key[Interface]
PrivateKey = <server-private-key>
Address = 10.0.0.1/24
ListenPort = 51820
# If you want to NAT client traffic out the server's main interface (full-tunnel VPN):
PostUp = iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE
[Peer]
PublicKey = <client-public-key>
AllowedIPs = 10.0.0.2/32[Interface]
PrivateKey = <client-private-key>
Address = 10.0.0.2/24
DNS = 1.1.1.1
[Peer]
PublicKey = <server-public-key>
Endpoint = your-server.example.com:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25# On both sides
sudo wg-quick up wg0
# Status
sudo wg show
# Stop
sudo wg-quick down wg0
# Auto-start on boot (Linux)
sudo systemctl enable wg-quick@wg0
# Test the tunnel — from client, ping the server's tunnel IP
ping 10.0.0.1
# Verify your public IP changed (full-tunnel mode)
curl -s ifconfig.me # should show server's public IP, not your local oneping 10.0.0.1 으로 검증. 그런 서버 없으면 — 다음 레슨 (Tailscale) 이 같은 사용 사례를 그런 거 필요 없이 다뤄.아직 댓글이 없어요. 첫 댓글을 남겨보세요.