Forum Discussion
david_20522
Nimbostratus
Jun 03, 2009class command please explain??
The wiki definition states:
The new class command, implemented in v10.0.0, allows for the use of extended functionality built into external data groups. These commands work for both internal and external (file-based) data groups, but internal data groups will have empty values.
So does this mean it will work with internal classes or not as "internal data groups will have empty value" would imply that no data is recoverable using these methods and as such not useable.
- Colin_Walker_12Historic F5 AccountI'll go check the wiki page and update it if necessary, but the brief explanation is:
- hoolio
Cirrostratus
Hi Colin, - spark_86682Historic F5 AccountI think there could be a misunderstanding here. "Internal classes" refers to classes that are pre-defined on the BIG-IP, such as the class of private IP addresses. These classes do not have values, just keys ("names"). So you should be able to use the class command normally with them.
- hoolio
Cirrostratus
I tried testing this before, but didn't get anything back for the value using -value. If this should work for standard (non-external) classes, I'm not sure I'm configuring the class correctly. I've tried a few ways:class name_value_class { { "\"name1\" := \"value1\"" "\"name2\" := \"value2\"" "\"name3\" := \"value3\"" "name4 := value4" "\"name5 := value5\"" } }
when RULE_INIT { for {set i 0} {$i < [class size name_value_class]} {incr i} { log local0. "[class element -name $i name_value_class] -> [class element -value $i name_value_class]" } }
- spark_86682Historic F5 AccountI've looked into this a bit more, and discovered that while this was not able to be implemented for the 10.0 timeframe, you should expect the ability to use key/value pairs in internal classes in an upcoming release.
- hoolio
Cirrostratus
Hi Spark, - spark_86682Historic F5 AccountI hadn't see this yesterday, but grabbed it today. Info should be forthcoming.
- hoolio
Cirrostratus
Thanks Spark. I received an update today. It looks like it will possibly be supported in 10.1 (?). - Romani_2788Historic F5 AccountHi Guys,
- hoolio
Cirrostratus
For all current versions, you can create an address type datagroup in the GUI under Local Traffic >> iRules >> Datagroup List tab >> Create. Select a type of 'Address' and enter the host and/or networks you want.class private_net { { host 1.1.1.1 { "test1" } network 2.2.2.0/24 { "test2" } network 10.0.0.0/8 network 172.16.0.0/12 network 192.168.0.0/16 } }
when RULE_INIT { log local0. "\[class match 2.2.2.2 equals private_net\]: [class match 2.2.2.2 equals private_net]" log local0. "\[class search -value private_net equals 2.2.2.2\]: [class search -value private_net equals 2.2.2.2]" log local0. "\[class search -value private_net equals 2.2.2.2/24\]: [class search -value private_net equals 2.2.2.2/24]" }
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