Forum Discussion
sniffer_375425
Jan 28, 2019Nimbostratus
Source IP and match http host
Hello everyone,
i am totally new in F5 and i have problems to create irule for my situation, i hope you can help me with it?
I need to configure my F5 for next case:
if http host contains ab...
Nicolas_Destor
Jan 28, 2019Cirrostratus
Hi,
There is no condition to check that the client IP is equal to "1.1.1.1" or "2.2.2.2" in your example.
You can try this code instead:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]]{
"abc.abc.com" {
if { [IP::addr [IP::remote_addr] eq "1.1.1.1/32"] } { pool test_pool }
}
"xxx.yyy.com" {
if { [IP::addr [IP::remote_addr] eq "2.2.2.2/32"] } { pool test_pool }
}
}
}
And to help for debugging iRule you can use "log local0. " command, that will send the trace into /var/log/ltm log file. More information here: [https://devcentral.f5.com/articles/the101-irules-101-logging-amp-comments]
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