# static sticky entry using source address persistence

**URL:** <https://community.f5.com/t/static-sticky-entry-using-source-address-persistence/15133>\
**Category:** Technical Forums\
**Created:** [August 14, 2015, 1:11pm UTC](https://community.f5.com/t/static-sticky-entry-using-source-address-persistence/15133 "2015-08-14T13:11:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![haripriya\_20011](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@haripriya\_20011](https://community.f5.com/u/haripriya_20011)\
**Post date:** [August 14, 2015, 1:11pm UTC](https://community.f5.com/t/static-sticky-entry-using-source-address-persistence/15133/1 "2015-08-14T13:11:31Z")

</div>

All the traffic from a particular source IP ,always need to go a specific backend server.How can i acheive that on F5.

On cisco we have can configure using static sticky entry .Need some assistance as we are in process of migration of all our application from cisco to F5.

cisco config.

sticky ip-netmask 255.255.255.255 address source vip\_STICKY serverfarm pool timeout 1 replicate sticky 8 static client source 192.168.10.5 rserver app1

how to achive this in f5

---

<div class="post-metadata">

**Author:** ![Christophe\_Lem2](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@Christophe\_Lem2](https://community.f5.com/u/Christophe_Lem2)\
**Post date:** [August 14, 2015, 1:37pm UTC](https://community.f5.com/t/static-sticky-entry-using-source-address-persistence/15133/2 "2015-08-14T13:37:07Z")

</div>

You may simply use source\_addr as Default Persistence Profile in your virtual-server’s config.

If you want to replicate the persistence to HA peer you’ll have to enable Mirror Persistence in the source\_addr persistence profile.

---

<div class="post-metadata">

**Author:** ![haripriya\_20011](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@haripriya\_20011](https://community.f5.com/u/haripriya_20011)\
**Post date:** [August 14, 2015, 1:58pm UTC](https://community.f5.com/t/static-sticky-entry-using-source-address-persistence/15133/3 "2015-08-14T13:58:59Z")

</div>

1 particular client IP need to make a connection to only 1 backend server. we want to make sure the that client :192.168.10.5 has a sticky entry stick to only app1 memeber

this vip contains 12 members in th pool

---

<div class="post-metadata">

**Author:** ![Christophe\_Lem2](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@Christophe\_Lem2](https://community.f5.com/u/Christophe_Lem2)\
**Post date:** [August 14, 2015, 2:06pm UTC](https://community.f5.com/t/static-sticky-entry-using-source-address-persistence/15133/4 "2015-08-14T14:06:58Z")

</div>

Then you’ll have to use an iRule similar to this:

```tcl
when CLIENT_ACCEPTED {
  if { [IP::client_addr] == "192.168.10.5" } {
    pool my_Pool member 10.1.2.200 80
  }
}

```

---

<div class="post-metadata">

**Author:** ![haripriya\_20011](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@haripriya\_20011](https://community.f5.com/u/haripriya_20011)\
**Post date:** [August 17, 2015, 2:43am UTC](https://community.f5.com/t/static-sticky-entry-using-source-address-persistence/15133/5 "2015-08-17T02:43:43Z")

</div>

Christophe thanks for your response ,so how i can verify that all the connection from the client 192.168.10.5 are always going to the pool member 10.1.2.200

please let me know

---

<div class="post-metadata">

**Author:** ![stan\_piron](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@stan\_piron](https://community.f5.com/u/stan_piron)\
**Post date:** [August 17, 2015, 7:53am UTC](https://community.f5.com/t/static-sticky-entry-using-source-address-persistence/15133/6 "2015-08-17T07:53:15Z")

</div>

you can verify with tmsh command:

```tcl
show sys connection cs-client-addr 192.168.10.5 cs-server-addr vs_server_ip

```

---

<div class="post-metadata">

**Author:** ![haripriya\_20011](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@haripriya\_20011](https://community.f5.com/u/haripriya_20011)\
**Post date:** [August 18, 2015, 8:07pm UTC](https://community.f5.com/t/static-sticky-entry-using-source-address-persistence/15133/7 "2015-08-18T20:07:34Z")

</div>

Thanks all for your response ,I have one more question .if I need have 2 client IPs need to always connects to 2 different servers .Then how should my irule look like . DO i need 2 irules for it .

client :192.168.10.5 -----\> server 10.1.2.200 client : 192.168.11.6 ------\> server 10.1.2.205

---

<div class="post-metadata">

**Author:** ![Christophe\_Lem2](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@Christophe\_Lem2](https://community.f5.com/u/Christophe_Lem2)\
**Post date:** [August 19, 2015, 8:36am UTC](https://community.f5.com/t/static-sticky-entry-using-source-address-persistence/15133/8 "2015-08-19T08:36:07Z")

</div>

No, you don’t need a second iRule, just add an “elseif” statement to the previous iRule.

Have a look to iRule’s Wiki ([https://devcentral.f5.com/wiki/iRules.HomePage.ashx).](https://devcentral.f5.com/wiki/iRules.HomePage.ashx)) There are a lot of example there.
