24 時間稼働させている Raspberry Pi に ProtonVPN を常時接続設定した。
Raspberry Pi で ProtonVPN を使う3 | 荒川仁志 公式サイト
https://hitoshiarakawa.com/blogs/2026/2026-11-21b_installing-protonvpn-on-raspberry-pi-3/
さらにトラベルルーターとして使っている Raspberry Pi も NordVPN ではなく ProtonVPN を使うことにした。
*
トラベルルーターでは RaspAP を使っている。
Raspberry Pi トラベルルーターの作成4(成功)|荒川 仁志 | Hitoshi Arakawa
https://note.com/hitoshiarakawa/n/ne3dc58c30cec
ProtonVPN は Raspberry Pi へ直接インストールすることができないため、WireGuard を使うことで ProtonVPN を使用する。RaspAP では WireGuard を設定できる。
環境:
・Raspberry Pi 4 Model B 4GB(Trixie Desktop 64-bit、CLI 起動)
・macOS Golden Gate 27.0.1(英語環境、作業マシン)
(1)WireGuard をインストールする。
$ sudo apt update
$ sudo apt install wireguard
(2)設定ファイルを開く。
$ sudo nano /var/www/html/includes/config.php
以下のように変更する。
// 変更前
define('RASPI_WIREGUARD_ENABLED', false);
// 変更後
define('RASPI_WIREGUARD_ENABLED', true);
RaspAP の WebUI を見ると WireGuard のメニューが追加されているはずだ。
(3)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: {任意の名前。RaspAP とでもしておこう。}
- 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 ファイル(実体はテキストファイル)がダウンロードされる。
(4)3の conf ファイルをテキストエディターで開く。
DNS の行をコメントアウトする。
変更前:
DNS = 10.2.0.1
変更後:
# DNS = 10.2.0.1
(5)「RaspAP の管理画面>WireGuard>Settings>Tunnel settings>Configuration Method」で「Upload file」を選択する(最初から選択されている)。
「Configuration File>Choose File」で3の conf ファイルを選択。
「Save settings」をクリックする。
(6)右上の「wg down」の左の三角マークをクリックすると ProtonVPN に接続できる。
赤色の四角をクリックすると切断される。
以下のサイトで IP アドレスや場所が変化することを確認すれば ProtonVPN に接続できているかを確認できる。
What is my IP address location? See your public IP address | NordVPN
https://nordvpn.com/what-is-my-ip/
コマンドで確認するには以下を実行する。値が返ってくれば接続中で、何も値が返ってこなければ接続していない。
$ sudo wg
コマンドで ProtonVPN に接続するには以下を実行する。
$ sudo wg-quick up wg0
切断するには以下。
$ sudo wg-quick down wg0
RaspAP の WebUI で、「WireGuard>wg up」の四角ボタンを押すことによる切断はうまくいかないことがある。その場合はコマンドで切断しよう。
参考:
Manual installation - RaspAP Documentation
https://docs.raspap.com/get-started/manual/#wireguard
Amazon.co.jp: Raspberrypi5 8G ラズベリーパイ5 技適取得済マーク入り商品 : パソコン・周辺機器
https://amzn.to/3I9bQac