GCP compute engineのVMインスタンスにVPNserverを立てる
なにがしたい
GCP無料体験イベントみたいなことをやっていたので、一人用vpngateみたいなことがしたかった
VPNserverを中継して目的のサイトにアクセスできるので捗る
実際にきちんと出来ているのかはよくからないけれど、curl inet-ip.info
した感じだとできていそう
どうした
Linux へのインストールと初期設定
Ubuntu上でSoftEther VPN Server構築
softetherダウンロードセンター
このあたりを参考にして
sudo -i
の後実行
#! /bin/bash apt update && apt upgrade -y apt install -y bridge-utils gcc make cd /tmp || exit curl -O "上記のダウンロードセンターから最新のrtm版へのリンクをひっぱってくる" tar -xvf softether* mv ./vpnserver/ /usr/local/ cd /usr/local/vpnserver || exit yes "1" | make chmod 600 -- * chmod 700 vpncmd vpnserver echo -e "[Unit] Description=SoftEther VPN Server After=network.target network-online.target [Service] ExecStart=/usr/local/vpnserver/vpnserver start ExecStop=/usr/local/vpnserver/vpnserver stop Type=forking RestartSec=3s [Install] WantedBy=multi-user.target\n" > /etc/systemd/system/vpnserver.service systemctl daemon-reload systemctl enable vpnserver.service systemctl start vpnserver.service
- SoftEther VPN Server Managerを使用して設定
- ユーザ作成までやって、ローカルブリッジは設定しない(ここでしこたま困った)
- secureNAT機能をONにしてDHCP鯖を使う
SoftEther VPN 質問フォーラム (日本語) IPアドレスが取得できません
ここまでやれば後はsoftether clientから適当に接続すればいける
curl inet-ip.info
して満足した
終えて
shellcheck ちょうべんりなのでおすすめです
私のような事をやりたい人をぐぐっても全く見付けられなかったので多分もっと簡単で便利な方法がありますねこれ…
そもそもsoftether vpn gate でよいだろうし