C.W.K.
Stream
Lesson 03 of 12 · published

WireGuard 개념

~12 min · wireguard, concepts, peer, allowedips

Level 0Pinger
0 XP0/101 lessons0/12 achievements
0/150 XP to next level150 XP to go0% complete

개념적으로 단순

WireGuard 가 움직이는 부품 몇 개뿐. 이게 클릭하면 config 가 분명히 말됨.

  • Interface — 가상 네트워크 어댑터 (예: wg0). 각 장치가 자기 private key 와 VPN 서브넷의 IP 가진 거 하나 가짐.
  • Peer — 이거랑 대화하길 원하는 다른 장치, public key 로 식별.
  • Endpoint — peer 의 진짜 IP:port (서버처럼 "항상 도달 가능" 이어야 하는 peer 만 필요).
  • AllowedIPs — 어떤 destination IP 가 특정 peer 한테 터널 통해 라우팅돼야 하는지. 0.0.0.0/0 = 다; 10.0.0.2/32 = 그 한 IP 만.

SSH 비유

WireGuard 인증이 거의 정확히 SSH authorized_keys 처럼:

SSHWireGuard
키 페어 생성키 페어 생성
authorized_keys 에 public key 설치[Peer] block 에 public key 추가
Private key 머신 안 떠남같음
Hostname 으로 연결Endpoint 로 연결 ("server" peer 만)

SSH 키 (Track 2) 이해했으면 이미 WireGuard 신뢰 모델 이해.

Code

INI config 모양·ini
# /etc/wireguard/wg0.conf — client side
[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          # route ALL traffic through tunnel
PersistentKeepalive = 25         # keep NAT mappings alive (only on clients)

External links

Exercise

위 INI config 읽어. 식별 — [Interface] 섹션이 어느 키 필요 (private), [Peer] 섹션이 어느 키 필요 (public), AllowedIPs 를 0.0.0.0/0 에서 10.0.0.0/24 로 바꾸면 의미 (그 서브넷으로의 트래픽만 터널, 그 외 보통 라우트 사용).

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.