View a markdown version of this page

CLI コマンド構文 - AWS クライアント VPN

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

CLI コマンド構文

CLI コマンドは、次の構文を使用して使用できます。

aws-vpn-client <COMMAND> [OPTIONS]

CLI ツールでは、次のコマンドがサポートされています。

Usage: aws-vpn-client <COMMAND>

Commands:
  connect                Connect a profile through the AWS VPN Client
  disconnect             Disconnect a profile from the AWS VPN Client
  delete-profile         Delete a profile from the AWS VPN Client
  import-profile         Import a VPN connection profile
  list-profiles          List all VPN profiles
  get-config             Get configuration for a profile
  put-preference         Put a preference value
  list-preferences       List all preferences
  get-connection-status  Get the current connection status for a VPN profile
  list-connections       List all active VPN connections
  send-diagnostic-logs   Send diagnostic logs to AWS for troubleshooting
  help                   Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

接続

説明

プロファイルへの VPN 接続を確立します。

概要

aws-vpn-client connect --profile-name <PROFILE> [--auth-user-pass <AUTH_USER_PASS>]

オプション

--profile-name (文字列)

接続するプロファイルの名前。このオプションは必須です。

--auth-user-pass (文字列)

ユーザー名 (1 行目)、パスワード (2 行目)、オプションの MFA コード (3 行目) を含むファイルへのパス。このオプションは必須ではありません。

例: VPN プロファイルに接続する

次のconnect例では、プロファイルへの VPN 接続を確立します。

aws-vpn-client connect --profile-name "Production-VPN"

出力:

{
  "status": "Connected"
}

切断する

説明

アクティブな VPN 接続を終了します。

概要

aws-vpn-client disconnect --profile-name <PROFILE_NAME>

オプション

--profile-name (文字列)

切断する接続済みプロファイルの名前。このオプションは必須です。

例: VPN プロファイルからの切断

次の のdisconnect例では、VPN 接続を終了します。成功時の出力はありません。

aws-vpn-client disconnect --profile-name "Production-VPN"

例: 切断エラー

次のdisconnect例は、プロファイルが接続されていない場合のエラーを示しています。

aws-vpn-client disconnect --profile-name "Production-VPN"

出力:

{
  "status": "Error",
  "message": "Profile is not connected"
}

import-profile

説明

VPN 接続プロファイルをインポートします。

概要

aws-vpn-client import-profile --profile-name <PROFILE_NAME> --config-path <CONFIG_PATH> [--global]

オプション

--profile-name (文字列)

インポートされたプロファイルのカスタム名。このオプションは必須です。

--config-path (文字列)

OpenVPN 設定ファイル (.ovpn) へのパス。このオプションは必須です。

--global (ブーリアン)

すべてのユーザーが利用できるグローバルプロファイルとして をインポートします。このオプションには管理者権限が必要です。

例: プロファイルをインポートする

次の のimport-profile例では、VPN 接続プロファイルをインポートします。

aws-vpn-client import-profile --profile-name "Production-VPN" --config-path /path/to/vpn-config.ovpn

出力:

{
  "status": "Success"
}

例: グローバルプロファイルをインポートする

次の のimport-profile例では、グローバルプロファイルをインポートします。これには管理者権限が必要です。

sudo aws-vpn-client import-profile --profile-name "Company-VPN" --config-path /path/to/config.ovpn --global

出力:

{
  "status": "Success"
}

例: インポートエラーと無効なファイルパス

次のimport-profile例は、設定ファイルが見つからない場合のエラーを示しています。

aws-vpn-client import-profile --profile-name "test" --config-path /invalid/path.ovpn

出力:

{
  "status": "Error",
  "message": "Failed to read OpenVPN config file: No such file or directory (os error 2)"
}

delete-profile

説明

クライアントからプロファイルを削除します。

概要

aws-vpn-client delete-profile --profile-name <PROFILE_NAME>

オプション

--profile-name (文字列)

削除するプロファイルの名前。このオプションは必須です。

例: プロファイルを削除する

次の のdelete-profile例では、VPN プロファイルを削除します。成功時の出力はありません。

aws-vpn-client delete-profile --profile-name "Production-VPN"

例: 存在しないプロファイルでエラーを削除する

次のdelete-profile例は、プロファイルが存在しない場合のエラーを示しています。

aws-vpn-client delete-profile --profile-name "nonexistent"

出力:

{
  "status": "Error",
  "message": "Profile not found"
}

プロファイルのリスト

説明

すべての VPN プロファイルを一覧表示します。

概要

aws-vpn-client list-profiles

例: すべての VPN プロファイルを一覧表示する

次の のlist-profiles例では、インポートされたすべての VPN プロファイルを一覧表示します。

aws-vpn-client list-profiles

出力:

[
  {
    "profile-name": "Production-VPN",
    "owned-by": "jdoe",
    "auth-type": "saml",
    "imported-at": "2026-07-21T13:04:42-07:00"
  },
  {
    "profile-name": "Staging-VPN",
    "owned-by": "jdoe",
    "auth-type": "ma",
    "imported-at": "2026-07-22T10:30:00-07:00"
  }
]
注記

グローバルプロファイル ( でインポート--global) には owned-byフィールドがありません。

get-config

説明

プロファイルの OpenVPN 設定を取得します。

