Forum Discussion

AndOs's avatar
AndOs
Icon for Cirrostratus rankCirrostratus
Jun 07, 2016

Exchange iApp and app service name with dots

Hi!

I deployed Exchange iApp v1.5.1 and used our FQDN as App service name, and ran into an issue with the generated snatpool irule.

When connecting to the VIP this error message is logged

TCL error: /Exchange/mail.domain.com_Internal.app/mail.domain.com_Internal_snatpool_irule3
 - can't read "static::snat_ips_domain": no such variable     while executing
"snat $static::snat_ips_mail.domain.com_Internal([expr {[crc32 [IP::client_addr]] % [array size static::snat_ips_mail.domain.com_Internal]}])"

The generated iRule looks like this

when RULE_INIT {
     Use a local array to configure SNAT addresses.
     These addresses do not need to be defined in a SNAT pool or elsewhere.
    set static::snat_ips_mail.domain.com_Internal(0) 10.10.1.151
    set static::snat_ips_mail.domain.com_Internal(1) 10.10.1.152
    set static::snat_ips_mail.domain.com_Internal(2) 10.10.1.153
}
when CLIENT_ACCEPTED {
     Calculate the crc32 checksum of the client IP
     Use the modulo of the checksum and number of SNAT IPs to pick a SNAT IP
    snat $static::snat_ips_mail.domain.com_Internal([expr {[crc32 [IP::client_addr]] % [array size static::snat_ips_mail.domain.com_Internal]}])
}

Just from reading the error it looks like the reference to $static::snat_ips_mail.domain.com_Internal "breaks" after the first dot.

I've tried enclosing the array name in curly braces in different ways but that only produces various syntax errors.

TCL and arrays are not quite what I do every day 🙂 Is there any way to modify the snat statement so that it can reference static::snat_ips_mail.domain.com_Internal?

Thanks

/Andreas

  • Hi Andreas, for now you'll need to remove all the dots from your variable names in RULE_INIT and CLIENT_ACCEPTED. You can either redeploy the iApp using underscores in the name, or disable strictness and replace the dots with underscores in the iRule manually.

     

    This issue is fixed in v1.6.0 of the iApp, which will be released to downloads.f5.com on June 16th.

     

    thanks

     

    Mike

     

  • mikeshimkus_111's avatar
    mikeshimkus_111
    Historic F5 Account

    Hi Andreas, for now you'll need to remove all the dots from your variable names in RULE_INIT and CLIENT_ACCEPTED. You can either redeploy the iApp using underscores in the name, or disable strictness and replace the dots with underscores in the iRule manually.

     

    This issue is fixed in v1.6.0 of the iApp, which will be released to downloads.f5.com on June 16th.

     

    thanks

     

    Mike

     

    • Fred_Slater_856's avatar
      Fred_Slater_856
      Historic F5 Account
      (v1.6.0 does not change the behavior of irules. It simply maps "." to "_" for the variable names in the irule that the iapp constructs)
    • AndOs's avatar
      AndOs
      Icon for Cirrostratus rankCirrostratus
      Great! Thank for the replies! I'll work around it until 1.6 /Andreas