# subnet access to a proxy

**URL:** <https://community.f5.com/t/subnet-access-to-a-proxy/596>\
**Category:** Technical Forums\
**Tags:** dev, irules, devops, application-delivery\
**Created:** [June 2, 2010, 10:18pm UTC](https://community.f5.com/t/subnet-access-to-a-proxy/596 "2010-06-02T22:18:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arun\_102398](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@Arun\_102398](https://community.f5.com/u/Arun_102398)\
**Post date:** [June 2, 2010, 10:18pm UTC](https://community.f5.com/t/subnet-access-to-a-proxy/596/1 "2010-06-02T22:18:19Z")

</div>

We have a seperate LB in our environment to load balance proxies on our network.

So, as part of it. we would like to restrct a prticuar subnet to access a seperate proxy IP which is under a pool.So, we created an iRule. But, it did not give desired reqult. Below are the details of rule:

Ex Internal subnet: 172.16.25.x

Ex Proxy IP: 216.64.12.215

data grroup: poc\_proxy\_test which has the internal subnet.

iRule as created.

------------------

when CLIENT\_ACCEPTED { if { [matchclass [IP::client\_addr] equals $::poc\_proxy\_test] } {

IronPort Address

node 216.64.12.215[TCP::server\_port] }

}

---

<div class="post-metadata">

**Author:** ![Michael\_Yates](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@Michael\_Yates](https://community.f5.com/u/Michael_Yates)\
**Post date:** [June 3, 2010, 1:29am UTC](https://community.f5.com/t/subnet-access-to-a-proxy/596/2 "2010-06-03T01:29:20Z")

</div>

What were the unexpected results / behavior that you are trying to work around?

I’m guessing Port Translation?

I think that your problem is that your trying to specify a connection to the server using [TCP::server\_port]. Your trying to retrieve the port number to a node that you haven’t established a connection with yet.

[TCP::server\_port] = The serverside part of the LTM\<-\>server connection.

I think that you should try changing it to use [TCP::client\_port]. This would take the incoming connection port from the user (80, 443, etc) and send the traffic to the destination IP Address using that port.

[TCP::client\_port] = The clientside part of the client\<-\>LTM connection.

Another shortcut to that is to specify Port 0, which is the LTM’s default 1 to 1 mapping for ports.

```tcl
when CLIENT_ACCEPTED { 
if { [matchclass [IP::client_addr] equals $::poc_proxy_test] } {
 IronPort Address
node 216.64.12.215 0
}
 }

```

---

<div class="post-metadata">

**Author:** ![Arun\_102398](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@Arun\_102398](https://community.f5.com/u/Arun_102398)\
**Post date:** [June 3, 2010, 7:32pm UTC](https://community.f5.com/t/subnet-access-to-a-proxy/596/3 "2010-06-03T19:32:52Z")

</div>

hi mich,

I shall trya nd update asap.
