5
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Open VPN ConnectアプリからDNSエラーでAmazon VPNに繋がらない

Last updated at Posted at 2022-03-02

iOS / Android 版の Open VPN Connect アプリを使って Amazon Client VPN に接続しようとしたのですが

Transport Error: DNS resolve error on 'cvpn-endpoint-0102bc4c2eEXAMPLE.clientvpn.us-west-2.amazonaws.com' 

ってな具合でエラーが出て繋がりません。iOS / Android どっちも。なぜ?

原因

Amazonの公式ヘルプ によると、VPN構成ファイルの中に remote-random-hostname というプロパティがあって、これを解釈できないVPNアプリだと接続できないそうです。

client.ovpn
client
dev tun
proto udp
remote cvpn-endpoint-0102bc4c2eEXAMPLE.clientvpn.us-west-2.amazonaws.com
remote-random-hostname # ← ココ
...

解決法

remote-random-hostname というのは、DNSキャッシュ回避目的で、接続先ホストの先頭にランダムで文字列を付けるというオプションなので、解決法としては、remote-random-hostname の行を消して、remote の接続先ホスト名の頭に自分でなんかランダム文字列を付けてやれば良いです。

  • これを cvpn-endpoint-0102bc4c2eEXAMPLE.clientvpn.us-west-2.amazonaws.com
  • こうする asdfa.cvpn-endpoint-0102bc4c2eEXAMPLE.clientvpn.us-west-2.amazonaws.com

asdfa の部分がランダムな文字列ですね。

このように変更したVPN構成ファイルを改めて読み込むことで、 Open VPN アプリから無事接続できるようになりました。

もちろんDNSキャッシュ回避の仕組みは機能しなくなるので、名前解決がうまく行かなくなったら暫く待つか、またランダムホスト名を変えた ovpn ファイルを作れば OK と思います。

おわりに

Open VPNアプリのトラブルシューティングが証明書周りの話が主体で、DNS名前解決周りの話がググってもなかなか見つからなかったので書きました。

記事をここまで書いた後で、改めてググったら大変良いブログ記事がありました

5
0
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
5
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?