Forum Discussion
GTM Source IP Redirect to Specific Pools iRule
I'm trying to redirect clients to specific pools based on the clients IP address through an iRule. I created this iRule in the GTM and it seems to be working fine however, I'd like to set client networks in the rule instead of "starts_with" in an effort to keep this rule as short as we add more and more clients. I've tried "equals "10.80.0.0/16" however that didn't seem to work. Anyone have any ideas on what I could do to achieve my goal?
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
when DNS_REQUEST { if { [IP::client_addr] starts_with "10.80." } { pool pool_10_80 } elseif { [IP::client_addr] starts_with "10.96." } { pool pool_10_96 } elseif { [IP::client_addr] contains "172.27." } { pool pool_172_27 } }
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Thanks in advance for any feedback.
- Lee_SutcliffeNacreous
You can use
so that you may use a CIDR mask notation for the subnet:[IP::addr]
https://devcentral.f5.com/wiki/iRules.IP__addr.ashx
when DNS_REQUEST { if { [IP::addr[IP::client_addr]] equals "10.80.0.0/16" } { pool pool_10_80 } elseif { [IP::addr[IP::client_addr]] equals "10.96.0.0/16" } { pool pool_10_96 } elseif { [IP::addr[IP::client_addr]] equals "172.27.0.0/16" } { pool pool_172_27 } }
- Stanislas_Piro2Cumulonimbus
GTM never sees real client IP but LDNS IP.
if all internal users uses the same DNS server, the GTM will answer based on the DNS server IP.
Is there a way around this at all? I think this preventing the topology LB from working, from what im reading.
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