Forum Discussion
Arie
Nov 04, 2011Altostratus
IP::client_addr / netmask addresses in Class (Data Group) - syntax problem
I have a class that contains a list of IP addresses with a netmask (/x). Initially I tried:
if { !( [ class match [IP::client_addr] equals class_CampusIPaddresses ] ) } {
...
nitass
Nov 05, 2011Employee
this is mine.
[root@iris:Active] config b class test list
class test {
{
host 1.1.1.1
network 2.2.2.0/24
}
}
[root@iris:Active] config b rule myrule list
rule myrule {
when RULE_INIT {
log local0. "\[class match -- 1.1.1.1 equals test\]: [class match -- 1.1.1.1 equals test]"
log local0. "\[class match -- 2.2.2.2 equals test\]: [class match -- 2.2.2.2 equals test]"
log local0. "\[class match -- 3.3.3.3 equals test\]: [class match -- 3.3.3.3 equals test]" if {![class match -- 1.1.1.1 equals test]} {
log local0. "!\[class match -- 1.1.1.1 equals test\]: 1"
} else {
log local0. "!\[class match -- 1.1.1.1 equals test\]: 0"
} if {![class match -- 2.2.2.2 equals test]} {
log local0. "!\[class match -- 2.2.2.2 equals test\]: 1"
} else {
log local0. "!\[class match -- 2.2.2.2 equals test\]: 0"
} if {![class match -- 3.3.3.3 equals test]} {
log local0. "!\[class match -- 3.3.3.3 equals test\]: 1"
} else {
log local0. "!\[class match -- 3.3.3.3 equals test\]: 0"
}
}
}
[root@iris:Active] config cat /var/log/ltm
Nov 5 08:58:43 local/iris err mcpd[32723]: 01020066:3: The requested rule (myrule) already exists in partition Common.
Nov 5 08:58:43 local/tmm info tmm[1609]: Rule myrule : [class match -- 1.1.1.1 equals test]: 1
Nov 5 08:58:43 local/tmm info tmm[1609]: Rule myrule : [class match -- 2.2.2.2 equals test]: 1
Nov 5 08:58:43 local/tmm info tmm[1609]: Rule myrule : [class match -- 3.3.3.3 equals test]: 0
Nov 5 08:58:43 local/tmm info tmm[1609]: Rule myrule : ![class match -- 1.1.1.1 equals test]: 0
Nov 5 08:58:43 local/tmm info tmm[1609]: Rule myrule : ![class match -- 2.2.2.2 equals test]: 0
Nov 5 08:58:43 local/tmm info tmm[1609]: Rule myrule : ![class match -- 3.3.3.3 equals test]: 1
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