Forum Discussion
ggarza_345867
Nimbostratus
Jul 20, 2018iRule is giving bracket errors but cant find it were.
iRule is giving bracket errors but cant find it were.
!
when DNS_REQUEST {
switch [IP::remote_addr] {
"192.168.163.0/24 “ {
if { [LB::status vs 192.168.163.39] eq "up" } {
...
Samir_Jha_52506
Noctilucent
Jul 20, 2018Written iRule with help of if & elseif condition. Please check & let us know if any confusion.
when DNS_REQUEST {
if { [IP::addr [IP::remote_addr] equals 192.168.163.0 mask 255.255.255.0]} {
if {[LB::status vs 192.168.163.39 ] eq "up" } {
host 192.168.163.39 }
else {
host 192.168.204.45 }
elseif { [IP::addr [IP::remote_addr] equals 192.168.165.0 mask 255.255.255.0]} {
if {[LB::status vs 192.168.163.39] eq "up" } {
host 192.168.163.39 }
else {
host 192.168.204.45 }
elseif { [IP::addr [IP::remote_addr] equals 192.168.204.0 mask 255.255.255.0]} {
if { [LB::status vs 192.168.204.45] eq "up" } {
host 192.168.204.45 }
else {
host 192.168.163.39 }
}
}
}
hope it will help
ggarza_345867
Nimbostratus
Jul 24, 2018Nope..still failing the iRule editor. I was getting some closed bracket errors, I added couple more at end to clear up. But now getting "invalid list element in quotes followed by "up" instead of space
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