LoginSignup
2
2

More than 3 years have passed since last update.

UbuntuでVPN Gatewayへ繋げる

Posted at

事前準備

net-toolsインストール(無かったので)

apt install net-tools

VPN Serverを決める

自分の環境のデフォルトゲートウェイを調べる

ip route show | grep default

導入作業

ダウンロードと起動

VPNClientダウンロード

※CPUはご自身の環境のものを。
image.png

tar.gzファイルを解凍

tar -xzvf ダウンロードファイル

make

解凍ディレクトリへ移動し、make

make

VPN Client 起動

./vpnclient start

VPNサーバへのスタティックルートを追加

oute add -host [事前準備で選択したVPNGateサーバーhost] gw [先程調べた今のゲートウェイIP]

VPN Client設定

コンソールへ

./vpncmd

仮想NIC作成

NicCreate tun0

仮想NIC有効化

NicEnable tun0

VPN設定追加

AccountCreate vpngate0 /SERVER:[事前準備で選択したVPNGateサーバーhost:TCPポート] /HUB:VPNGATE /USERNAME:vpn /NICNAME:tun0

匿名ログイン有効化

AccountAnonymousSet vpngate0

VPN接続

AccountConnect vpngate0

exit

exit

terminal上で作業

ifconfigで追加した仮想LANカードを確認

ifconfig

追加したdevice(vpn_tun0)がみえるはず。

dhclientでip取得

dhclient [device名]

default route削除

※ 事前にデフォルトゲートウェイをメモっておくこと。私はdefaultを消さずとも目標は達成できた。
route delete default

backupコマンド例

route add default gw 192.168.1.1 dev enp7s0

192.168.1.1がデフォルトゲートウェイ、enp7s0が通常使っている有線LANデバイス名。

IP確認

参考

ほぼこちらのサイトの引用です。
http://rauq04.blogspot.com/2014/02/linux-softether-vpn-client-vpngate.html

VPN Gate

VPN Gate

softether download

softether download

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2