Forum Discussion
Chris_Day_10331
Nimbostratus
Jun 08, 2006Raw TCP Insert
Guys,
I am working with a new potential client for F5 who has a requirement where they want to insert:
$client_ip:
..at the start of the data payload portion of the TCP request sent to the server, before the rest of the data. The TCP data sent to the client is a long-lived stream (like Citrix) which may be open for hours or even days.
The incoming port, while not important, is 7900 - it is not HTTP but rather a custom sockets-based application. This will be phased out in future versions of the code, as we are now able to provide the client IP natively (i.e. the SRC IP TCP header will now be valid where currently it is presented as the SrcIp of the (legacy) load balancer.
I found "TCP::payload replace" but wouldn't know enough on how to use it! In human code, I guess it would look like this:
1) Take the original TCP data and prepend it "$client_ip:" (Client IP address + semi colon)
2) Send the rest of the data as is to the server and change nothing further
Is this a simple iRule? Can someone help me craft it?
Time is somewhat of the essence because this is a sales situation and this is the last remaining piece of the puzzle. On a good note, I keep getting smarter every time I post a question and someone answers - maybe someday I won't have to ask... probably not. Thanks guys!
Chris
- Chris_Day_10331
Nimbostratus
Guys,rule my_tcp_insert { when SERVER_CONNECTED { TCP::collect 1 TCP::payload replace 0 0 ";" TCP::payload replace 0 0 [clientside {IP::remote_addr}] } }
- Colin_Walker_12Historic F5 AccountSomething like this, I'd wager:
TCP::payload replace 0 0 "[clientside {IP::remote_addr} ];"
- Chris_Day_10331
Nimbostratus
Thank you! Now we found a bit of a problem... - bl0ndie_127134Historic F5 AccountHow about some thing like this.
when SERVER_CONNECTED { TCP::respond "[clientside {IP::remote_addr}];" }
- Chris_Day_10331
Nimbostratus
This worked like a charm! We are now rocking! - syedimam_147051
Nimbostratus
Hi Chris I am heaving same problem. One of my client wants to load balance protective monitoring application based on google buffer and wants to keep original source ip address. They don't want TCP option header to be used and just want to relay the traffic. I tried following irule with standard tcp profile in a test environment for standard http based application and it doesn't work. when SERVER_CONNECTED { TCP::respond "[clientside {IP::remote_addr}];" } Any help would be apprecaited. Thannks Syed
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects