Forum Discussion

Vladimir_Shishk's avatar
Vladimir_Shishk
Icon for Altocumulus rankAltocumulus
May 19, 2021
Solved

Routing problem for connect() in iRule

Good day.

I have an iRule script which must send email via connect command through corporate Exchange server:

set conn [connect -timeout 3000 -idle 30 -status conn_status -myaddr 127.1.1.254 $mailserv]

set data "HELO\r\nMAIL FROM: $mailfrom\r\nRCPT TO: $email\r\nDATA\r\nSUBJECT: S3 rate limit exceeded 3000 bytes/s\r\nMIME-Version: 1.0;\r\nContent-Type: text/html;charset=iso-8859-1;\r\n\r\n\r\nRate limit exceeded for $mycookie\r\n\r\n.\r\nQUIT\r\n"

set send_info [send -timeout 3000 -status send_status $conn $data]

I can connect to 25 port of Exhange server in corresponding partition:

 # telnet x.y.z.25 25 -b 127.1.1.254
Trying x.y.z.25...
Connected to x.y.z.25.
Escape character is '^]'.
220 ZZZZ Microsoft ESMTP MAIL Service ready at Wed, 19 May 2021 16:10:42 +0300
^C^]

But in LTM log I got the errors:

 <CLIENT_CLOSED> - Connection failed for x.y.z.25:25 [Routing problem] (line 2)     invoked from within "connect -timeout 3000 -idle 30 -status conn_status -myaddr 127.1.1.254"

What should I do to fix the problem?

Thank you.

  • Hi Vladimir,

     

    Have you checked if the TMOS interfaces have access to the mailserver IP using TMOS routes? (Under "Network - Routes" in the GUI)

    As the "telnet" command is run from the management side, it may use either the management interface or a TMOS interface for outbound traffic, whereas the iRules will only use TMOS interfaces for communication.

     

    Here is more details on the (sometimes tricky) management routing; https://support.f5.com/csp/article/K13284

     

    Hope this helps.

     

3 Replies

  • Hi Vladimir,

     

    Have you checked if the TMOS interfaces have access to the mailserver IP using TMOS routes? (Under "Network - Routes" in the GUI)

    As the "telnet" command is run from the management side, it may use either the management interface or a TMOS interface for outbound traffic, whereas the iRules will only use TMOS interfaces for communication.

     

    Here is more details on the (sometimes tricky) management routing; https://support.f5.com/csp/article/K13284

     

    Hope this helps.

     

    • Vladimir_Shishk's avatar
      Vladimir_Shishk
      Icon for Altocumulus rankAltocumulus

      Hi, Alex, thank you for your answer.

      I added a static route to mailserver through Common partition and mailserver stopped to become unreachable, thank you.

      • AlexBCT's avatar
        AlexBCT
        Icon for Cumulonimbus rankCumulonimbus

        Hi Vladimir,

         

        Glad to hear it got solved and nice job on the syntax troubleshooting ;)

        Would be great if you can flag the question as Answered so it may be closed and help the rest of the community.