MirrorNest
← すべてのガイド

WireGuard

WireGuard is a minimal, high-performance VPN protocol and kernel module that establishes encrypted point-to-point tunnels using static public-key pairs instead of certificates.

対象: Ubuntu / Debian LinuxNetworkingVPN公式ホームページ ↗公式ドキュメント ↗
このガイドは上記リンク先にあるWireGuard公式ドキュメントをもとに作成されています。ディストリビューションやプロジェクトのバージョンは時間とともに変わるため、本番サーバーでこれらのコマンドを実行する前に、必ず公式ドキュメントで正確なパッケージ名・バージョン名を確認してください。
  1. 1Install WireGuard

    sudo apt install wireguard

    Debian releases older than Bullseye need backports enabled first.

  2. 2Generate a key pair

    umask 077 && wg genkey > privatekey
    wg pubkey < privatekey > publickey
  3. 3Create the interface configuration

    Create /etc/wireguard/wg0.conf with your private key, address, and peer's public key/endpoint.

    Reference: man wg-quick and man wg for the full [Interface]/[Peer] config syntax.

  4. 4Bring the tunnel up

    sudo wg-quick up wg0
    sudo wg show
  5. 5Enable the tunnel at boot

    sudo systemctl enable --now wg-quick@wg0