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 abc.abc.com and if source ip are matched from data group list to forward on some pool but i need to use one iRule and one VS for more services:
example if http::host is abc.abc.com check source and if it is IP 1.1.1.1 redirect on pool test_pool
but i need more checks in same iRule:
if http::host is xxx.yyy.com check source and if it is IP 2.2.2.2 redirect on pool test_pool and so one.
I created something like this:
when HTTP_REQUEST {
if { [HTTP::host] contains "abc.abc.com" } then {
if { [class match [IP::remote_addr] equals test_user] } then {
pool test_pool }
} elseif { [HTTP::host] contains "xxx.yyy.com" } then {
if { [class match [IP::remote_addr] equals test_user] } then {
pool test_pool }
}
}
but it is not working, can you please help with some explanation how it can be done?
Thanks in advance.