20-Jul-2021 04:07
I have a requirement where have 4 backend server listening or port range 1603-1699 i.e. a total of 96 ports. The requirement is that the Virtual server should listen on the same ports and when the VS receives a request on any port for example port 1610 the request to any of the four pool members should be forwarded on the same port no, which mean the destination port should be maintained end to end
My assumption is that if I disable the option "Translate Port" under the VS setting it can be done.
Can anyone help me affirm this or if not possible provide an alternate solution ?
Solved! Go to Solution.
20-Jul-2021
10:48
- last edited on
04-Jun-2023
19:22
by
JimmyPackets
- You can also keep port translation enabled if traffic destined on VIP port should be sent to same port on the pool member. This should work.
- You would need VIP defined on any port. Configure iRule to only allow specific range and discard traffic for other ports.
Please modify accordingly for start and end port range
when CLIENT_ACCEPTED {
if {([TCP::local_port] >= <start port> && [TCP::local_port] <= <end port> ) } {
return )
else reject
}
- define pool with all 4 members and any port.
20-Jul-2021
10:48
- last edited on
04-Jun-2023
19:22
by
JimmyPackets
- You can also keep port translation enabled if traffic destined on VIP port should be sent to same port on the pool member. This should work.
- You would need VIP defined on any port. Configure iRule to only allow specific range and discard traffic for other ports.
Please modify accordingly for start and end port range
when CLIENT_ACCEPTED {
if {([TCP::local_port] >= <start port> && [TCP::local_port] <= <end port> ) } {
return )
else reject
}
- define pool with all 4 members and any port.
20-Jul-2021 11:05
Sanjay ,
Thanks for your response. The iRule is good to define the required port range for VIP.
My question though is if we keep the translate port enabled how will it send traffic to the backend pool member on the same port ? I believe disabling prot translate will allow this behaviour
20-Jul-2021 12:00
If pool member and VIP is listening on any port, F5 will by default send it to same port at the backend, irrespective of port translation settings. You can try it yourself.
20-Jul-2021 22:49
Sanjay, many thanks for your response and help in this. I will test it in a couple of days and share the results
20-Jul-2021 12:26
Additionally take a look at this article, it mentions two alternatives to using an iRule:
https://devcentral.f5.com/s/articles/Three-Ways-to-Specify-Multiple-Ports-on-a-Virtual-Server
20-Jul-2021 22:48
Daniel thanks for your response