Raspberry Pi で proton-vpn-cli を使おうとしてうまくいかなかった。

Raspberry Pi で ProtonVPN を使う1(失敗) | 荒川仁志 公式サイト
https://hitoshiarakawa.com/blogs/2026/2026-11-15_installing-protonvpn-on-raspberry-pi-1/

Raspberry Pi で ProtonVPN を使う2(失敗) | 荒川仁志 公式サイト
https://hitoshiarakawa.com/blogs/2026/2026-11-21_installing-protonvpn-on-raspberry-pi-2/

そこで WireGuard を使う方法で ProtonVPN に接続してみた。

環境:
・Raspberry Pi 4 4GB(Trixie 64bit Desktop)
・macOS Golden Gate 27.0.1(作業マシン、英語環境)

(1)ProtonVPN のアカウントページで WireGuard configuration の設定ページに行く。

Downloads - Proton VPN
https://account.protonvpn.com/downloads

あるいは以下

WireGuard - Proton Account
https://account.proton.me/u/1/vpn/WireGuard

以下のように設定する。

  • Give a name to the config to be generated: {任意の名前。RaspberryPi とでもしておこう。}
  • Select platform: GNU/LINUX
  • Select VPN options: NAT-PMP (Port Forwarding) は無料プランでは使えないのでトグルをオフにする。VPN Accelerator は無料プランでも使えるのでオンにしておけばいい。

「Select a server to connect to」では無料プランでは Free server configs から選ぶ。

好きなサーバーで「Create」をクリックするとモーダルウィンドウが出てくるので、「Download」をクリックする。conf ファイル(実体はテキストファイル)がダウンロードされる。

(2)Raspberry Pi に WireGuard をインストールする。

$ sudo apt update && sudo apt install wireguard wireguard-tools resolvconf

(3)【/etc/wireguard/ に1のファイルを置く】

macOS のエディターで1のファイルを開き、その内容をコピーしておく。

sudo nano /etc/wireguard/protonvpn.conf でファイルを作成し、ペーストする。

ちなみに Wireguard が扱えるファイル名は 15 文字以内なので、conf ファイルの名前を protonvpn.conf とした。

(4)VPN に接続してみよう。

$ sudo wg-quick up protonvpn

接続状態は以下で確認できる。

$ sudo wg

グローバル IP アドレスを調べるには以下。

$ curl https://ifconfig.me

切断するには以下。

$ sudo wg-quick down protonvpn

切断した状態で接続状態を確認すると、何も表示されないはずだ。

$ sudo wg

自動起動を有効化するには以下。

$ sudo systemctl enable wg-quick@protonvpn

特に何も設定しなくても VPN を使用中でも同一ネットワーク内のマシンから SSH 接続できた。

参考:
How to allow LAN connections | Proton VPN
https://protonvpn.com/support/lan-connections

*

WireGuard を使うメリットは、サーバーを選べることだ。普通にアプリを使うと無料プランではサーバーを選べないが、WireGuard は(無料プランで選べるサーバーの範囲内で)接続したいサーバーの設定ファイルを使えばその国に接続できる。

なお無料プランでは同時に VPN 接続できるデバイスは1つまでだ。Raspberry Pi で常時接続させると他のデバイスで ProtonVPN が使えない。Raspberry Pi 用の専用の ProtonVPN のアカウントを作った。

それと WireGuard の設定ファイルの有効期限は1年間となっている。最長でも1年以内に「カウントページ>ProtonVPN>WireGuard>{該当の設定ファイル}」にある「Extend」で有効期限を延長する必要がある(1年以内にボタンを押せば、その日からまた1年間分延長される)。

Amazon.co.jp: Raspberrypi5 8G ラズベリーパイ5 技適取得済マーク入り商品 : パソコン・周辺機器
https://amzn.to/3I9bQac