Skip to main content

IP Rules

IP-based rules allow for traffic routing based on the destination IP address or its geographic location (GeoIP).

CIDR

Classless Inter-Domain Routing (CIDR) rules match traffic against specific IP address ranges.

Reference: https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

Example

# Routes traffic to the 192.168.0.0/16 private network directly
IP-CIDR,192.168.0.0/16,DIRECT

# A bare IPv4 address is treated as /32
IP-CIDR,192.0.2.10,DIRECT

# Routes IPv6 traffic to the specified CIDR range
IP-CIDR6,2001:db8:abcd:8000::/50,DIRECT

# A bare IPv6 address is treated as /128
IP-CIDR6,2001:db8::1,DIRECT

Format

{type}, {route}, {target proxy}

Parameters

NameValueMandatoryNote
typeIP-CIDR
IP-CIDR6
trueIP-CIDR works on IPv4 traffic.
IP-CIDR6 works on IPv6 traffic.
route-trueFormat: {IP}/{mask}, where the mask is in CIDR prefix format.
A bare IP address without mask is also accepted and treated as /32 (IPv4) or /128 (IPv6).
target proxy-trueThe specified proxy or proxy group must exist in the profile.

GEOIP

Reference:

Example

GEOIP,US,REJECT

Format

GEOIP,{country},REJECT

Parameters

NameValueMandatoryNote
country-trueFormat: 2-letter ISO country code.
target proxy-trueThe specified proxy or proxy group must exist in the profile.