概要

aws-vpn-client get-config --profile-name <PROFILE_NAME>

オプション

--profile-name (文字列)

設定を取得するプロファイルの名前。このオプションは必須です。

例: OpenVPN 設定を取得する

次の のget-config例では、プロファイルの OpenVPN 設定を取得します。

aws-vpn-client get-config --profile-name "Production-VPN"

出力:

client
dev tun
proto udp
remote cvpn-endpoint-0123456789abcdef0.prod.clientvpn.us-east-1.amazonaws.com 443
remote-random-hostname
resolv-retry infinite
nobind
remote-cert-tls server
cipher AES-256-GCM
verb 3
<ca>
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
</ca>
auth-user-pass
reneg-sec 0

get-connection-status

説明

VPN プロファイルの現在の接続ステータスを取得します。

概要

aws-vpn-client get-connection-status --profile-name <PROFILE_NAME> [--show-details]

オプション

--profile-name (文字列)

接続ステータスを取得するプロファイルの名前。このオプションは必須です。

--show-details (ブーリアン)

出力に接続バイト統計を含めます。

例: 接続ステータスの取得

次の のget-connection-status例では、プロファイルの接続ステータスを取得します。

aws-vpn-client get-connection-status --profile-name "Production-VPN"

出力:

{
  "connection-status": "Connected",
  "latest-connection-attempt": {
    "initiated-by": "jdoe",
    "updated-at": "2026-07-24T15:50:36-07:00"
  }
}

例: 詳細を含む接続ステータスを取得する

次のget-connection-status例には、 --show-detailsオプションを使用したバイト統計が含まれています。

aws-vpn-client get-connection-status --profile-name "Production-VPN" --show-details

出力:

{
  "connection-status": "Connected",
  "latest-connection-attempt": {
    "initiated-by": "jdoe",
    "updated-at": "2026-07-24T15:50:36-07:00",
    "details": {
      "tunnel-bytes-in": 0,
      "tunnel-bytes-out": 0,
      "transport-bytes-in": 9674,
      "transport-bytes-out": 11413
    }
  }
}

list-connections

説明

すべてのアクティブな VPN 接続を一覧表示します。

概要

aws-vpn-client list-connections

例: アクティブな接続を一覧表示する

次の のlist-connections例では、すべてのアクティブな VPN 接続を一覧表示します。

aws-vpn-client list-connections

出力:

[
  {
    "profile-name": "Production-VPN",
    "initiated-by": "jdoe",
    "connection-status": "Connected",
    "last-updated-at": "2026-07-24T15:50:36-07:00"
  }
]

例: アクティブな接続がない

次のlist-connections例は、アクティブな接続がない場合の出力を示しています。

aws-vpn-client list-connections

出力:

[]

put-preference

説明

グローバル設定のプリファレンスを設定します。ほとんどの設定には管理者権限が必要です。

概要

aws-vpn-client put-preference --key <PREFERENCE_KEY> --value <PREFERENCE_VALUE>

オプション

--key (文字列)

設定する設定キーの名前。このオプションは必須です。

--value (文字列)

設定キーに設定する値。このオプションは必須です。

次の設定キーを使用できます。

enable-telemetry

テレメトリ (true/false) を有効または無効にします。

enable-user-profile-management

エンドユーザーによるプロファイルのインポートまたは削除 (true/false) を許可または禁止します。

max-connections

同時接続の最大数 (整数、1~5)。

例: 設定する

次の のput-preference例では、接続の最大数を設定します。これには管理者権限が必要です。成功時の出力はありません。

sudo aws-vpn-client put-preference --key max-connections --value 4

例: 管理者権限のないエラー

次のput-preference例は、管理者権限なしで コマンドを実行するときのエラーを示しています。

aws-vpn-client put-preference --key max-connections --value 4

出力:

{
  "status": "Error",
  "message": "Permission denied: admin privileges required"
}

例: 無効な値を持つエラー

次のput-preference例は、無効な値を指定した場合のエラーを示しています。

sudo aws-vpn-client put-preference --key max-connections --value 8

出力:

{
  "status": "Error",
  "message": "Preference value is invalid"
}

list-preferences

説明

すべてのグローバル設定設定と現在の値を表示します。

概要

aws-vpn-client list-preferences

例: すべての設定を一覧表示する

次の のlist-preferences例では、すべてのグローバル設定設定とその現在の値を表示します。

aws-vpn-client list-preferences

出力:

{
  "enable-telemetry": true,
  "enable-user-profile-management": true,
  "max-connections": 1
}

send-diagnostic-logs

説明

診断ログを収集し、トラブルシューティング AWS のために に送信します。

概要

aws-vpn-client send-diagnostic-logs

例: 診断ログを送信する

次の のsend-diagnostic-logs例では、診断ログを収集して送信します AWS。

aws-vpn-client send-diagnostic-logs

出力:

{
  "reference-id": "us-west-2:78ff6531-5dc4-c706-7149-e6cfd8adadc7/2026-07-24-16-03-55.zip"
}
注記

問題をレポートするときに、 AWS サポートとreference-id値を共有します。

終了コード

AWS クライアント VPN CLI ツールは、次の終了コードを返します。

終了コード 意味
0 成功
1 一般的なエラー
2 無効なコマンド構文