優先トラフィック(Prioritized traffic)では、Cloudflare One Appliance(旧 Magic WAN Connector)が先に処理するアプリケーションを指定できます。リストにないアプリケーションは、優先トラフィックの後ろにキューイングされます。
ブレイクアウトトラフィックと同様に、優先トラフィックも DNS リクエストの検査で動作します。
Cloudflare One Appliance の優先トラフィックにアプリケーションを追加または削除する前に、設定したいアプリケーションのアカウントレベルのリストが必要です。このリストには、次の 2 種類のアプリケーションがあります。
- Cloudflare-managed applications — Cloudflare があらかじめ認識しているアプリケーションのカタログです。アカウントにすでに存在し、作成する必要はありません。アプリケーショントラフィックを割り当てるときに直接選びます。
- Custom applications — hostname、IP subnet、source subnet のいずれか(または組み合わせ)で定義するアプリケーションです。ダッシュボード、または Create an account app エンドポイントから、カスタムアプリケーションの作成、編集、削除ができます。
- Connectors ページを開きます。
- Appliances タブ > Profiles を開きます。
- 設定する Cloudflare One Appliance を選び、Edit を選択します。
- Traffic Steering を選択します。
- Prioritized traffic で Assign application traffic を選択します。
- Custom applications で Add を選び、新しいカスタムアプリケーションを作成して、次を入力します。
- Name — アプリケーションの表示名です。
- Category — 任意のグループラベルです。例:
Productivity、Video conferencing。 - Hostnames、IP subnets、Source subnets のうち少なくとも 1 つ — このアプリケーションを識別するトラフィックです。ホスト名は有効な FQDN である必要があります(例:
auth.example.com)。IP サブネットとソースサブネットは、有効な IPv4 CIDR である必要があります(例:10.0.0.0/24)。単一アドレスには/32サフィックスが必要です。IPv6 はまだ未対応です。
- Add application を選択します。
- 既存のカスタムアプリケーションを変更または削除するには、Custom applications テーブルで対象の横の 三点リーダー を選び、Edit または Delete を選択します。
アカウントにカスタムアプリケーションを作成する POST リクエストを送信します。次の例では、任意の照合条件を 3 つとも使っています。
Required API token permissions
At least one of the following token permissions is required:Magic WAN WriteMagic Transit Write
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/magic/apps" \
--request POST \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--json '{
"name": "Example application",
"type": "Productivity",
"hostnames": [
"auth.example.com"
],
"ip_subnets": [
"192.0.2.0/24"
],
"source_subnets": [
"10.0.0.0/24"
]
}'{
"result": {
"account_app_id": "eb09v665c0784618a3e4ba9809258fd4",
"name": "Example application",
"type": "Productivity",
"hostnames": ["auth.example.com"],
"ip_subnets": ["192.0.2.0/24"],
"source_subnets": ["10.0.0.0/24"]
},
"success": true,
"errors": [],
"messages": []
}この新しいアプリを、Cloudflare One Appliance の優先トラフィックリストに追加できます。
優先トラフィックのアプリケーションは、既存の各サイトに対して設定します。サイト単位の設定です。
- Connectors ページを開きます。
-
Appliances タブ > Profiles を開きます。
-
設定する Cloudflare One Appliance を選び、Edit を選択します。
-
Traffic Steering を選択します。
-
Prioritized traffic で Assign application traffic を選択します。
-
Custom applications または Cloudflare-managed applications から、先に処理するアプリケーションを 1 つ以上選びます。検索ボックスも使えます。このパネルを離れずに新しいカスタムアプリケーションを定義するには Add を選びます。手順は カスタムアプリケーションを作成、編集、削除する を参照してください。
-
Save を選択します。
選んだアプリケーションのトラフィックは、Connector が先に処理します。
-
アカウントに関連付けられたアプリケーションを一覧する
GETリクエスト を送信します。
At least one of the following token permissions is required:Required API token permissions
Magic WAN WriteMagic WAN ReadMagic Transit ReadMagic Transit Write
List Appsbash curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/magic/apps" \ --request GET \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"{ "result": [ { "managed_app_id": "<APP_ID>", "name": "<APP_NAME>", "type": "File Sharing", "hostnames": [ "<app_name.com>", "<app-name.info>" ] } ] }追加したいアプリケーションの
"managed_app_id"の値を控えます。 -
優先トラフィックポリシーに新しいアプリを追加する
POSTリクエストを送信します。
At least one of the following token permissions is required:Required API token permissions
Magic WAN WriteMagic Transit Write
Create a new App Configbash curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/magic/sites/$SITE_ID/app_configs" \ --request POST \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ --json '{ "managed_app_id": "<MANAGED_APP_ID>", "breakout": true }'{ "result": { "account_app_id": "<APP_ID>", "name": "<APP_NAME>", "type": "<BREAKOUT_OR_PRIORITY>" }, "success": true, "errors": [], "messages": [] }
Source subnets で定義したカスタムアプリケーションも、同じ方法で優先指定できます。ソースベースの照合条件の全体は ソースによるブレイクアウト を参照してください。
- Connectors ページを開きます。
-
Appliances タブ > Profiles を開きます。
-
設定する Appliance を選び、Edit を選択します。
-
Traffic Steering を選択します。
-
Prioritized traffic で削除するアプリケーションを探し、横の 三点リーダー を選んで Remove application traffic を選択します。
-
(任意)アプリケーションが複数ページある場合は、検索ボックスで目的のアプリケーションをすばやく探せます。
優先トラフィックのアプリケーションは、既存の各サイトから削除します。サイト単位の設定です。
-
サイトに関連付けられたアプリケーションを一覧する
GETリクエスト を送信します。
At least one of the following token permissions is required:Required API token permissions
Magic WAN WriteMagic WAN ReadMagic Transit ReadMagic Transit Write
List App Configsbash curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/magic/sites/$SITE_ID/app_configs" \ --request GET \ --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"{ "result": [ { "id": "<APP_ID>", "site_id": "<SITE_ID>", "managed_app_id": "<APP_NAME>", "breakout": true } ] }削除するアプリケーションの
"id"の値を控えます。 -
優先トラフィックポリシーからアプリケーションを削除する
DELETEリクエストを送信します。curl "https://api.cloudflare.com/client/v4/accounts/%7Baccount_id%7D/magic/sites/%7Bsite_id%7D/app_configs/%7Bid%7D" \ --request DELETE{ "result": { "id": "<APP_ID>", "site_id": "<SITE_ID>", "managed_app_id": "<APP_NAME>", "breakout": true }, "success": true, "errors": [], "messages": [] }