PG0581
Nov 05, 2020Cirrus
iRule to load balance FDQNs
I'm wondering if it's possible to have an iRule load balance (round-robin) between FQDNs. Here's the idea:
You would have a virtual server with no pool and use an iRule to redirect to a couple FQDNs:
ltm virtual abcd {
destination x.x.x.x:https
ip-protocol tcp
mask 255.255.255.255
persist {
source_addr {
default yes
}
}
rules {
forward-fqdn
}
source 0.0.0.0/0
translate-address enabled
translate-port enabled
vs-index xxx
}
And the iRule could look something like this; would need to iron out the exact syntax - but I'm not sure if/how you could have the iRule round robin between the FQDNs?
ltm rule forward-fqdn {
when HTTP_REQUEST {
HTTP::redirect "https://www.abc.com"
HTTP::redirect "https://www.def.com"
}