Have some code. Share some code.
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

Problem this snippet solves:

This iRule makes routing decisions based upon the destination address and whether that address is in on the the data groups called. This uses the matchclass method to try and match IP::localaddr to the members of various data groups. As an aside IP::localaddr is on a forwarding virtual server returns the value of the destination ip address.

Code :

# David A. Homoney, F5 Networks Consulting
# July 2006
# Tested on 9.1.1


   if { [matchclass [IP::local_addr] equals $::Subnet1] } {
pool FW1
   } elseif { [matchclass [IP::local_addr] equals $::Subnet2] } {  
pool FW2
   } elseif { [matchclass [IP::local_addr] equals $::Subnet3] } {
pool FW3
   } elseif { [matchclass [IP::local_addr] equals $::Subnet4] } {
pool FW4
   } elseif { [matchclass [IP::local_addr] equals $::Subnet5] } {
pool FW5
   } elseif { [matchclass [IP::local_addr] equals $::Subnet6] } {
pool FW6
   } elseif { [matchclass [IP::local_addr] equals $::Subnet7] } {
pool FW7_SNAT
   } elseif { [matchclass [IP::local_addr] equals $::Subnet8] } {
pool FW8
   } else {
      pool FW9

Tested this on version:

F5 Employee
F5 Employee

What is the actual difference between "equals" and the standard TCL's "eq" for comparing strings?


Version history
Last update:
‎17-Mar-2015 12:38
Updated by: