Forum Discussion
Stef_85923
Nimbostratus
Jul 29, 2011HSS header modification
I am trying to create an iRule wihci will affect the HSS header, the source IP will be be inserted in the new customer header (x-hss-auth) with a new on net/offnet flag. The iRule logic is the follw...
Kevin_Davies_40
Nacreous
Aug 02, 2011Hi,
From what i can see there are a few issues with the code above.
[IP::x-wsbsourceip, 0.0.0.1] is not a valid command. You cannot use IP:: with whatever variable name you are using. Its a specific command or nothing. [IP::client_addr] is valid command and will return the clients IP address.
[IP::client_addr, 0.0.0.1] is not a valid command. IP::client_addr command does not accept any parameters at all. Only [IP::client_addr] is valid.
foreach name $ x-wsbsourceip { should read...
foreach name $x-wsbsourceip {
You have a space between the $ and the variable name. The subsequent lines have the same problem.
This following block of code handles the CLIENT ACCEPTED event but it does nothing...
when CLIENT_ACCEPTED {
go through request and remove all instances of the unwanted headers
(X-Net-Info, X-Forwarded-For in this example)
foreach header {X-Net-Info X-Forwarded-For} {
log local0. "Removing $header: [HTTP::header value $header ]"
HTTP::header remove $header
}
Assuming the last line with "}" is in error... the subsequent commands cannot be used. The CLIENT_ACCEPTED event is a TCP event (OSI layer 3) and not a HTTP (OSI layer 7) so IP::client_addr is valid where HTTP::header is not. HTTP is layer 7 and only available inside the HTTP events.
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
