# redirect based on source  address

**URL:** <https://community.f5.com/t/redirect-based-on-source-address/61917>\
**Category:** Technical Forums\
**Tags:** irules, application-delivery\
**Created:** [August 26, 2019, 1:18am UTC](https://community.f5.com/t/redirect-based-on-source-address/61917 "2019-08-26T01:18:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![neeeewbie](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/neeeewbie/32/33782_2.png) [@neeeewbie](https://community.f5.com/u/neeeewbie)\
**Post date:** [August 26, 2019, 1:18am UTC](https://community.f5.com/t/redirect-based-on-source-address/61917/1 "2019-08-26T01:18:10Z")

</div>

Hi guys

I need your help!

I have to redirect according to the scope

1.1.1. \* ~ 1.1.186. \* Redirects to pool A

To redirect to pool B from 1.1.186. \* To 1.1.255. \*

How do I use irule?

and Is it possible to specify a range using an operator?

and where can I modify data\_group in ucs ? I can find location

Thanks

---

<div class="post-metadata">

**Author:** ![Enes\_Afsin\_Al](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/enes_afsin_al/32/15359_2.png) [@Enes\_Afsin\_Al](https://community.f5.com/u/Enes_Afsin_Al)\
**Post date:** [August 26, 2019, 7:55am UTC](https://community.f5.com/t/redirect-based-on-source-address/61917/2 "2019-08-26T07:55:32Z")

</div>

Hi neeeewbie,

iRule:

```tcl
when CLIENT_ACCEPTED {
	if { [IP::addr [IP::client_addr] equals 1.1.0.0/16] } {
		set thirdOctet [expr { [getfield [IP::client_addr] "." 3]}]
		# log local0. "ThirdOctet: $thirdOctet"
 
		if { $thirdOctet < 186 } {
		    pool pool_A
		} else {
		    pool pool_B
		}
	}
}

```

data\_group location in UCS:

```tcl
/config/bigip.conf

```
