Forum Discussion
ggarza_345867
Nimbostratus
Jul 19, 2018dns irule sytax error
Im getting syntax errors with this irule and having trouble finding where the error is..if you could help that would be great.. ! ! when DNS_REQUEST { if { [IP::addr [IP::client_addr]/24 equals 192.168.163.0] || [IP::addr
[IP::client_addr]/24 equals 192.168.165.0]} { if { [LB::status vs 192.168.163.39 ] eq "up" } { host 192.168.163.39 } } else { if { [LB::status vs 192.168.204.45 ] eq "up" } { host 192.168.204.45 } elseif { [LB::status vs 192.168.163.39 ] eq "up" } { host 192.168.163.39 } else { host 192.168.204.45 }
} }
- Lee_Sutcliffe
Nacreous
Hello,
It looks like you had an extra 'if' next to an else that wasn't needed. Please try this (I've not had chance to test it as I'm traveling and writing this from my phone)
when DNS_REQUEST { if {([IP::addr [IP::client_addr]/24 equals 192.168.163.0]) || ([IP::addr [IP::client_addr]/24 equals 192.168.165.0])} { if {[LB::status vs 192.168.163.39 ] eq "up" } { host 192.168.163.39 } elseif {[LB::status vs 192.168.204.45] eq "up" } { host 192.168.204.45 } elseif {[LB::status vs 192.168.163.39 ] eq "up" } { host 192.168.163.39 } else { host 192.168.204.45 } } }
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