cancel
Showing results for 
Search instead for 
Did you mean: 
Andy_McGrath
Cumulonimbus
Cumulonimbus

Problem this snippet solves:

Customer request during Cisco ACE to F5 LTM migration requires for one-to-one mapping between client and back end server.

How to use this snippet:

Need a Data Group as below to simply identify the clientside source address and select the IP address of the pool member to use on the serverside.

All serverside IP addresses in the DataGroup should be in the Pool associated with the Virtual Server.

ltm data-group internal ONE_TO_ONE_DATAGROUP {
    records {
        172.16.0.1/32 {
            data 192.168.10.1
        }
        172.16.0.2/32 {
            data 192.168.10.2
        }
        172.16.0.2/32 {
            data 192.168.10.2
        }
    }
    type ip
}

Code :

when CLIENT_ACCEPTED {
    # Run pool command using data group lookup as the value inside of a catch statement
    if { [catch { 
            pool [LB::server pool] member [class match -value -- [IP::client_addr] equals ONE_TO_ONE_DATAGROUP]
          }]
       } {
        # If data group lookup or pool command raises an error the catch returns true and the default VS configured pool is selected
        pool [LB::server pool]
    }
}

Tested this on version:

11.5
Version history
Last update:
‎13-Nov-2015 01:27
Updated by:
Contributors