Forum Discussion
Ricky_Encila_17
Nimbostratus
Jan 18, 2016Restricting Traffic to IP Address and HTTP HOST
Datagroup:
10.10.10.10, sample.com
10.10.10.10, foobar.com
10.10.10.11, foobar.com
Is there any suggestion how can I parse the datagroup in such a way that a specific IP Address ...
Ricky_Encila_17
Nimbostratus
Jan 18, 2016Below is my existing iRule script:
when HTTP_REQUEST {
set baseURL [string tolower [getfield [HTTP::host] ":" 1]]
set sourceIP [IP::client_addr]
if { ( not [class match -value $sourceIP eq MyDataGroup] ) eq "$baseURL" } {
HTTP::respond 405 content "405 - Access To Page Is Not Allowed\The requested page $proto://$baseURL:$basePort[HTTP::uri] is currently not Allowed by your Administrator.
Please reach out to Helpdesk if you need further assistance." log local0. "Source IP [IP::client_addr] is currently BLOCKED for Accessing [HTTP::uri]" event disable all } else { log local0. "Source IP [IP::client_addr] was Allowed to Access $baseURL[HTTP::uri]" } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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