コンテンツにスキップ

始める

Spectrumはすべての有料プランで利用可能です。ProおよびBusinessプランは選択されたプロトコルのみをサポートし、EnterpriseプランはすべてのTCPおよびUDPベースのトラフィックをサポートします。詳細な設定オプションについては、設定オプションを参照してください。

Spectrumアプリケーションを作成するには、IPアドレス、CNAMEレコード、またはロードバランサーを使用できます。使用する方法に関係なく、ダッシュボードまたはAPIを介してアプリケーションを作成できます。

IPアドレスを使用してSpectrumアプリケーションを作成する

IPアドレスを使用してSpectrumアプリケーションを作成するには、Cloudflareは通常、CloudflareのIPプールからアプリケーションに任意のIPを割り当てます。独自のIPアドレスを使用したい場合は、BYOIPを使用するか、Static IPを使用できます。この2つのケースでは、これらの機能はダッシュボードでは利用できないため、APIを介してSpectrumアプリケーションを作成する必要があります。APIを使用する場合、フィールドorigin_directにはIPアドレスを入力します。

ダッシュボードを介してアプリケーションを追加する

  1. Cloudflareダッシュボードにログインします。
  2. Spectrumを選択します。
  3. アプリケーションを作成を選択します。これが初めてSpectrumを使用する場合、アプリケーションを作成モーダルが表示されます。
  4. アプリケーションタイプを選択します。
  5. ドメインの下に、Spectrumを使用するドメインを入力します。
  6. エッジポートの下に、Cloudflareがアプリケーションに使用するポートを入力します。
  7. オリジンの下に、アプリケーションのオリジンIPとポートを入力します。
  8. アプリケーションがクライアントIPを必要とし、Proxy Protocolをサポートしている場合は、Proxy Protocolsを有効にします。Proxy Protocolは、CloudflareのようなプロキシがクライアントIPをオリジンアプリケーションに送信するための方法です。
  9. 追加を選択します。

APIを介してアプリケーションを追加する

以下はcurlの例と、APIに送信される関連データです。

APIの例:

Terminal window
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/spectrum/apps" \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{"protocol":"tcp/22","dns":{"type":"CNAME","name":"ssh.example.com"},"origin_direct":["tcp://192.0.2.1:22"],"proxy_protocol":"off","ip_firewall":true,"tls":"full","edge_ips":{"type":"dynamic","connectivity":"all"},"traffic_type":"direct","argo_smart_routing":true}'

データの例:

{
"success": true,
"errors": [],
"messages": [],
"result": {
"id": "ea95132c15732412d22c1476fa83f27a",
"protocol": "tcp/22",
"dns": {
"type": "CNAME",
"name": "ssh.example.com"
},
"origin_direct": [
"tcp://192.0.2.1:22"
],
"proxy_protocol": "off",
"ip_firewall": true,
"tls": "full",
"edge_ips": {
"type": "dynamic",
"connectivity": "all"
},
"traffic_type": "direct",
"argo_smart_routing": true,
"created_on": "2014-01-02T02:20:00Z",
"modified_on": "2014-01-02T02:20:00Z"
}
}

CNAMEレコードを使用してSpectrumアプリケーションを作成する

CNAMEレコードを使用してSpectrumアプリケーションを作成するには、オリジンのホスト名を指す CNAMEレコードをCloudflareホストゾーンに作成する必要があります。これは、ホスト名のオリジンを解決するために必要です。詳細については、DNSレコードの作成を参照してください。CNAMEをオリジンとして使用する場合、Cloudflareはそのゾーンに対して権威を持っている必要があります。APIを使用する場合、origin_dnsフィールドにはCNAMEレコードを入力します。

ダッシュボードを介してアプリケーションを追加する

  1. Cloudflareダッシュボードにログインします。
  2. Spectrumを選択します。
  3. アプリケーションを作成を選択します。これが初めてSpectrumを使用する場合、アプリケーションを作成モーダルが表示されます。
  4. アプリケーションタイプを選択します。
  5. ドメインの下に、Spectrumを使用するドメインを入力します。
  6. エッジポートの下に、Cloudflareがアプリケーションに使用するポートを入力します。
  7. オリジンの下に、CNAMEレコード名を入力します。
  8. 追加を選択します。

APIを介してアプリケーションを追加する

以下はcurlの例と、APIに送信される関連データです。

APIの例:

Terminal window
curl 'https://api.cloudflare.com/client/v4/zones/{zone_id}/spectrum/apps' \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{"dns":{"type":"CNAME","name":"spectrum-cname.example.com"},"ip_firewall":false,"protocol":"tcp/22","proxy_protocol":"off","tls":"off","origin_dns": {"name": "cname-to-origin.example.com", "ttl": 1200}, "origin_port": 22}'

データの例:

{
"dns": {
"type": "CNAME",
"name": "spectrum-cname.example.com"
},
"ip_firewall": false,
"protocol": "tcp/22",
"proxy_protocol": "off",
"tls": "off",
"origin_dns": {
"name": "cname-to-origin.example.com",
"ttl": 1200
},
"origin_port": 22
}

ロードバランサーを使用してSpectrumアプリケーションを作成する

ロードバランサーを使用してSpectrumアプリケーションを作成するには、ダッシュボードまたはAPIを介してロードバランサーを生成する必要があります。詳細については、ロードバランシングのドキュメントを参照してください。

SpectrumアプリケーションのDNS解決に問題が発生しないように、現在のロードバランシングホスト名と同じSpectrumホスト名を使用しないでください。

ダッシュボードを介してアプリケーションを追加する

  1. Log in to the Cloudflare dashboard.
  2. Select Spectrum.
  3. Select Create an Application. If this is your first time using Spectrum, the Create an Application modal appears.
  4. Select your Application Type.
  5. Under Domain, enter the domain that will use Spectrum.
  6. Under Edge Port, enter the port Cloudflare should use for your application.
  7. Under Origin, select Load Balancer.
  8. Select the load balancer you want to use from the dropdown. Disabled load balancers will not show on the Load Balancer menu.
  9. Select Add.

APIを介してアプリケーションを追加する

Below is a curl example and the associated data being posted to the API.

API example:

Terminal window
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/spectrum/apps" \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{"dns":{"type":"CNAME","name":"spectrum-cname.example.com"},"ip_firewall":false,"protocol":"tcp/22","proxy_protocol":"off","tls":"off","origin_dns": {"name": "cname-to-origin.example.com", "ttl": 1200}, "origin_port": 22}'

Example data:

{
"dns": {
"type": "CNAME",
"name": "spectrum-cname.example.com"
},
"ip_firewall": false,
"protocol": "tcp/22",
"proxy_protocol": "off",
"tls": "off",
"origin_dns": {
"name": "cname-to-origin.example.com",
"ttl": 1200
},
"origin_port": 22
}

トラフィックを表示する

追加の設定なしで、Cloudflareを介してトラフィックをプロキシできます。Cloudflareを介してトラフィックを実行すると、ダッシュボードにSpectrumからの最後の1分間のトラフィックが表示されます。

フィードバックがある場合は、お知らせください