Forum Discussion
Eric_Stuhl_2806
Nimbostratus
Apr 13, 2006Question about creating iRules
Hello,
I aplogize if this topic has been covered in the past, but I did a cursory search of the forum and couldn't find something to help me find an answer.
In my environment...
Colin_Walker_12
Apr 13, 2006Historic F5 Account
Well, the first thing I'd not is that you're missing an ending bracket on both of your matchclass lines.
Assuming your classes are set up properly to match the IP info, the rule would read:
when CLIENT_ACCEPTED {
set ckname NETWORK_ALIAS
if { [matchclass $::Alias_Subnet contains [IP::client_addr] ] } {
set ckvalue ATLAS
} elseif { [matchclass $::Test_Subnet contains [IP::client_addr] ] } {
set ckvalue TEST
} else {
set ckvalue UNKNOWN
}
}
when HTTP_REQUEST {
HTTP::header insert $ckname $ckvalue
}
There's a great post on matching network masks here, as well: Click here
Happy Coding,
Colin
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