Forum Discussion
iRule to change udp destination port
I am trying to write an iRule to make a LB decision based on source IP address and change the destination port if it matches.
e.g. If udp connection from "Network A" use pool "B_101", otherwise default. Pool "B_101" members are listening on a different udp port than the virtual server.
Virtual Server listens on udp port 100
Default pool members listen on udp port 100
pool "B_101" members listen on udp port 101
iRule
when CLIENT_ACCEPTED {
if {[ class match [IP::remote_addr] equals "Network A"]} {
log local0. "Source Subnet Matches Network A - [IP::client_addr]"
pool B_101
}
else { }
}
Data is reaching the pool members of pool "B_101" but the destination port is unchanged. Any help is appreciated.
1 Reply
- nitass
Employee
Data is reaching the pool members of pool "B_101" but the destination port is unchanged.is "port translation" setting under virtual server configuration enabled?
alternatively, you may enable translate port in irule.
translate wiki
https://devcentral.f5.com/wiki/irules.translate.ashx
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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