Forum Discussion
alexm376_3470
Nimbostratus
Mar 07, 2012iRule Error
Hi all,
need urgent help,I have the iRule below ,but it gives me errors,please advice
line 1: [command is not valid in the current scope] [class subsite {
line 5: [command is not valid in the current scope] [class Hosts {
class Ports {
50
51
500
}
class Hosts {
host 217.65.39.4
}
when CLIENT_ACCEPTED {
if { not [matchclass [IP::client_addr] equals $::Hosts]}{
forward
}
elseif { [matchclass [[UDP::client_port] or [TCP::client_port]] equals $::Ports]}{
forward
}
elseif { [matchclass [IP::client_addr] equals $::Hosts]}{
pool INTERNET_013_014
}
}
2 Replies
- The "class" sections look more like a bigip.conf configuration component. The "when CLASS_ACCEPTED" section is the iRule though.
You'll want to create your classes either in the GUI, TMSH, or via iControl and then just include the when section in the iRule. Hello,
The following code is not supported in an irule :
class Ports { 50 51 500 } class Hosts { host 217.65.39.4 }You need to define 2 data-groups (Local Traffic >> Irules >> Datagroups)
Then, in your irule, you are using a deprecated command "matchclass". Use class match instead.
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