Forum Discussion
Ten_92952
Apr 29, 2011Nimbostratus
irule question
Would someone be able to tell my why the syntax for this irule is acceptable to the BigIp
when RULE_INIT {
Purpose:
This rule allows the ace servers access to the acme web
site servers
}
when CLIENT_ACCEPTED {
if { [matchclass [IP::client_addr] equals $::ace_servers] }{
} else {
discard
}
}
but this syntax
when RULE_INIT {
Purpose:
This rule allows the ace servers access to the acme web
site servers
}
when CLIENT_ACCEPTED {
if { [matchclass [IP::client_addr] equals $::ace_servers]}
else {
discard
}
}
gives the following error?
01070151:3: Rule [server_access] error: line 10: [undefined procedure: else] [else] line 10: [deprecated usage, use else or elseif] [ ]
thanks
3 Replies
Sort By
- Short answer is because the first is syntactically correct, but the second isn't... It's missing the block of something to do.
- Also, for v9.4.4 or higher, you should remove the $:: prefix from the datagroup name. And in 10.0+ you should change matchclass to class match:
the block
if { [matchclass [IP::client_addr] equals $::ace_servers]} else { discard }
should be
if { [matchclass [IP::client_addr] equals $::ace_servers]} { } else { discard }
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