Forum Discussion
IP based irule
Hi, I am currently deploying LTM with Bluecoat cache servers in my customers network.
The ADC has two gateway routers connected and those routers have different NAT pools, so packets from outside network traverse one of the two according to the NAT IP addresses.
When a cache server requests OCS for the original contents as a client, the request needs to be classified and forwarded based upon NAT IPs in order not to make asymmetric traffic flows since the cache server is transparent to OCS and source IP address the cache server is using is the "original" client's IP.
I have implemented an irule as written below trying to classify requests to OCS as the NAT IPs, BUT IT DID NOT WORK.
when CLIENT_ACCEPTED {
if { [IP::addr [IP::remote_addr] equals X.X.X.0/25] || [IP::addr [IP::remote_addr] equals Y.Y.Y.0/25]} {
pool p_pe_01
}
elseif { [IP::addr [IP::remote_addr] equals X.X.X.128/25] || [IP::addr [IP::remote_addr] equals Y.Y.Y.128/25]} {
pool p_pe_02
}
else {
pool p_gw
}
}
Any CORRECTION or SUGGESTION would be appreciated!!!
Thanks in advance,
Dylan
1 Reply
- Michael_Jenkins
Cirrostratus
One thing that may be helpful to at least see what's happening in the iRule would be to add some logging. That will let you know what's actually going on. Is this an HTTP request, or something different (what port is being used)? If HTTP, you should set the pool in HTTP_REQUEST instead or CLIENT_ACCEPTED. Then you can check the ltm logs and see what's happening.
when CLIENT_ACCEPTED { log local0. "Client IP: [IP::remote_addr]" if { [IP::addr [IP::remote_addr] equals X.X.X.0/25] || [IP::addr [IP::remote_addr] equals Y.Y.Y.0/25]} { log local0. " Setting pool p_pe_01" pool p_pe_01 } elseif { [IP::addr [IP::remote_addr] equals X.X.X.128/25] || [IP::addr [IP::remote_addr] equals Y.Y.Y.128/25]} { log local0. " Setting pool p_pe_02" pool p_pe_02 } else { log local0. " Setting pool p_gw" pool p_gw } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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