Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

優先トラフィック

最終更新 Markdown で表示Agent セットアップ

優先トラフィック(Prioritized traffic)では、Cloudflare One Appliance(旧称 Magic WAN Connector)が先に処理するアプリケーションを指定できます。リストにないアプリケーションは、優先トラフィックの後ろにキューイングされます。

ブレイクアウトトラフィックと同様に、優先トラフィックも DNS リクエストの検査で動作します。

アカウントにアプリケーションを追加する

Cloudflare One Appliance の優先トラフィックにアプリケーションを追加または削除する前に、設定したいアプリケーションのアカウントレベルのリストを作成します。現時点では、このリストの追加と変更は API の managed_app_id エンドポイントからのみ行えます。

アカウントにアプリケーションを追加するには、次の手順を実行します。

新しいアプリをアカウントに追加する POST リクエストを送信します。

Required API token permissions

At least one of the following token permissions is required:
  • Magic WAN Write
  • Magic Transit Write
Create a new Appbash
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/magic/apps" \
	--request POST \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
	--json '{
		"managed_app_id": "<APP_ID>",
		"name": "<APP_NAME>",
		"type": "<APP_TYPE>"
	}'
{
	"result": {
		"account_app_id": "eb09v665c0784618a3e4ba9809258fd4",
		"name": "<APP_NAME>",
		"type": "<APP_TYPE>",
	},
	"success": true,
	"errors": [],
	"messages": []
}

この新しいアプリを、Cloudflare One Appliance の優先トラフィックリストに追加できます。

Cloudflare One Appliance にアプリケーションを追加する

優先トラフィックのアプリケーションは、既存の各サイトに対して設定します。サイト単位の設定です。

  1. Cloudflare One ダッシュボード にログインし、Networks を開きます。

  2. Connectors > Appliances > Profiles を開きます。

  3. 設定する Cloudflare One Appliance を選び、Edit を選択します。

  4. Traffic Steering を選択します。

  5. Prioritized trafficCreate を選択します。

  6. リストから、Cloudflare のフィルタリングをバイパスするアプリケーションを 1 つ以上選びます。検索ボックスも使えます。

  7. Save を選択します。

選んだアプリケーションのトラフィックは、Connector が先に処理します。

  1. アカウントに関連付けられたアプリケーションを一覧する GET リクエスト を送信します。

    Required API token permissions

    At least one of the following token permissions is required:
    • Magic WAN Write
    • Magic WAN Read
    • Magic Transit Read
    • Magic 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" の値を控えます。

  2. 優先トラフィックポリシーに新しいアプリを追加する POST リクエストを送信します。

    Required API token permissions

    At least one of the following token permissions is required:
    • Magic WAN Write
    • Magic 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": []
    }

Cloudflare One Appliance からアプリケーションを削除する

  1. Cloudflare One ダッシュボード にログインし、Networks を開きます。

  2. Connectors > Appliances > Profiles を開きます。

  3. 設定する Appliance を選び、Edit を選択します。

  4. Traffic Steering を選択します。

  5. Prioritized traffic で削除するアプリケーションを探し、横の three dots を選んで Remove application traffic を選択します。

  6. (任意)アプリケーションが複数ページある場合は、検索ボックスで目的のアプリケーションをすばやく探せます。

優先トラフィックのアプリケーションは、既存の各サイトから削除します。サイト単位の設定です。

  1. サイトに関連付けられたアプリケーションを一覧する GET リクエスト を送信します。

    Required API token permissions

    At least one of the following token permissions is required:
    • Magic WAN Write
    • Magic WAN Read
    • Magic Transit Read
    • Magic 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" の値を控えます。

  2. 優先トラフィックポリシーからアプリケーションを削除する 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": []
    }

役に立ちましたか?