Forum Discussion

Dafydd__Rhys-Jo's avatar
Dafydd__Rhys-Jo
Historic F5 Account
Mar 31, 2006

Hurting eyes, could someone check this?

Hey all,

 

Running 9.0.5, I have these rules in place:

 

 

rule cyclone_ftp_hhtp_request {

 

when HTTP_REQUEST {

 

if { [HTTP::uri] contains "ftp" } {

 

node 192.168.250.144

 

}

 

else {

 

pool cycloneprod

 

}

 

}

 

}

 

rule cyclone_test {

 

when CLIENT_ACCEPTED {

 

if { [IP::protocol] == 21 } {

 

node 192.168.250.128

 

}

 

else {

 

pool cyclonetest

 

}

 

}

 

}

 

rule cyclone_FTP {

 

when CLIENT_ACCEPTED {

 

if { [IP::protocol] == 21 } {

 

node 192.168.250.144

 

}

 

else {

 

pool cycloneprod

 

}

 

}

 

}

 

 

On a round robin LB, the ftp connection request, are still load balancing instead of going directly to the nodes. Is there a different method you guys would recommend for this?

 

 

Thanks in advance for the help!

6 Replies

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    Well, it looks like you're using the IP::protocol command where you'd probably want to use something closer to TCP::client_port

    The IP::protocol command doesn't return the port address of the transfer protocol you're using, it returns the actual value of the protocol field.

    There's a decent list of them here: Click here

    So, you'd want to change your two FTP rules to look more like:

    
    when CLIENT_ACCEPTED {
      if { [TCP::client_port] == 21 } {
        node 192.168.250.128
      } else {
        pool cyclonetest
      }
    }

    And:

    
    when CLIENT_ACCEPTED {
      if { [TCP::client_port] == 21 } {
        node 192.168.250.144
      } else {
        pool cycloneprod
      }
    }

    HTH,

    -Colin
  • Dafydd__Rhys-Jo's avatar
    Dafydd__Rhys-Jo
    Historic F5 Account
    Thank you, but wouldn't that be based off of the client that is connecting? If so, the client port can be any port number. The server port is 21.
  • that will work on the clientside events, and it might work on serverside events, depending on whether you are using standard ports or not
  • Dafydd__Rhys-Jo's avatar
    Dafydd__Rhys-Jo
    Historic F5 Account
    So the safe bet would be [TCP::local_port] because that's where the client is connecting to on the VIP. Sounds like that will work. Thanks all!