[Solved] Trying subnet whitelist but I got ERROR: ip addr is invalid:
Added by Koi8 almost 3 years ago
Hi I'm trying to only allow my IP range (subnet) to access entire website
This is setting I use :-
$HTTP["url"] =~ "^/" { $HTTP["remoteip"] == "81.252.0.0/14" { } else $HTTP["remoteip"] == "81.254.61.141" { } else $HTTP["remoteip"] != "" { # (dummy match everything) url.access-deny = ( "" ) } }
Replies (2)
RE: Trying subnet whitelist but I got ERROR: ip addr is invalid: - Added by gstrauss almost 3 years ago
A bit of redundancy in your attempt. Try this:
$HTTP["remoteip"] == "81.252.0.0/14" { } else $HTTP["remoteip"] == "81.254.61.141" { } else { url.access-deny = ( "" ) }
or the equivalent with the logic reversed
url.access-deny = ( "" ) # default: deny $HTTP["remoteip"] == "81.252.0.0/14" { url.access-deny = () # clear the deny list } else $HTTP["remoteip"] == "81.254.61.141" { url.access-deny = () # clear the deny list }
RE: Trying subnet whitelist but I got ERROR: ip addr is invalid: - Added by gstrauss almost 3 years ago
$HTTP["remoteip"] != ""
is invalid as an address.