Forum Discussion
How to Preserve Source IP in non HTTP/HTTPS TCP Virtual Server
Our Customer has the demand that they want the Source IP address of Client who want to access one of their Application which is non HTTP/HTTPs , mean while i have follow different threads of Devcentral and prepare the below irule.
But still i am unable to preserve Client IP as Customer server didn't receive Source IP in the request from F5.
when CLIENT_ACCEPTED {
set opt28 [TCP::option get 28]
if { [string length $opt28] == 5 } {
binary scan $opt c ver
if { $ver != 1 } {
log local0. "Unsupported Akamai version: $ver"
} else {
set optaddr [IP::addr parse $opt28 1]
}
}
}
when SERVER_CONNECTED {
scan [IP::client_addr] {%d.%d.%d.%d} a b c d
TCP::option set 29 [binary format cccc $a $b $c $d] all
}
1 Reply
- Yoann_Le_Corvi1
Cumulonimbus
Hi
Haven't tried in live on a lab, and not yet 100% sure it's possible. But give it a try with snat command
https://clouddocs.f5.com/api/irules/snat.html
Instead of manipulating the tcp payload directly.
Yoann
Recent Discussions
Related Content
* 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