For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Gavster78_13032's avatar
Gavster78_13032
Icon for Nimbostratus rankNimbostratus
Mar 04, 2014

Persist iRule based on source address

Hi

 

Hopefully this is an easy question. I have a HTTPS VIP with two pool members and four possible sources (A,B,C,D). I need to create an irule that uses a persist timeout of say 30 seconds when the source is A&B and a timeout of 1800 seconds when the source is C&D? in other words a different timeout for the same VIP based on the source address?

 

Thanks in advance

 

Gavster78

 

1 Reply

  • Here is perhaps one way to do this: create a Universal persistence profile, apply the following iRule, and set Timeout to Indefinite. Then apply this persistence profile to your virtual server:

    when CLIENT_ACCEPTED {
        if { [persist lookup source_addr [IP::client_addr]] ne "" } {
            persist source_addr [IP::client_addr]
        } 
    }
    when SERVER_CONNECTED {
        if { [persist lookup source_addr [IP::client_addr]] equals "" } {
            switch [IP::client_addr] {
                "10.80.0.1" { persist add source_addr [IP::client_addr] 30 }
                "10.80.0.2" { persist add source_addr [IP::client_addr] 30 }
                "10.70.0.1" { persist add source_addr [IP::client_addr] 1800 }
                "10.70.0.2" { persist add source_addr [IP::client_addr] 1800 }
            }
        }   
    }