Forum Discussion

conorh_17335's avatar
conorh_17335
Icon for Nimbostratus rankNimbostratus
Oct 22, 2012

TCL error for basic port translation iRule

Background: I've set up a simple iRule that translates the requested VIP:PORT to NODE:PORT. Although, this iRule works well, I continue getting these TCL errors. I have tried using IF statements but this has ended up breaking my iRule. Does anyone know what would be causing this error? Thanks

 

 

LTM Version: BIG-IP 11.2.0 Build 2557.0 Hotfix HF2

 

Log > Local Traffic

 

err

 

TCL error: /Common/port_translation - bad IP address format (line 3) invoked from within "node $node_address_port"

 

Data Group List

 

Name: port_translation

 

Type: String

 

Example: 12080 := 10.0.0.120:8080

 

iRule

 

 

when HTTP_REQUEST {

 

set node_address_port [class match -value [TCP::local_port] equals /Common/port_translation]

 

log local0.info "Node address/port is $node_address_port"

 

node $node_address_port

 

}

 

 

 

 

 

14 Replies

  • can you put log command above line 3?

     

     

    e.g.

     

     

    log local0. "node [getfield $node_address_port ":" 1] [getfield $node_address_port ":" 2]"
  • has anyone found a solution ? I got the exact same issue.

     

    Looks like parameters to "node" are not expanded and only direct IP addresses are possible

     

    OK: node 1.2.3.4 80

     

    NOT: node $destination $port

     

    NOT: node [whatever command]

     

     

    Thanks, P
  • found it myself:

     

     

    node [lindex [split $hostservice ":"] 0] [lindex [split $hostservice ":"] 1]

     

     

    does the trick

     

    Thanks, P

     

  • Hi Peter,

     

     

    node $ip $port

     

    and

     

    node [getfield $hostservice ":" 1] [getfield $hostservice ":" 2]

     

     

    should both work.

     

     

    Aaron