Forum Discussion
Paul_Slosberg_8
May 15, 2007Historic F5 Account
Multiple Port translations in an i-Rule
I would like to find an eloquent solution to eliminate 254 VS and 254 pools using an i-Rule. We have servers making http (port 80) requests to VS that in turn are pointing to pool that have specific ports, very standard stuff.
Here’s the wrinkle we have several class Cs that we do this with. The requested VS server address is the clue to the corresponding port that the request is destined for. So a request to VS x.x.x.123:80 is destined for pool_4123 y.y.y.y:4123 z.z.z.z::4123 and a request to VS x.x.x.124:80 is destined for pool_4124 y.y.y.y:4124 z.z.z.z::4124and so on.
What I would like to do is use a network VS say x.x.x.x/24:80 and then be able to use a wild card pool my_pool:any and use an i-Rule to grab the last octet and use that info to send the request to the correct pool and translate the associated port.
I have not seen a way to do port translation with an i-Rule. I could do this with a long class list and 254 port specific pools. I was hoping to see if anyone knew of a way to do this by using a network virtual and a wildcard pool.
Thanks a bunch
1 Reply
- Colin_Walker_12Historic F5 AccountI think the big issue you're going to run into here is that, to get the iRule to do the port translation for you, you're going to have to know which member of the pool you want to send the traffic to. This means knowing the IPs of the members in each pool and being able to derive that the same way you are the port.
when HTTP_REQUEST { set lastOct [getfield [IP::local_addr] "." 4] set myPool "pool_4"$lastOct set myMember "192.168.1."$lastOct set myPort "4"$lastOct pool $myPool $myMember $myPort }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects