Install the IP CIDR Matcher extension from Forge and publish it to your environment.No additional configuration is required.
This extension provides a server-side action to check whether a client IP address belongs to one or more CIDR ranges.
Basic steps:
Retrieve the client IP address in your application logic(e.g. from X-Forwarded-For request header or GetIP()).
X-Forwarded-For
GetIP()
Prepare a list of CIDR ranges or single IP addresses as text.
Call the IsIpInCidrs action with the IP and CIDR list.
IsIpInCidrs
Use the returned boolean value to apply your business logic.
Example CIDR list:
192.168.1.0/24; 10.0.0.0/8; 2001:db8::/32
This extension does not retrieve the client IP automatically.The IP address must be provided by the application logic.
Both IPv4 and IPv6 addresses are supported.
When using X-Forwarded-For, ensure that your environment uses trusted proxies.