Forum Discussion
ScottG_33396
Nimbostratus
Nov 30, 2006get and replace
OK all you gurus. Here's what i want to do. I want to get data from http::header "X-Forwarded-For" and replace the data in client_addr with what I get from X-Forwarded-For. I need to grab th IP found ...
ScottG_33396
Nimbostratus
Dec 05, 2006OK, I did some seraching and came up with this iRule:
when HTTP_REQUEST {
HTTP::header insert "source_addr" [HTTP::header "X-Forwarded-For"]
}
The problem is that it puts "source_addr" and the IP from the X-Forwarded-For under "HTTP: GET Request from Client" in the packet. I need for the IP from X-Forwarded-For to replace IP: Source Address = x.x.x.x under IP: Protocol in the packet.
I tried:
when HTTP_REQUEST {
IP::header insert "Source Address" [HTTP::header "X-Forwarded-For"]
}
But of course get the error:
01070151:3: Rule [forwrd] error:
line 2: [undefined procedure: IP::header] [IP::header insert "Source Address" [HTTP::header "X-Forwarded-For"]]
Can you steer me in the right direction.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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