WireGuard wg-quick CLI Sheet: Interface

๐Ÿ’ก WireGuard wg-quick CLI Sheet: Interface โ€” Executive Summary

Technical architectural analysis, practical configuration manifests, and deployment instructions for WireGuard wg-quick CLI Sheet: Interface.

Exec
Create a client tunneling interface (Mac OS)
bash
my_interface=fredric18
# config ์ƒ์„ฑ
my_config="""
"""
cat <<EOF > /opt/homebrew/etc/wireguard/$my_interface.conf
$my_config
EOF

wg-quick up $my_interface

# ๋ฌด์Šจ์†Œ์šฉ์ธ์งˆ ๋ชจ๋ฅด๊ฒ ์Œ
wg-quick save $my_interface
Connect
bash
my_interface=fredric18
wg-quick up $my_interface
End connection
bash
my_interface=fredric18
wg-quick down $my_interface
Check status
Trouble Shooting
Mac OS Issue
txt
wg-quick: Version mismatch: bash 3 detected, when bash 4+ required
Problem overview
bash
# mac์—์„œ bash๋ฒ„์ „๋ฌธ์ œ ๋ฐœ์ƒ์‹œ
bash --version
>>>
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin23)
Copyright (C) 2007 Free Software Foundation, Inc.
<<<

brew upgrade bash
>>>
Warning: bash 5.3.8 already installed
<<<

wg-quick
>>>
wg-quick: Version mismatch: bash 3 detected, when bash 4+ required
<<<

/opt/homebrew/bin/bash --version
>>>
GNU bash, ๋ฒ„์ „ 5.3.8(1)-release (aarch64-apple-darwin23.6.0)
Copyright (C) 2025 Free Software Foundation, Inc.
๋ผ์ด์„ ์Šค GPLv3+: GNU GPL ๋ฒ„์ „ 3 ์ด์ƒ <http://gnu.org/license/gpl.html>

์ด ํ”„๋กœ๊ทธ๋žจ์€ ์ž์œ  ์†Œํ”„ํŠธ์›จ์–ด์ž…๋‹ˆ๋‹ค. ์ž์œ ๋กญ๊ฒŒ ๋ฐ”๊พธ๊ณ  ์žฌ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๋ฒ•๋ฅ ์ด ํ—ˆ์šฉํ•˜๋Š” ๋ชจ๋“  ๋ฒ”์œ„๋‚ด์˜ ๋ณด์ฆ์€ ์—†์Šต๋‹ˆ๋‹ค.
<<<

which bash
>>>
/bin/bash
<<<

echo $PATH
>>>
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/myeong/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/Users/myeong/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/myeong/.cargo/bin:/Applications/iTerm.app/Contents/Resources/utilities
<<<
  • solved
References and Guidelines (NOTE)

If a binary with the same name exists in the path of PATH, the leftmost one in the variable is processed first.

bash
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
  source ~/.zshrc
  bash --version
  >>>
  GNU bash, ๋ฒ„์ „ 5.3.8(1)-release (aarch64-apple-darwin23.6.0)
  Copyright (C) 2025 Free Software Foundation, Inc.
  ๋ผ์ด์„ ์Šค GPLv3+: GNU GPL ๋ฒ„์ „ 3 ์ด์ƒ <http://gnu.org/license/gpl.html>

  ์ด ํ”„๋กœ๊ทธ๋žจ์€ ์ž์œ  ์†Œํ”„ํŠธ์›จ์–ด์ž…๋‹ˆ๋‹ค. ์ž์œ ๋กญ๊ฒŒ ๋ฐ”๊พธ๊ณ  ์žฌ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  ๋ฒ•๋ฅ ์ด ํ—ˆ์šฉํ•˜๋Š” ๋ชจ๋“  ๋ฒ”์œ„๋‚ด์˜ ๋ณด์ฆ์€ ์—†์Šต๋‹ˆ๋‹ค.
Client hardware dependent issue
  • โ€“ client config

    txt
    [Interface]
      PrivateKey = <secret>
      Address = 10.0.X.X/32
      DNS = 192.168.118.53
    
      [Peer]
      PublicKey = <secret>
      AllowedIPs = 0.0.0.0/0, ::/0
      Endpoint = <WAN>:41821
      PersistentKeepalive = 25

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *