Forum Discussion
Mariusz_B
Nimbostratus
Feb 17, 2015iRule - wrong variable definition ?
Hi all,
I have the following iRule, which in terms of syntax is fine:
when DNS_REQUEST {
switch [IP::remote_addr] {
"10.10.1.32/27" -
"10.10.1.64/27" -
"10.10.1.16...
Brad_Parker
Cirrus
Feb 17, 2015You should also set a "default" for your switch which set your variable to "down" or something else other wise you will get TCL error when the remote IP doesn't match one of the networks you define in your switch.
when DNS_REQUEST {
switch [IP::remote_addr] {
"10.10.1.32/27" -
"10.10.1.64/27" -
"10.10.1.160/27" -
"10.10.1.192/27" {
set status_vs [LB::status vs Client_Monitor_VIP]
}
default {
set status_vs "down"
}
}
if {$status_vs equals "up"} {
host 1.1.1.1
} else {
host 2.2.2.2
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
