Forum Discussion
It is unclear from your code what your requirements are. Do you want to load balance all connections from all clients with ports in the range of 8000-10000 to pool1, as your sample iRule code shows? Or do you want to load balance to separate pools based on client port, with clients in port range 8000-8500 load balancing to pool1, clients in port range 8501-9000 load balancing to pool2, etc? In either case, where do you want each port grouping to load balance to if the first load balancing choice fails? Depending on what your requirements really are (and the version of BIG-IP you are running), you may be able to do at least the pool selection part with a local traffic policy rather than an iRule, which would be more efficient. For example:
If you still need to select another node if load balancing fails, my understanding is that can only be done with an iRule at this point.