{"id":8882,"date":"2026-02-25T17:11:08","date_gmt":"2026-02-25T08:11:08","guid":{"rendered":"https:\/\/hasu0707.duckdns.org\/blog\/?p=8882"},"modified":"2026-02-25T21:00:33","modified_gmt":"2026-02-25T12:00:33","slug":"wireguard-vpn-%ec%84%a4%ec%b9%98","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=8882","title":{"rendered":"WireGuard VPN \uc124\uce58"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">1. debian 13\uc5d0\uc11c wireguard \uc124\uce58 \ubc0f \ud655\uc778<br>  apt update<br>  apt install wireguard qrencode -y<br>  modprobe wireguard<br>  lsmod | grep wireguard<br><br>2. \uc11c\ubc84 \ubc0f \ud074\ub77c\uc774\uc5b8\ud2b8 \ud0a4 \uc0dd\uc131<br>  umask 077<br><br>  wg genkey | tee \/etc\/wireguard\/server_private.key | wg pubkey > \/etc\/wireguard\/server_public.key<br>  cat \/etc\/wireguard\/server_private.key<br>  cat \/etc\/wireguard\/server_public.key<br><br>  wg genkey | tee \/etc\/wireguard\/client_private.key | wg pubkey > \/etc\/wireguard\/client_public.key<br>  cat \/etc\/wireguard\/client_private.key<br>  cat \/etc\/wireguard\/client_public.key<br><br>3. \uc11c\ubc84 \uc124\uc815\ud30c\uc77c \uc791\uc131<br>  vi \/etc\/wireguard\/wg0.conf<br>-----<br>[Interface]<br>Address = 10.20.0.1\/24<br>ListenPort = 51820<br>PrivateKey = &lt;\uc11c\ubc84_PRIVATE_KEY><br><br>PostUp = sysctl -w net.ipv4.ip_forward=1; iptables -t nat -A POSTROUTING -s 10.20.0.0\/24 -o enp1s0 -j MASQUERADE<br>PostDown = iptables -t nat -D POSTROUTING -s 10.20.0.0\/24 -o enp1s0 -j MASQUERADE<br><br># \ud074\ub77c\uc774\uc5b8\ud2b8 #1<br>[Peer]<br>PublicKey = &lt;\ud074\ub77c\uc774\uc5b8\ud2b8#1_PUBLIC_KEY><br>AllowedIPs = 10.20.0.2\/32<br><br># \ud074\ub77c\uc774\uc5b8\ud2b8 #2<br>[Peer]<br>PublicKey = &lt;\ud074\ub77c\uc774\uc5b8\ud2b8#2_PUBLIC_KEY><br>AllowedIPs = 10.20.0.3\/32<br>-----<br><br>4. \uc11c\ubc84 \uc2dc\uc791 \ubc0f \ud655\uc778<br>  systemctl enable wg-quick@wg0<br>  systemctl restart wg-quick@wg0<br>  systemctl status wg-quick@wg0<br>  wg show : \uc0c1\ud0dc \ud655\uc778<br><br>5. \ud074\ub77c\uc774\uc5b8\ud2b8 \uc124\uc815\ud30c\uc77c \uc791\uc131<br>  \u203b\ud074\ub77c\uc774\uc5b8\ud2b8 \uc124\uc815 \ud30c\uc77c\uc758 \ud30c\uc77c\uba85\uc740 \uc778\ud130\ud398\uc774\uc2a4 \uba85\uc73c\ub85c \uc0ac\uc6a9\ub418\uc5b4 \ud2b9\uc218\ubb38\uc790\ub97c \ud5c8\uc6a9\ud558\uc9c0 \uc54a\uc73c\ubbc0\ub85c \ucd5c\ub300\ud55c \ub2e8\uc21c\ud558\uac8c \uc791\uc131\ud55c\ub2e4.<br>  vi \/etc\/wireguard\/hasu0707wg.conf<br>-----<br>[Interface]<br>PrivateKey = &lt;\ud074\ub77c\uc774\uc5b8\ud2b8#1_PRIVATE_KEY><br>Address = 10.20.0.2\/24<br>DNS = 8.8.8.8<br><br>[Peer]<br>PublicKey = &lt;\uc11c\ubc84_PUBLIC_KEY><br>Endpoint = wireguard.mydomain.com:51820<br>AllowedIPs = 192.168.1.0\/24<br>PersistentKeepalive = 25<br>-----<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. debian 13\uc5d0\uc11c wireguard \uc124\uce58 \ubc0f \ud655\uc778 apt update apt install wireguard qrencode -y modprobe wireguard lsmod | grep wireguard2. \uc11c\ubc84 \ubc0f \ud074\ub77c\uc774\uc5b8\ud2b8 \ud0a4 \uc0dd\uc131 umask 077 wg genkey | tee \/etc\/wireguard\/server_private.key | wg pubkey > \/etc\/wireguard\/server_public.key cat \/etc\/wireguard\/server_private.key cat \/etc\/wireguard\/server_public.key wg genkey | tee \/etc\/wireguard\/client_private.key | wg pubkey > \/etc\/wireguard\/client_public.key cat \/etc\/wireguard\/client_private.key cat \/etc\/wireguard\/client_public.key3. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[39,12],"tags":[],"class_list":["post-8882","post","type-post","status-publish","format-standard","hentry","category-os_linux_unix_macos","category-computing_security"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8882"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8882\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}