LoginSignup
4
1

More than 3 years have passed since last update.

UbuntuでOpenVPNのCLIからVPN接続

Posted at

UbuntuのGUIのOpenVPNクライアントからVPN接続できなくなった。
そこで、OpenVPNのCLIからVPN接続を試みて、無事に接続できたので、メモっておく。

OpenVPNのCLIからVPN接続

sudo openvpn --config ./vpn/VPNConfig.ovpn

VPNConfig.ovpn は、OpenVPNの設定ファイルで、各自取得しておく。
sudoが無いとパーミッションエラーになる。
コマンド実行後にユーザー名とパスワードを聞かれるので入力して、VPN接続完了。

VPN経由でインターネットを利用する場合

VPNConfig.ovpnに下記の記載が無い場合は、追記しておく。

redirect-gateway def1 bypass-dhcp
route 10.8.0.0 255.255.255.0
dhcp-option DNS 8.8.8.8

参考

4
1
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
4
1