Create an IP access rule
- 
Log in to the Cloudflare dashboard ↗, and select your account and domain.
 - 
Go to Security > WAF > Tools.
 - 
Under IP Access Rules, enter the following details:
- For Value, enter an IP address, IP range, country code/name, or Autonomous System Number (ASN). For details, refer to Parameters.
 - Select an action.
 - For Zone, select whether the rule applies to the current website only or to all websites in the account.
 - (Optional) Enter a note for the rule (for example, 
Payment Gateway). 
 - 
Select Add.
 
- 
Log in to the Cloudflare dashboard ↗, and select your account and domain.
 - 
Go to Security > Security rules.
 - 
Select Create rule > IP access rules.
 - 
Enter the following rule details:
- For IP, IP range, country name, or ASN, enter an IP address, IP range, country code/name, or Autonomous System Number (ASN). For details, refer to Parameters.
 - For Action, select an action.
 - For Zone, select whether the rule applies to the current website only or to all websites in the account.
 - (Optional) Enter a note for the rule (for example, 
Payment Gateway). 
 - 
Select Create.
 
Use the Cloudflare API to programmatically create IP access rules. For more information, refer to Create an IP Access Rule.
Was this helpful?
- Resources
 - API
 - New to Cloudflare?
 - Directory
 - Sponsorships
 - Open Source
 
- Support
 - Help Center
 - System Status
 - Compliance
 - GDPR
 
- Company
 - cloudflare.com
 - Our team
 - Careers
 
- © 2025 Cloudflare, Inc.
 - Privacy Policy
 - Terms of Use
 - Report Security Issues
 - Trademark