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

# Routes IPv6 traffic to the specified CIDR range (currently ignored by Surfboard)
IP-CIDR6,2001:db8:abcd:8000::/50,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.
target proxy-trueThe specified proxy or proxy group must exist in the profile.
caution

IPv6 is currently not supported by Surfboard; IP-CIDR6 rules will be ignored.

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.