Forum Discussion
GTM iRule To Load Balance DNS Resolution
I am an iRule newbie who inherited the administration of a GTM. I have an application request which requires the GTM to load balance the DNS resolution of a URL between (2) web servers based on the clients ip address 3rd octet. If the third octet is < 128, it would resolve to the address of web server A and if it is > 128 it would resolve to the address of web server B.
I have never written an iRule so I am a bit lost here. I have looked at the pdf's but keep hitting a brick wall when it comes to how to check for the 3rd octet.
Anyone here willing to help me with this? I am running GTM software version 10.1.0 on a LTM1600.
Thanks in advance.
Jaime
- hoolioCirrostratusHi Jaime,
- dlg_23340Cirrusjaimes, that's a pretty strange load balancing method, but you can get the third octet of a client's LDNS with getfield. Something like this would do what you want:
when DNS_REQUEST { if { [getfield [IP::client_addr] "." 3] < 128 } { pool poolA } else { pool poolB } }
- jaimes_39948NimbostratusThanks for the reply. Actually the third octet match would be more of a selective match like 3rd octet = 25, 30, etc...
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