Skip to content

Commit

Permalink
[Gateway] Replace API examples (#18966)
Browse files Browse the repository at this point in the history
Co-authored-by: Pedro Sousa <[email protected]>
  • Loading branch information
maxvp and pedrosousa authored Dec 31, 2024
1 parent 4338483 commit f1f460f
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 214 deletions.
4 changes: 4 additions & 0 deletions public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,10 @@
/cloudflare-one/analytics/gateway/ /cloudflare-one/insights/analytics/gateway/ 301
/cloudflare-one/analytics/users/ /cloudflare-one/insights/logs/users/ 301
/cloudflare-one/api-terraform/access-api-examples/azure-group/ /cloudflare-one/api-terraform/access-api-examples/entra-group/ 301
/cloudflare-one/api-terraform/gateway-api-examples/ /cloudflare-one/policies/gateway/ 301
/cloudflare-one/api-terraform/gateway-api-examples/dns-policy/ /cloudflare-one/policies/gateway/dns-policies/common-policies/ 301
/cloudflare-one/api-terraform/gateway-api-examples/network-policy/ /cloudflare-one/policies/gateway/network-policies/common-policies/ 301
/cloudflare-one/api-terraform/gateway-api-examples/http-policy/ /cloudflare-one/policies/gateway/http-policies/common-policies/ 301
/cloudflare-one/applications/non-http/arbitrary-tcp/ /cloudflare-one/applications/non-http/cloudflared-authentication/arbitrary-tcp/ 301
/cloudflare-one/connections/connect-apps/configuration/ /cloudflare-one/connections/connect-networks/configure-tunnels/ 301
/cloudflare-one/connections/connect-apps/install-and-setup/setup/ /cloudflare-one/connections/connect-networks/get-started/ 301
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,50 @@ curl https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/rule \
```

</TabItem> </Tabs>

## Override IP address

Override traffic directed toward a specific IP address with a different IP address.

<Tabs syncKey="dashPlusAPI"> <TabItem label="Dashboard">

| Selector | Operator | Value | Logic | Action |
| ---------------- | -------- | -------------- | ----- | ---------------- |
| Destination IP | in | `203.0.113.17` | And | Network Override |
| Destination Port | is | `80` | | |

| Override IP | Override Port |
| ----------- | ------------- |
| `1.1.1.1` | `80` |

</TabItem>

<TabItem label="API">

```bash
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/rule \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <API_TOKEN>" \
--data '{
"name": "Override example.com with 1.1.1.1",
"description": "Override a site'\''s IP address with another IP",
"enabled": true,
"action": "l4_override",
"filters": [
"l4"
],
"traffic": "net.dst.ip in {203.0.113.17} and net.dst.port == 80",
"identity": "",
"device_posture": "",
"rule_settings": {
"l4override": {
"ip": "1.1.1.1",
"port": 80
},
"override_host": "",
"override_ips": null
}
}'
```

</TabItem> </Tabs>

0 comments on commit f1f460f

Please sign in to comment.