Forum Discussion
Macaron
Nimbostratus
Jun 27, 2016iRule - Source Port persistence for a specific subnet else only source addr persistence
 Hi, 
    I need an iRule help. I want to apply source port persistence on a specific subnet (10.1.1.0/24) and for all the other traffic coming to the same VIP, I just want to Source address persisten...
Macaron
Nimbostratus
Jun 27, 2016Thanks Odaah, I am not using persistence profile for this VIP. Do I have to ? and so the the complete iRule would looks like this. Please verify !!!
 when CLIENT_ACCEPTED {
   if {[class match [IP::client_addr] equals "datagroup_dg"]}{
     set client_ip_port "[IP::client_addr]:[TCP::client_port]"
     persist uie $client_ip_port
   }
   else {
          persist uie [IP::client_addr]
   }
}    
and also I wanted to know the datagroup format can you please verify the following:
ltm data-group internal addr_testclass {
    records {
        10.1.1.0/24 { }
        {
            data "what is this part for ?"
        }
    }
    type ip
}
- Vijay_EJun 27, 2016
Cirrus
I recommend using the UIE persistence profile. If not, we would have to add "persist add uie [IP::client_addr]" or similar such function in order to add the persistence record to the F5. Using the UIE persistence profile helps us to keep the iRule simple. Also, my 1st reply has been edited to answer the data group question. Let me know if everything has been addressed. 
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