F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

Tyson_James's avatar
Jan 10, 2018

URGENT: Need iRule to block non-US IP's and allow private addresses...

We have an urgent need to block non-US IP addresses but allow our internal private addresses. We are very new to iRules and have come up with the example below, but it is blocking out internal private addresses. Any assistance is appreciated.

 

when CLIENT_ACCEPTED { if {not ([whereis [IP::client_addr] country] eq "US") or not ([class match [IP::remote_addr] equals private_net]} } {reject} }