Determine Source IP and Port
I am totally new to aFlex so naturally, am totally lost.
I have a VIP that I want to capture the sources IP and Port number. I have some success with the following:
when HTTP_REQUEST {
HTTP::header insert "X-Forwarded-For" [IP::client_addr]
}
This gives me the IP but only if it is http, not https (http_request error). Anybody have any ideas on a aFlex script that will give me the IP and Port for both HTTP and HTTPS?
Thanks! AP
I have a VIP that I want to capture the sources IP and Port number. I have some success with the following:
when HTTP_REQUEST {
HTTP::header insert "X-Forwarded-For" [IP::client_addr]
}
This gives me the IP but only if it is http, not https (http_request error). Anybody have any ideas on a aFlex script that will give me the IP and Port for both HTTP and HTTPS?
Thanks! AP
0
Comments
when HTTP_REQUEST {
HTTP::header insert "X-Forwarded-For" [IP::client_addr]:[TCP::local_port]
}
How have you defined your HTTPS VPORT? When do you see that error for HTTPS?
The aFleX event HTTP_REQUEST only works on VPORT types HTTP, HTTPS and most Fast-HTTP, it will not work for VPORT type TCP.
So, if I terminate the SSL on the A10 I can then use the HTTP_REQUEST with HTTPS?
You will see a header like: HTTP_X_FORWARDED_FOR: 53.4.5.5:80
Yes, if you terminate the SSL on the A10 you can use HTTP_REQUEST with HTTPS.
Bad Request - Invalid Header
That's good news about the SSL, thanks.
when HTTP_REQUEST { HTTP::header insert "X-Test-Client" [IP::client_addr]:[TCP::local_port] }