VPN Gateway Troubleshootingを理解するための前提
VPN troubleshootingではConnection=Connectedだけでapplication到達を判断しない。 GatewayDiagnosticLog、TunnelDiagnosticLog、RouteDiagnosticLog、IKEDiagnosticLog等を使いlayer別にevidenceを取得できる。
IKEDiagnosticLogはIKE/IPsec negotiationやdisconnect調査に有効。 RouteDiagnosticLogはBGP connect/disconnectとroute updateを追える。
BGP issueはpeer session、ASN、TCP/179、learned/advertised prefixを分けて確認する。 third-party VPN device固有behaviorはvendor側log/configとAzure側evidenceを突き合わせる。
Control plane と data plane
仕組みと設計上の意味
「VPNが落ちた」をIKE failure、tunnel down、route missing、application failureへ分解する。
rekey時だけ切れる場合はlifetime/PFS/traffic selector/MTU等のparameter差を疑う。
BGP establishedでもdata prefixが欠落すれば通信できない。
packet captureは最終手段としてsource/NVA/on-prem deviceを含めた観測点を選ぶ。
Packet / decision path
source→destinationを1本のflowとして固定し、名前解決・routing・security・NAT/service processing・return pathを必要な範囲で順に確認する。
- gateway/connection provisioning/health確認。
- IKE/IPsec diagnostic log確認。
- tunnel metrics/status確認。
- BGP peer/learned route確認。
- effective route/securityとapplication test確認。
設計判断
| 判断点 | 推奨 | 理由 |
|---|---|---|
| Layer order | IKE→IPsec→Tunnel→BGP→Route→Application | 上位層から推測しない |
| Logs | IKE/Tunnel/Route diagnosticを時刻相関 | control/data-planeの境界を特定 |
| BGP | sessionとprefix受信を別確認 | Establishedだけで成功扱いしない |
| Change safety | incident evidence取得後に変更 | 原因消失を防ぐ |
確認手順
Azure Portal
- VPN Gateway → Connections/Monitoring/Diagnostic settingsを確認。
- BGP peer status/learned routesを確認。
- Log AnalyticsでIKE/Route/Tunnel categoryを時間軸で相関。
Evidence contract
az network vpn-connection show -g <rg> -n <connection> -o jsonc
az network vnet-gateway list-learned-routes -g <rg> -n <gateway> -o table
az network watcher troubleshooting start -g <rg> --resource <connection> --resource-type vpnConnection --storage-account <storage-id> --storage-path <https://account.blob.core.windows.net/container>Get-AzVirtualNetworkGatewayConnection -ResourceGroupName <rg> -Name <connection>
Get-AzVirtualNetworkGatewayLearnedRoute -ResourceGroupName <rg> -VirtualNetworkGatewayName <gateway>
障害切り分け
| 症状 | 疑う点 | 証拠 | 次の確認 |
|---|---|---|---|
| 定期的に数分断 | rekey/DPD/path instability | IKE/Tunnel logs timestamp | parameter/ISP path確認 |
| Connected表示なのに片方向 | return route/NSG | 両端route + flow evidence | reverse path修正 |
| BGP flap | transport/ASN/timer | BgpConnected/Disconnected events | peer config照合 |
| 特定sizeだけ失敗 | MTU/fragmentation | packet capture | MSS/MTU path確認 |
変更・rollback
- incident中に設定変更を乱発せずlogsを先に保存。
- IPsec parameter変更は両端一致を保証。
- rollbackはshared key/policy/BGP routeを一括してknown-goodへ戻す。
- 復旧後は同じfailure条件(rekey/片系停止等)を再試験。