Forum Discussion
THE_KING_249060
Jun 27, 2016Nimbostratus
iRules how to make the http_request seeping ip
I want to filter IP traffic and depends ip redirect me to certain pages . believes this code does not work.
I hope and I can help will thank .
when HTTP_REQUEST {
if { [IP::client_addr] equals "192.168.1.1" && "192.168.2.1" && "192.168.2.1" && "192.168.9.1" && [HTTP::uri] ends_with "/"
}
{
pool Pool_App_Server
}
else
{
drop
}
}
another example
when HTTP_REQUEST { set var_ip [IP::client_addr]
if { ($var_ip equals "192.168.2.4" or $var_ip equals "192.168.2.32" or $var_ip equals "192.168.1.2" or $var_ip equals "192.168.1.2") and ([HTTP::path] contains "Lynk.IVR.Mate") } { pool Pool_App_Server } else { drop }
}
- Vijay_ECirrus
I would recommend creating a datagroup and name it as "CLASS_ALLOWED_IP" and this will contain the 4 IP addresses you have specified:
when HTTP_REQUEST { if { ([class match [IP::client_addr] eq CLASS_ALLOWED_IP]) and ([HTTP::uri] ends_with "/") } { pool Pool_App_Server } else { drop } }
- THE_KING_249060Nimbostratus
another example
when HTTP_REQUEST { set var_ip [IP::client_addr]
if { ($var_ip equals "192.168.2.4" or $var_ip equals "192.168.2.32" or $var_ip equals "192.168.1.2" or $var_ip equals "192.168.1.2") and ([HTTP::path] contains "Lynk.IVR.Mate") } { pool Pool_App_Server } else { drop }
}
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