Forum Discussion

Bhoopendra_2539's avatar
Bhoopendra_2539
Icon for Nimbostratus rankNimbostratus
Nov 17, 2016

Distribute client request on the basis of the health monitor with the help of Irule.

Hi All, I need some assistance on below query, please. I have set-up/scenario where I have to server the client on one server running 21 and 22 service port (ideally a pool member with any port, for example 10.10.10.10: 0 (Any)). I would like to forward request to the service which is available, if the service is down the request should dropped. For example, if the health monitor for service 21 on 10:10:10:10: any is not responding, the packet should be dropped. Setup Virtual_Server_A: 0 (Any) >>>Associated Pool >>> Pool_A : 0 (Any) Health monitor on Pool_A : tcp_21 & tcp_22. Please advice

 

1 Reply

  • Create two seperate pools for port 21 and 22. Lets say port 21 uses the pool ftp_pool and port 22 uses ssh_pool. Create seperate health monitors for each pool to use TCP monitor and respective ports. Remove default pool from the virtual server 10.10.10.10:0 and attach below irule.

    when CLIENT_ACCEPTED {
      if {[TCP::local_port] == 21}  {
       pool ftp_pool
      } elseif {[TCP::local_port] == 22} {
      pool ssh_pool
     }
    }
    

    -Jinshu