# LTM policy based on client source IP

**URL:** <https://community.f5.com/t/ltm-policy-based-on-client-source-ip/22705>\
**Category:** Technical Forums\
**Tags:** irules, policies, devops, ltm, application-delivery\
**Created:** [June 5, 2015, 6:08am UTC](https://community.f5.com/t/ltm-policy-based-on-client-source-ip/22705 "2015-06-05T06:08:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Wallis\_833](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@Mark\_Wallis\_833](https://community.f5.com/u/Mark_Wallis_833)\
**Post date:** [June 5, 2015, 6:08am UTC](https://community.f5.com/t/ltm-policy-based-on-client-source-ip/22705/1 "2015-06-05T06:08:57Z")

</div>

Hi everyone.

We are in the process of reviewing our iRules to see if there are any we can simplify or replace with configuration as we move up to newer versions of 11.x.

Does anyone know if there is a way to build a LTM policy that matches on the IP address of the client ? I would have thought it would be obvious but I cannot spot it anywhere.

We have certain clients we apply particular redirects to - some hardcoded in iRules and others listed in data groups. Would love to be able to build a policy that matches the client IP to an IP is an iRule data group.

If not, I’ll just stick with my current iRule.

Thanks ! Mark.

---

<div class="post-metadata">

**Author:** ![nitass\_89166](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@nitass\_89166](https://community.f5.com/u/nitass_89166)\
**Post date:** [June 5, 2015, 7:01am UTC](https://community.f5.com/t/ltm-policy-based-on-client-source-ip/22705/2 "2015-06-05T07:01:11Z")

</div>

Does anyone know if there is a way to build a LTM policy that matches on the IP address of the client ?

Is there any way in a traffic policy to match on IP address?

> **[DevCentral](https://community.f5.com/)**
>
> DevCentral is an online technical community where engineers and practitioners collaborate, share knowledge, and solve problems related to F5 technologies and industry trends.

---

<div class="post-metadata">

**Author:** ![nitass](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nitass/32/2270_2.png) [@nitass](https://community.f5.com/u/nitass)\
**Post date:** [June 5, 2015, 7:01am UTC](https://community.f5.com/t/ltm-policy-based-on-client-source-ip/22705/3 "2015-06-05T07:01:11Z")

</div>

Does anyone know if there is a way to build a LTM policy that matches on the IP address of the client ?

Is there any way in a traffic policy to match on IP address?

> **[DevCentral](https://community.f5.com/)**
>
> DevCentral is an online technical community where engineers and practitioners collaborate, share knowledge, and solve problems related to F5 technologies and industry trends.

---

<div class="post-metadata">

**Author:** ![Mark\_Wallis\_833](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@Mark\_Wallis\_833](https://community.f5.com/u/Mark_Wallis_833)\
**Post date:** [June 5, 2015, 7:49am UTC](https://community.f5.com/t/ltm-policy-based-on-client-source-ip/22705/4 "2015-06-05T07:49:33Z")

</div>

11.6 ☹

Anyone know of any solutions for 11.5.x ?

---

<div class="post-metadata">

**Author:** ![Javier\_Somoza](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@Javier\_Somoza](https://community.f5.com/u/Javier_Somoza)\
**Post date:** [October 27, 2017, 6:14am UTC](https://community.f5.com/t/ltm-policy-based-on-client-source-ip/22705/5 "2017-10-27T06:14:28Z")

</div>

Im using in v13 this policy condition to filter based on source IP:

“TCP” – “address” – “matches” – “in datagroup” – at “request” time (apply traffic on “remote” side of “external” interface)

Also see:

[F5 BIGIP – Bug when using datagroups in LTM policies](https://somoit.net/f5-big-ip/f5-bigip-bug-when-using-datagroups-in-ltm-policies)

> **[F5 BIGIP - Bug when using datagroups in LTM policies](https://somoit.net/f5/f5-bigip-bug-when-using-datagroups-in-ltm-policies/)**
>
> When using datagroups, there is a bug that makes LTM policies check the first of the datagroups in the list instead of the configured one in the condition

---

<div class="post-metadata">

**Author:** ![Javier\_Somoza](https://avatars.discourse-cdn.com/v4/letter/j/ecd19e/32.png) [@Javier\_Somoza](https://community.f5.com/u/Javier_Somoza)\
**Post date:** [October 27, 2017, 6:14am UTC](https://community.f5.com/t/ltm-policy-based-on-client-source-ip/22705/6 "2017-10-27T06:14:28Z")

</div>

Im using in v13 this policy condition to filter based on source IP:

“TCP” – “address” – “matches” – “in datagroup” – at “request” time (apply traffic on “remote” side of “external” interface)

Also see:

[F5 BIGIP – Bug when using datagroups in LTM policies](https://somoit.net/f5-big-ip/f5-bigip-bug-when-using-datagroups-in-ltm-policies)

> **[F5 BIGIP - Bug when using datagroups in LTM policies](https://somoit.net/f5/f5-bigip-bug-when-using-datagroups-in-ltm-policies/)**
>
> When using datagroups, there is a bug that makes LTM policies check the first of the datagroups in the list instead of the configured one in the condition
