プライベート・サブネット上のAutonomous DatabaseのDatabase Actionsに、パブリック・サブネットに構築された踏み台Compute経由で接続する際のメモ。
接続構成イメージ
[User PC]
│ HTTPS (port 443)
▼
[Bastion Host] (Public Subnet)
│ SSH Tunnel or Proxy
▼
[Autonomous Database] (Private Subnet)
手順
0. NW設定を確認
*Bastion 側(Public Subnet)Security List / NSG の設定
Type | Protocol | Port Range | Source CIDR | 説明 |
---|---|---|---|---|
Ingress | TCP | 22 | xxx.xxx.xxx.xxx/32 |
アクセス元のNWを許可 |
Egress | All | All | 0.0.0.0/0 |
*ADB 側(Private Subnet)Security List / NSG の設定
Type | Protocol | Port Range | Source CIDR | 説明 |
---|---|---|---|---|
Ingress | TCP | 443 |
<BastionのPrivate IP>/32 もしくはSubnet全体 |
BastionからのHTTPS通信を許可 |
Egress | All | All | 0.0.0.0/0 |
1. SSH動的フォワードを張る
書式
ssh -i <key> -D 1080 ubuntu@ <bastion-public-ip>
※必要に応じてユーザー名(ここではubuntu)を変更
例
ssh -i ~/.ssh/id_rsa -D 1080 ubuntu@138.2.XX.XX
2. ブラウザでDatabase Actionsに接続
ブラウザ上でプロキシ設定をする。
- SOCKS5 プロキシ: localhost:1080
「Autonomous Database」の詳細ページから「データベース・アクション」をクリックし、アクセスURLを確認します。
アクセスできました!
*上手くいかない時の疎通確認コマンド
nc -zv 10.0.1.XX 443 #Bastion に SSH ログインした状態で、ADB へのポート 443 が開いているか確認
netstat -ano | findstr 8443 #SSHトンネルが実際に開いているか確認