Forum Discussion
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
- nitass
Employee
can you put log command above line 3?
e.g.
log local0. "node [getfield $node_address_port ":" 1] [getfield $node_address_port ":" 2]" - Peter_Aeschlima
Nimbostratus
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 - Peter_Aeschlima
Nimbostratus
found it myself:
node [lindex [split $hostservice ":"] 0] [lindex [split $hostservice ":"] 1]
does the trick
Thanks, P
- hoolio
Cirrostratus
Hi Peter,
node $ip $port
and
node [getfield $hostservice ":" 1] [getfield $hostservice ":" 2]
should both work.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com