Forum Discussion
sb_2323_80570
Mar 06, 2009Nimbostratus
Newbie PAT question
Hi,
Im new to writing iRules so apologies in advance, Im looking to write an iRule that redirects a client based on the last octet of a vserver to a particular port.
Eg
eq client >> vserver x.x.x.10 tcp_443 to a pool but the destination port is changed to tcp_10.
Any assistance would be greatly apreciated.
- hooleylistCirrostratusIf I understand your scenario correctly, I think you could do this without an iRule. You can configure your VS on x.x.x.10:443 and the pool member(s) on port 10. Just make sure port translation on the VS is left at the default of enabled.
- sb_2323_80570NimbostratusHi,
- hooleylistCirrostratusI see. I haven't tested this, but I think you could use the default load balancing algorithm to choose the pool member IP address and then change the destination port based on the last octet of the requested IP address.
when LB_SELECTED { log local0. "[IP::client_addr]:[TCP::client_port]: Request to VS [IP::local_addr]:[TCP::local_port]\ Default selection: [LB::server]" Use the node command to change the destination port of the selected pool member node [LB::server addr] [getfield [IP::local_addr] "." 4] log local0. "[IP::client_addr]:[TCP::client_port]: Changing to node:\ [LB::server addr] [getfield [IP::local_addr] "." 4]" }
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