Forum Discussion

Joe_Curl_105786's avatar
Joe_Curl_105786
Icon for Nimbostratus rankNimbostratus
Oct 23, 2013

Pool Selection

I am trying to select a pool based on the server port the client tries to connect on. I am getting the below error. I am also posting the rule below as well. Thanks for any assistance.

 

iRule

 

when CLIENT_ACCEPTED { switch -glob [TCP::server_port] { "10320" { pool CloverLeaf-NADCLLINTSIN01C-Pool log local0. "Cloverleaf Matched 10.28.8.93"} "10870" { pool CloverLeaf-NADCLLINTSIN01B-Pool log local0. "Cloverleaf Matched 10.28.8.91"} default { discard } } }

 

Log Error

 

Wed Oct 23 15:41:02 CDT 2013 err local/tmm1 tmm1[5254] 01220001 TCL error: Cloverleaf-Port-Translation - Error: No serverside connection established (line 1) invoked from within "TCP::server_port"

 

4 Replies

  • Assuming you mean the destination port of the VIP, you'd use TCP::local_port.

    when CLIENT_ACCEPTED { 
        switch -glob [TCP::local_port] { 
            "10320" { 
                pool CloverLeaf-NADCLLINTSIN01C-Pool 
                log local0. "Cloverleaf Matched 10.28.8.93"
            } 
            "10870" { 
                pool CloverLeaf-NADCLLINTSIN01B-Pool 
                log local0. "Cloverleaf Matched 10.28.8.91"
            } 
            default { 
                discard 
            } 
        } 
    }
    
  • Ok that helps. Thanks for the response. I tried that one and it did seem to work.

     

    I have a question about the CLIENT_ACCEPTED. If I use that command will it run the rule every time a TCP connection is created or will it not run this if an existing connection is in the persistence table. I am trying to make it as efficient as I can. If I don't need to add the extra load on the F5 then I would like to avoid it if I can. Persistence is set to source address.

     

  • The CLIENT_ACCEPTED is triggered on each new TCP handshake, regardless of persistence.