# Local Traffic Policy rule or irule to bypass the BIG-IP ASM

**URL:** <https://community.f5.com/t/local-traffic-policy-rule-or-irule-to-bypass-the-big-ip-asm/75834>\
**Category:** Technical Forums\
**Tags:** security, devops, application-delivery\
**Created:** [March 4, 2025, 5:13am UTC](https://community.f5.com/t/local-traffic-policy-rule-or-irule-to-bypass-the-big-ip-asm/75834 "2025-03-04T05:13:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CHRISTY\_THOMAS](https://avatars.discourse-cdn.com/v4/letter/c/ea5d25/32.png) [@CHRISTY\_THOMAS](https://community.f5.com/u/CHRISTY_THOMAS)\
**Post date:** [March 4, 2025, 5:13am UTC](https://community.f5.com/t/local-traffic-policy-rule-or-irule-to-bypass-the-big-ip-asm/75834/1 "2025-03-04T05:13:00Z")

</div>

Hi ,

I need to bypass ASM for specific url request . Can any one help for this. LTM rule or irule can be feasible.

Example url for asm bypass: /fed/uat/pm.

I have referred KB22021244, But i am unable to create a ltm rule or irule for desired requirement.

Regards

Christy Thomas

---

<div class="post-metadata">

**Author:** ![P\_Kueppers](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/p_kueppers/32/22789_2.png) [@P\_Kueppers](https://community.f5.com/u/P_Kueppers)\
**Post date:** [March 4, 2025, 12:25pm UTC](https://community.f5.com/t/local-traffic-policy-rule-or-irule-to-bypass-the-big-ip-asm/75834/2 "2025-03-04T12:25:33Z")

</div>

Hi,

you can choose what ever suits your case. I did it this way:  
LTM Policy for activating ASM. This policy is on every virtual server with one rule&nbsp;  
“Activate ASM” but with two other conditions

IF NOT HOST [XYZ.com](http://XYZ.com)&nbsp;  
or  
IF NOT URI Full String /abc/123.html

---

<div class="post-metadata">

**Author:** ![CHRISTY\_THOMAS](https://avatars.discourse-cdn.com/v4/letter/c/ea5d25/32.png) [@CHRISTY\_THOMAS](https://community.f5.com/u/CHRISTY_THOMAS)\
**Post date:** [March 5, 2025, 4:52am UTC](https://community.f5.com/t/local-traffic-policy-rule-or-irule-to-bypass-the-big-ip-asm/75834/3 "2025-03-05T04:52:09Z")

</div>

Hi,

Can you share a sample LTM rule or irule for the above requirement.

---

<div class="post-metadata">

**Author:** ![P\_Kueppers](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/p_kueppers/32/22789_2.png) [@P\_Kueppers](https://community.f5.com/u/P_Kueppers)\
**Post date:** [March 5, 2025, 8:40am UTC](https://community.f5.com/t/local-traffic-policy-rule-or-irule-to-bypass-the-big-ip-asm/75834/4 "2025-03-05T08:40:28Z")

</div>

You can go by this:

 ![image_340146.png](https://d20hrnpixdzcsd.cloudfront.net/original/3X/f/9/f9d963aad81fd1ac9e2b825af15aa4e94bd6edc3.png)

So first I select every Host that does not need ASM and any other Host gets ASM enabled.&nbsp;  
But you can do something like this also:

![image_340146.png](https://d20hrnpixdzcsd.cloudfront.net/original/3X/a/c/acdef75fa615aa36f5dcdc7299874b7ea44de476.png)

And for those two conditions I have selected “skip this condition if its missing from request”

---

<div class="post-metadata">

**Author:** ![CHRISTY\_THOMAS](https://avatars.discourse-cdn.com/v4/letter/c/ea5d25/32.png) [@CHRISTY\_THOMAS](https://community.f5.com/u/CHRISTY_THOMAS)\
**Post date:** [March 10, 2025, 7:22am UTC](https://community.f5.com/t/local-traffic-policy-rule-or-irule-to-bypass-the-big-ip-asm/75834/5 "2025-03-10T07:22:12Z")

</div>

Hi,

Thank you ,

I have created the LTM rule that you have shared. and also i have created a iRule also: The irule worked.

Is there any possibility of fine-tuning the following iRule with a header name condition in addition to the URL? Can you help me with this?

when HTTP\_REQUEST {

if {[HTTP::uri] contains “/sxx/xxx/cron”} {

ASM::disable

log local0. “ASM disabled”

} else {

ASM::enable /Common/SEC\_Policy

log local0. " ASM ENABLED. Current ASM policy is [ASM::policy]"

}

}

---

<div class="post-metadata">

**Author:** ![P\_Kueppers](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/p_kueppers/32/22789_2.png) [@P\_Kueppers](https://community.f5.com/u/P_Kueppers)\
**Post date:** [March 10, 2025, 9:17am UTC](https://community.f5.com/t/local-traffic-policy-rule-or-irule-to-bypass-the-big-ip-asm/75834/6 "2025-03-10T09:17:40Z")

</div>

Sure can you fine-tune this with more conditions. Header Based would look like this:

```tcl
when HTTP_REQUEST {
if {[HTTP::uri] contains "/sxx/xxx/cron" OR [HTTP::header exists "DISABLE_ASM"] } {
ASM::disable [...]

```
