---
title: Block traffic from specific countries · Cloudflare Web Application Firewall (WAF) docs
description: This example blocks requests based on country code using the ip.src.country field.
lastUpdated: 2025-01-17T12:22:49.000Z
source_url:
  html: https://a74404c8.preview.developers.cloudflare.com/waf/custom-rules/use-cases/block-traffic-from-specific-countries/index.md
  md: https://a74404c8.preview.developers.cloudflare.com/waf/custom-rules/use-cases/block-traffic-from-specific-countries/
---

This example blocks requests based on country code using the [`ip.src.country`](https://developers.cloudflare.com/ruleset-engine/rules-language/fields/reference/ip.src.country/) field.

* **Expression**: `(ip.src.country in {"KN" "SY"})`
* **Action**: *Block*

## Other resources

* [Use case: Allow traffic from specific countries only](https://developers.cloudflare.com/waf/custom-rules/use-cases/allow-traffic-from-specific-countries/)
