Richard__Harlan
Dec 01, 2011Historic F5 Account
adding iRule
Has anyone got a more complex iRule to add through iApps? WHen trying the the following iRule into a config I get the following errorscript did not successfully complete: (can't read "source_addr": no such variablewhile executing"set irule_buffer "{when CLIENT_ACCEPTED {set source_addr \[IP::client_addr\]set dest_ip_port \[IP::loca..."invoked from within"if { $irule_firewall == $YES_ANSWER } {set irule_firewall_rule $::basic__irule_firewall_ruleset rule [ split $irule_firewall_rule ; ]..." line:83)
when CLIENT_ACCEPTED {/
set source_addr \[IP::client_addr\]/
set dest_ip_port \[IP::local_addr\]:\[TCP::local_port\]/
log local0. \"Source = $source_addr Dest_IP:Port = $dest_ip_port\"/
set dest_addr \[class match -value -- \[IP::client_addr\] equals test\]/
log local0. \"Class info - $dest_addr\"/
if { $dest_addr != $dest_ip_port || $dest_addr equals \"\" } {/
reject/
log local0. \"Rest connection from $source_addr to $dest_ip_port\"/
}/
}/
I have been playing with this for a while and no matter how I escape the iRule the iApp TCL is treating the iRule Tcl not as a variable but as code to run. Any help would be great.
Richard.