Forum Discussion

sanjay_01_13396's avatar
sanjay_01_13396
Icon for Nimbostratus rankNimbostratus
Oct 09, 2013

iRule to add Remote address in TCP header

Is it possible to add remote address in TCP header with the help of iRule, If so can someone help?

 

4 Replies

  • uni's avatar
    uni
    Icon for Altocumulus rankAltocumulus
    ltm rule server-ip-header {
        when SERVER_CONNECTED {
            HTTP::header insert serveraddress [IP::server_addr]
        }
    }
    
  • Hi uni,

     

    Thanks for reverting, unfortunately this is not HTTP traffic, is it possible to add the remote address in TCP header instead of HTTP header?

     

    • uni's avatar
      uni
      Icon for Altocumulus rankAltocumulus
      I don't know what you mean by TCP header. If you want to modify the TCP payload, you will need to use the TCP::payload command. How you do that depends on your application and the structure of your data. Have a look at this page: https://clouddocs.f5.com/api/irules/TCP__payload.html
  • Using TCP::payload replace may be a solution, but as Uni points out it depends on the application, its data structure, and when and where you want to insert the new data. That said, in the truest sense, the TCP::payload command really only works on payload and not actual TCP headers. To get to the TCP headers, the options fields specifically, you could use the TCP::options set command. Again though, this is all rather dependent on the data structure. If you could give us some more information it might help.