Tunnelを使用してプライベートIPを設定する
Cloudflareのローカルトラフィック管理(LTM)ソリューションを設定する手順を考慮してください。Cloudflare Tunnelをオフランプとして使用して、プライベートまたは内部サービスに安全に接続します。
具体的な構成手順は、インフラストラクチャや接続したいサービスによって異なる場合があります。Cloudflare Tunnelに不慣れな場合は、各ステップにリンクされたページがさらにガイダンスを提供します。
- トンネルを作成する。
- トンネルをデプロイするして、データセンターに接続します。
- 仮想ネットワークを作成し、前のステップで構成したトンネルに割り当てます。
仮想ネットワークを作成するには:
- Zero Trustダッシュボード ↗に移動し、設定 > WARPクライアントに進み、仮想ネットワーク設定を見つけます。
- 新規追加または管理 > 仮想ネットワークを作成を選択して、仮想ネットワークを作成します。
- 仮想ネットワーク名を定義し、保存を選択します。
トンネルに仮想ネットワークを割り当てるには:
- ネットワーク > トンネルに移動します。
- 前のステップで作成したトンネルを選択し、構成を選択します。
- プライベートネットワークの下で、プライベートネットワークを追加を選択します。
- CIDRの下にIP範囲を指定し、追加設定の下で仮想ネットワークを選択します。
- プライベートネットワークを保存を選択します。
仮想ネットワークを作成するには:
cloudflared tunnel vnet add <VNET_NAME>トンネルに仮想ネットワークを割り当てるには:
cloudflared tunnel route ip add --vnet <VNET_NAME> <IP_RANGE> <TUNNEL_NAME>Cloudflareトンネルと関連付けられた仮想ネットワーク(VNet)が構成されたら、各エンドポイントを指定する際にVNetsを使用できます。プールを作成または編集するときに、これによりCloudflareロードバランサーが正しいトンネルを使用し、プライベートIPエンドポイントに安全に到達できるようになります。
具体的な構成は、使用ケースによって異なります。ワークフローを理解するために、以下の手順を参照してください。
- ニーズに応じたロードバランシングモニターを作成する。
- プライベートIPアドレスと対応する仮想ネットワークを指定してプールを作成する。
You can create a pool within the load balancer workflow or in the Pools section of the dashboard:
-
Go to Traffic > Load Balancing.
-
Select Manage Pools and then Create.
-
For your pool, enter the following information:
- A name (must be unique)
- A description to provide more detail on the name
- A choice for Endpoint Steering, which affects how your pool routes traffic to each endpoint
-
For each endpoint, enter the following information:
- A name (must be unique)
- The endpoint address or associated hostname
- (Optional) A Virtual Network. Required when the endpoint has a private IP address.
- A Weight
- (Optional) A hostname by clicking Add host header
-
Repeat this process for additional endpoints in the pool.
-
(Optional) Set up coordinates for Proximity Steering on the pool.
-
On the pool, update the following information:
- Health Threshold:
The Health Threshold is the number of healthy endpoints for the pool as a whole to be considered Healthy and receive traffic based on pool order in a load balancer. Increasing this number makes the pool more reliable, but also more likely to become unhealthy.
- Monitor: Attach a monitor
- Health Monitor Regions: Choose whether to check pool health from multiple locations, which increases accuracy but can lead to probe traffic to your endpoint
- Pool Notifications: You can set up new alerts - and view existing alerts - to be notified when pools are enabled or disabled, or pools or endpoints have changes in their health status.
- Health Threshold:
-
When finished, select Save.
現在の仮想ネットワークのリストを取得するには、仮想ネットワークのリスト API操作を使用します。
APIリクエストのオリジンにvirtual_network_idフィールドを追加して、仮想/プライベートIPサポートを有効にします。APIを使用してプールを作成する方法については、CloudflareロードバランサーAPIドキュメントを参照してください。
cURLを使用して、仮想IPオリジンを持つ既存のロードバランサープールを更新するための以下の例を考慮してください。
curl --request PATCH \https://api.cloudflare.com/client/v4/accounts/{account_id}/load_balancers/pools/{pool_id} \--header "Authorization: Bearer <API_TOKEN>" \--header "Content-Type: application/json" \--data '{ "origins": [ { "name": "origin-1", "address": "10.0.0.1", "enabled": true, "weight": 1, "virtual_network_id": "a5624d4e-044a-4ff0-b3e1-e2465353d4b4" } ]}'- ロードバランサーを作成する、前のステップで作成したプールとモニター、希望するグローバルトラフィックスティアリングポリシーおよびカスタムルールを指定します。