AWS Site-to-Site VPN IPSec詳細設定 - セキュア接続の実装ガイド
AWS Site-to-Site VPNの本格的な実装では、IPSecトンネルの詳細設定が重要な要素となります。適切な暗号化設定、BGPパラメータの調整、冗長性の確保により、セキュアで安定したハイブリッド接続を実現できます。この記事では、実際の運用で必要となるIPSec設定の詳細を解説します。
IPSec基礎とAWS実装
IPSecトンネルアーキテクチャ
AWS Site-to-Site VPNでは、冗長性確保のため2つのIPSecトンネルが自動的に作成されます。
IPSec Phase 1 (IKE)設定
Phase 1パラメータ設定表
パラメータ | AWS設定値 | 推奨カスタマー設定 |
---|---|---|
IKE Version | IKEv1, IKEv2 | IKEv2 (推奨) |
Encryption | AES-128, AES-256 | AES-256 |
Integrity | SHA-1, SHA-256 | SHA-256 |
DH Group | 2, 14-24 | Group 19 (ECP256) |
Lifetime | 28800 seconds | 28800 seconds |
Cisco設定例
crypto ikev2 proposal AWS-IKE-PROPOSAL
encryption aes-cbc-256
integrity sha256
group 19
crypto ikev2 policy AWS-IKE-POLICY
proposal AWS-IKE-PROPOSAL
crypto ikev2 keyring AWS-KEYRING
peer AWS-PEER1
address 203.0.113.12
pre-shared-key local AWS_TUNNEL_1_PSK
pre-shared-key remote AWS_TUNNEL_1_PSK
IPSec Phase 2 (IPSec)設定
Phase 2パラメータ設定表
パラメータ | AWS設定値 | 推奨設定 |
---|---|---|
Encryption | AES-128, AES-256 | AES-256 |
Integrity | SHA-1, SHA-256 | SHA-256 |
PFS Group | 2, 5, 14-24 | Group 19 |
Lifetime | 3600 seconds | 3600 seconds |
DPD Timeout | 30 seconds | 30 seconds |
実装例:Phase 2設定
crypto ipsec transform-set AWS-TRANSFORM-SET esp-aes 256 esp-sha256-hmac
mode tunnel
crypto ipsec profile AWS-IPSEC-PROFILE
set transform-set AWS-TRANSFORM-SET
set pfs group19
set ikev2-profile AWS-IKE-PROFILE
BGP設定の詳細
BGP基本設定
AWS VPN接続でのBGP設定例
高度なBGP設定
プライマリ/セカンダリトンネル制御
router bgp 65000
neighbor 169.254.10.1 remote-as 64512
neighbor 169.254.10.1 timers 10 30
neighbor 169.254.10.1 timers connect 10
neighbor 169.254.10.5 remote-as 64512
neighbor 169.254.10.5 timers 10 30
neighbor 169.254.10.5 timers connect 10
address-family ipv4
network 192.168.1.0/24
neighbor 169.254.10.1 activate
neighbor 169.254.10.1 soft-reconfiguration inbound
neighbor 169.254.10.1 route-map PRIMARY-PATH out
neighbor 169.254.10.5 activate
neighbor 169.254.10.5 soft-reconfiguration inbound
neighbor 169.254.10.5 route-map BACKUP-PATH out
exit-address-family
! プライマリパス設定(Tunnel 1)
route-map PRIMARY-PATH permit 10
set as-path prepend 65000
set local-preference 200
! バックアップパス設定(Tunnel 2)
route-map BACKUP-PATH permit 10
set as-path prepend 65000 65000 65000
set local-preference 100
BGPルートフィルタリング
セキュリティ強化のためのフィルタリング
! アウトバウンドフィルター(送信制御)
ip prefix-list ALLOWED-TO-AWS seq 5 permit 192.168.0.0/16 le 24
ip prefix-list ALLOWED-TO-AWS seq 10 permit 10.0.0.0/8 le 24
route-map FILTER-TO-AWS permit 10
match ip address prefix-list ALLOWED-TO-AWS
! インバウンドフィルター(受信制御)
ip prefix-list ALLOWED-FROM-AWS seq 5 permit 10.0.0.0/16
ip prefix-list ALLOWED-FROM-AWS seq 10 permit 172.16.0.0/16
route-map FILTER-FROM-AWS permit 10
match ip address prefix-list ALLOWED-FROM-AWS
! BGPネイバーへのフィルター適用
router bgp 65000
neighbor 169.254.10.1 route-map FILTER-TO-AWS out
neighbor 169.254.10.1 route-map FILTER-FROM-AWS in
セキュリティ強化設定
暗号化アルゴリズムの選択
セキュリティレベル別推奨設定
セキュリティレベル | Phase 1暗号化 | Phase 2暗号化 | ハッシュ | DHグループ |
---|---|---|---|---|
標準 | AES-128 | AES-128 | SHA-256 | Group 14 |
高セキュリティ | AES-256 | AES-256 | SHA-256 | Group 19 |
最高セキュリティ | AES-256-GCM | AES-256-GCM | SHA-384 | Group 20 |
実装例:高セキュリティ設定
crypto ikev2 proposal HIGH-SECURITY-PROPOSAL
encryption aes-cbc-256
integrity sha384
group 20
crypto ipsec transform-set HIGH-SECURITY-TRANSFORM esp-aes 256 esp-sha384-hmac
mode tunnel
crypto map AWS-VPN-MAP 10 ipsec-isakmp
set peer 203.0.113.12
set transform-set HIGH-SECURITY-TRANSFORM
set pfs group20
set ikev2-profile HIGH-SECURITY-PROFILE
Dead Peer Detection (DPD)設定
DPD最適化設定
crypto ikev2 profile AWS-IKE-PROFILE
match identity remote address 203.0.113.12 255.255.255.255
identity local address 198.51.100.12
authentication remote pre-share key AWS_TUNNEL_PSK
authentication local pre-share key AWS_TUNNEL_PSK
dpd 30 5 on-demand
パフォーマンス最適化
MTU設定とMSS Clamping
最適なMTU値の決定
実装設定
interface Tunnel1
ip address 169.254.10.2 255.255.255.252
ip mtu 1436
ip tcp adjust-mss 1396
tunnel source 198.51.100.12
tunnel destination 203.0.113.12
tunnel mode ipsec ipv4
tunnel protection ipsec profile AWS-IPSEC-PROFILE1
トラフィック整形とQoS
優先度制御の実装
! クラスマップ定義
class-map match-any CRITICAL-TRAFFIC
match access-group name CRITICAL-ACL
class-map match-any NORMAL-TRAFFIC
match access-group name NORMAL-ACL
! ポリシーマップ定義
policy-map VPN-QOS-POLICY
class CRITICAL-TRAFFIC
priority percent 30
set dscp af31
class NORMAL-TRAFFIC
bandwidth percent 50
set dscp af21
class class-default
bandwidth percent 20
! インターフェースへの適用
interface Tunnel1
service-policy output VPN-QOS-POLICY
監視とトラブルシューティング
CloudWatch統合監視
重要メトリクスの設定
メトリクス名 | 説明 | しきい値例 |
---|---|---|
TunnelState | トンネル状態 | DOWN時アラート |
TunnelIpAddress | IPアドレス変更 | 変更時通知 |
PacketDropCount | パケットドロップ | > 100/分 |
CloudWatch Logs活用
json
{
"VPNConnectionLogs": {
"LogGroup": "/aws/vpn/site-to-site",
"LogStreams": [
"tunnel-1-logs",
"tunnel-2-logs"
],
"FilterPatterns": [
"[timestamp, tunnel_id=\"TUNNEL_1\", event_type=\"ERROR\"]",
"[timestamp, tunnel_id, event_type=\"BGP_SESSION_DOWN\"]"
]
}
}
トラブルシューティング手順
段階的診断アプローチ
- 物理接続確認
bash
# AWS CLI でVPN接続状態確認
aws ec2 describe-vpn-connections --vpn-connection-ids vpn-12345678
# トンネル詳細状態
aws ec2 describe-vpn-connections \
--vpn-connection-ids vpn-12345678 \
--query 'VpnConnections[0].VgwTelemetry'
- IPSecトンネル診断
! Cisco IOS診断コマンド
show crypto ikev2 sa
show crypto ipsec sa
show crypto engine connections active
! トンネル統計情報
show interface tunnel1
show ip route bgp
- BGPセッション確認
show ip bgp summary
show ip bgp neighbors 169.254.10.1 advertised-routes
show ip bgp neighbors 169.254.10.1 received-routes
高可用性設計
アクティブ/アクティブ構成
HSRP設定例
! Primary Router
interface GigabitEthernet0/0
ip address 192.168.1.1 255.255.255.0
standby 1 ip 192.168.1.10
standby 1 priority 150
standby 1 preempt
! Secondary Router
interface GigabitEthernet0/0
ip address 192.168.1.2 255.255.255.0
standby 1 ip 192.168.1.10
standby 1 priority 100
障害時の自動切り替え
BGPコンバージェンス最適化
router bgp 65000
bgp fast-external-fallover
bgp bestpath med missing-as-worst
neighbor 169.254.10.1 fall-over bfd
neighbor 169.254.10.1 timers 10 30
neighbor 169.254.10.5 fall-over bfd
neighbor 169.254.10.5 timers 10 30
セキュリティベストプラクティス
アクセス制御リスト (ACL)
VPNトラフィック制御
! VPNアクセス制御
ip access-list extended VPN-TRAFFIC-CONTROL
permit ip 192.168.0.0 0.0.255.255 10.0.0.0 0.0.255.255
permit ip 10.0.0.0 0.0.255.255 192.168.0.0 0.0.255.255
deny ip any any log
! インターフェース適用
interface Tunnel1
ip access-group VPN-TRAFFIC-CONTROL in
ip access-group VPN-TRAFFIC-CONTROL out
証明書ベース認証 (PKI)
証明書認証の実装
crypto pki trustpoint AWS-CA
enrollment url http://ca.example.com:80
subject-name cn=aws-vpn-gateway
revocation-check crl none
rsakeypair AWS-VPN-KEY
crypto ikev2 profile AWS-CERT-PROFILE
match identity remote fqdn aws-vpn-gateway.amazonaws.com
authentication remote rsa-sig
authentication local rsa-sig
pki trustpoint AWS-CA
まとめ
AWS Site-to-Site VPNのIPSec実装では、セキュリティ、パフォーマンス、可用性のバランスが重要です。
実装のポイント
- 適切な暗号化アルゴリズムの選択
- BGPによる動的ルーティングの活用
- 冗長性を考慮した設計
- 継続的な監視と最適化
これらの詳細設定により、企業レベルでのセキュアなハイブリッド接続を実現できます。