Skip to content
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: NetFlow statistics
pcx_content_type: how-to
sidebar:
order: 3
head:
- tag: title
content: Magic WAN Connector NetFlow Analytics
---

import { Render } from "~/components";

<Render file="mconn/network-options/app-aware-policies/netflow" product="networking-services" />
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Network Analytics
title: Network analytics
pcx_content_type: how-to
sidebar:
order: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ pcx_content_type: navigation
title: Packet captures
external_link: /magic-firewall/packet-captures/
sidebar:
order: 4
order: 5

---
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pcx_content_type: configuration
title: Querying Magic WAN tunnel bandwidth analytics with GraphQL
sidebar:
order: 5
order: 6

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pcx_content_type: configuration
title: Querying Magic WAN tunnel health check results with GraphQL
sidebar:
order: 6
order: 7

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Traceroutes
pcx_content_type: how-to
sidebar:
order: 3
order: 4
---

import { Render } from "~/components";
Expand Down
13 changes: 13 additions & 0 deletions src/content/docs/magic-wan/analytics/netflow-analytics.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: NetFlow statistics
pcx_content_type: how-to
sidebar:
order: 3
head:
- tag: title
content: Magic WAN Connector NetFlow Analytics
---

import { Render } from "~/components";

<Render file="mconn/network-options/app-aware-policies/netflow" product="networking-services" />
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Network Analytics
title: Network analytics
pcx_content_type: how-to
sidebar:
order: 2
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/magic-wan/analytics/packet-captures.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ pcx_content_type: navigation
title: Packet captures
external_link: /magic-firewall/packet-captures/
sidebar:
order: 4
order: 5

---
2 changes: 1 addition & 1 deletion src/content/docs/magic-wan/analytics/query-bandwidth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pcx_content_type: configuration
title: Querying Magic WAN tunnel bandwidth analytics with GraphQL
sidebar:
order: 5
order: 6

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pcx_content_type: configuration
title: Querying Magic WAN tunnel health check results with GraphQL
sidebar:
order: 6
order: 7

---

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/magic-wan/analytics/traceroutes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Traceroutes
pcx_content_type: how-to
sidebar:
order: 3
order: 4
---

import { Render } from "~/components";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

---

import { Markdown } from "~/components";

{/*
Conditional rendering based on showSiteId prop:
- When showSiteId=true (NetFlow page): "To export NetFlow statistics, you will need your [account ID] and [API token], as well as the `site_id` associated with your Magic WAN Connector."
- When showSiteId=false/undefined (other pages): "You will need your [account ID] and [API token] to use the API."
The ternaries only render the differing prefix and suffix to avoid content duplication.
*/}
:::note
You will need your [account ID](/fundamentals/account/find-account-and-zone-ids/) and [API Key](/fundamentals/api/get-started/keys/#view-your-global-api-key) to use the API.
<Markdown text={`${props.showSiteId ? "To export NetFlow statistics, you" : "You"} will need your [account ID](/fundamentals/account/find-account-and-zone-ids/) and [API token](/fundamentals/api/get-started/account-owned-tokens/)${props.showSiteId ? ", as well as the \`site_id\` associated with your Magic WAN Connector" : " to use the API"}.`} />
:::
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,14 @@ To pin applications to a WAN port:
)
}


{props.magicWord === "breakout" && (
<>
<Render file="mconn/network-options/app-aware-policies/netflow" product="networking-services" />
</>
)
}

{ props.magicWord === "breakout" && (
<>
<AnchorHeading title="WARP traffic" depth={2} />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
{}
---

import { CURL, Render } from "~/components";

## NetFlow exports from Magic WAN Connector to Magic Network Monitoring

You can configure your Magic WAN Connector to export Netflow statistics for local breakout traffic to [Magic Network Monitoring](/magic-network-monitoring). This provides visibility into traffic that leaves your site directly, bypassing the Cloudflare network.

The Magic WAN Connector appliance uses NetFlow v9 to export flow data for breakout traffic only. You can enable and configure this export by setting the Netflow configuration for the associated site via the Cloudflare API.

### Enable NetFlow exports

<Render file="account-id-api-key" product="networking-services" params={{ showSiteId: true }} />

1. Send a `PUT` request to the Netflow configuration endpoint for your site.
2. In the JSON body request, you must include the `collector_ip` parameter. To export traffic statistics to Magic Network Monitoring, use the IP address `162.159.65.1`. This is the only field required to enable the feature.

Minimal configuration example:

<CURL
url="https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/magic/sites/$SITE_ID/netflow_config"
method="PUT"
json={{
"collector_ip": "162.159.65.1"
}}
/>

3. You can customize the configuration by adding optional fields to the JSON payload. These fields include:
- `collector_port`: The UDP port for the collector. The default is `2055`.
- `sampling_rate`: The rate at which packets are sampled.
- `active_timeout`: The timeout for active flows in seconds.
- `inactive_timeout`: The timeout for inactive flows in seconds.

Full configuration example:

<CURL
url="https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/magic/sites/$SITE_ID/netflow_config"
method="PUT"
json={{
"collector_ip": "162.159.65.1",
"collector_port": 2055,
"sampling_rate": 100,
"active_timeout": 60,
"inactive_timeout": 30
}}
/>

Your Magic WAN Connector will now begin exporting Netflow data for its breakout traffic, which will be ingested and visualized within your Magic Network Monitoring dashboard. You can retrieve the current settings by sending a `GET` request or disable the export by sending a `DELETE` request to the same endpoint.