Forum Discussion
Tyson_James
Cirrus
Mar 15, 2018iRule to only allow traffic from US, Canada and private networks....
We have a current iRule that only accepts traffic from the US or private networks ( non-routable ). Shown below :
when CLIENT_ACCEPTED {
if {not ([whereis [IP::client_addr] country] eq "US") and ...
Lee_Sutcliffe
Nacreous
Mar 15, 2018Canada has a country code of 'CA' (see https://www.iso.org/obp/ui/search ) you could add another 'and' like the one for 'US' It might however be easier to maintain if you create a datagroup with the country codes, much like you've done with the IP addresses
for example:
when CLIENT_ACCEPTED {
if {!([class match [whereis [IP::client_addr] country] equals "country_dg"]) && !([class match [IP::client_addr] equals "private_net"])}{
reject
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects