Forum Discussion
Using an iRule to add source address affinity persistence.
Hello, i'm trying to figure out if there is a way to add a persistence profile (60 minute source address affinity) only to the pool members in the below irule. Basically we're doing hostname mapping via irule and only need a 60 minute persistence profile on the 3xxx pools. Any help would me much appreciated. Thanks!
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "example.100.f5.com"} {
node 10.10.10.77:44351
}
elseif {[string tolower [HTTP::host]] equals "example.200.f5.com"} {
node 10.10.10.77:44358
}
elseif {[string tolower [HTTP::host]] equals "example.300.f5.com"} {
node 10.10.10.77:44359
}
elseif {[string tolower [HTTP::host]] equals "example.400.f5.com"} {
pool Treas_CRM-UAT_3259_Pool <-- need 60 minute source address affinity profile
}
elseif {[string tolower [HTTP::host]] equals "example.500.f5.com"} {
pool Treas_ECC-UAT_3251_Pool <-- need 60 minute source address affinity profile
}
elseif {[string tolower [HTTP::host]] equals "example.600.f5.com"} {
pool Treas_BW-UAT_3258_Pool <-- need 60 minute source address affinity profile
}
else { discard }
}
- iaineNacreous
Hi
You can use the persist command to enable this - https://clouddocs.f5.com/api/irules/persist.html
- DanSNimbostratus
So something like this? Please see below. thanks!
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "example.100.f5.com"} {
node 10.10.10.77:44351
}
elseif {[string tolower [HTTP::host]] equals "example.200.f5.com"} {
node 10.10.10.77:44358
}
elseif {[string tolower [HTTP::host]] equals "example.300.f5.com"} {
node 10.10.10.77:44359
}
elseif {[string tolower [HTTP::host]] equals "example.400.f5.com"} {
pool Treas_CRM-UAT_3259_Pool <-- need 60 minute source address affinity profile
persist source_addr 255.255.255.255 3600
}
elseif {[string tolower [HTTP::host]] equals "example.500.f5.com"} {
pool Treas_ECC-UAT_3251_Pool <-- need 60 minute source address affinity profile
persist source_addr 255.255.255.255 3600
}
elseif {[string tolower [HTTP::host]] equals "example.600.f5.com"} {
pool Treas_BW-UAT_3258_Pool <-- need 60 minute source address affinity profile
persist source_addr 255.255.255.255 3600
}
else { discard }
}
- iaineNacreous
Looks good to me
Recent Discussions
Related Content
* 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