Forum Discussion

cshannahan_3137's avatar
cshannahan_3137
Icon for Nimbostratus rankNimbostratus
Apr 18, 2018

Help creating irule for source persistance/no source persistance.

Hey, I have a virtual server that requires source persistance for a few sources (incoming tcp connections) but not all of them.

 

For now I've created many virtual servers (one virtual address) with the source address field filled in with the incoming IP and then persistence on or off depending on if it needs it.

 

I would like to have just one virtual server with an irule stating that if it comes from this source, do not use persistance or use persistance. I'm not sure which one I will use for the default, probably have it off.

 

I've never written an irule before. Any help would be appreciated. I think it would have something like this in it, I'm not sure what else I would have to do in the irule.

 

persist source_addr mask timeout_in_seconds

 

1 Reply

  • Hi

    Create a datagroup and add all of the source ips to it that you want to have persistence records for. Then use an iRule like this one to pick out these clients

    when CLIENT_ACCEPTED {
    
        if {[class match [IP::client_addr] equals ]} {
        persist source_addr
    }
    
    }