For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Matthew_Gamble_'s avatar
Matthew_Gamble_
Icon for Nimbostratus rankNimbostratus
Mar 12, 2009

TFTP Server?

Is it possible to write a simple TFTP server as an iRule to return static content? I see some examples for load balancing TFTP requests, but not for actually acting as a TFTP server. I have a very small and static TFTP file that I need to distribute, and rather than running a dedicated TFTP server it would be far better if it could be deployed as an iRule.

 

 

Is this possible? Any resources I should be looking at?

25 Replies

  • Yeah, I read the RFC the same way, the server really should ack each segment before sending the next block. I'll work on completing the implementation for future use cases, but it will be a little while.
  • James_Quinby_46's avatar
    James_Quinby_46
    Historic F5 Account
    Now if you guys can just figure out a way to serve the LTM ISO from a datagroup, you could build an "Enterprise Manager in an iRule" rule! :D

     

     

     

    Hmmm....
  • What format are you putting the file on disk in? I've tried text, binary, and hex, but I keep getting this error:

     

     

     

    Mar 23 15:24:54 tmm tmm[13663]: Rule Test-TFTP_Server : Opcode is 1

     

    Mar 23 15:24:54 tmm tmm[13663]: Rule Test-TFTP_Server : String is test.txtÀnetasciiÀ

     

    Mar 23 15:24:54 tmm tmm[13663]: Rule Test-TFTP_Server : File is test.txt, Mode is netascii

     

    Mar 23 15:24:54 tmm tmm[13663]: Rule Test-TFTP_Server : Block is integer, no increment necessary

     

    Mar 23 15:24:54 tmm tmm[13663]: 01220001:3: TCL error: Rule Test-TFTP_Server - expected hexadecimal string but got "M2M2NjZjNjE3NDJkNzA3MjZmNjY2OTZjNjUzZWRhMjAyMDNjMjEyZDJkMjA0MzZmNmU2NjY5Njc3NTcyNjE3NDY5NmY2ZTIwNTA3MjZmNjY2OTZjNjUyMDRkNDcyMDJkMjA0ZDYxNzI2MzY4MjAzMjMzNzI2NDJjMjAzMjMwMzAzOTIwMmQyZDNlZGEyMDIwM2M1MDcyNmY3NjY5NzM2OTZmNmU1ZjQ1NmU2MTYyNmM2NTIwMjAyMDIwMjAyMDIwMjAyMDIwMjAyMDIwMjAyMDIwMjA3NTYxM2Q1YzIyNmU2MTVjMjIzZTU5NjU3MzNjMmY1MDcyNmY3NjY5NzM2OTZmNmU1ZjQ1NmU2MTYyNmM2NTNlZGEyMDIwM2M1MjY1NzM3OTZlNjM1ZjRmNmU1ZjUyNjU3MzY1NzQyMDIwMjAyMDIwMjAyMDIwMjAyMDIwMjAyMDIwMjAyMDIwMjA3NTYxM2Q1YzIyNmU2MTVjMjIzZTU5NjU3MzNjMmY1MjY1NzM3OTZlNjM1ZjRmNmU1ZjUyNjU3MzY1NzQzZWRhMjAyMDNjNTI2NTczNzk2ZTYzNWY1MjYxNmU2NDZmNmQ1ZjQ0NjU2YzYxNzkyMDIwMjAyMDIwMjAyMDIwMjAyMDIwMjAyMDIwNzU2MTNkNWMyMjZlNjE1YzIyM2UzMjNjMmY1MjY1NzM3OTZlNjM1ZjUyNjE2ZTY0NmY2ZDVmNDQ2NTZjNjE3OTNlZGEyMDIwM2M1MjY1NzM3OTZlNjM1ZjUwNjU3MjY5NmY2NDY5NjMyMDIwMjAyMDIwMjAyMDIwMjAyMDIwMjAyMDIwMjAyMDIwMjA3NTYxM2Q1YzIyNmU2MTVjMjIzZTMwM2MyZjUyNjU3Mzc5NmU2MzVmNTA2NTcyNjk2ZjY

     

     

    I followed the directions in http://devcentral.f5.com/wiki/default.aspx/iRules/LTMMaintenancePage.html and it's all on a single line. I'm sure I'm doing something pretty stupid, but if anyone could point me in the right direction it would be greatly appreciated.

     

     

    Thanks!
  • James_Quinby_46's avatar
    James_Quinby_46
    Historic F5 Account
    mgamble -

     

     

    See here:

     

     

    http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=343

     

     

    ...for a more complete writeup on the iRule, including a link that will do the hex encoding of the file.

     

     

  • Hi there, nice solution.

     

    I'm trying to change this irule to make use of ifiles instead of hex/string converted files/arrays. Anyone manage to do this already, i'm kind of stuck on the part where i divide the binary (ifile) into 512 byte chunks....