Forum Discussion
venom43212_9610
Nimbostratus
Aug 04, 2011iRule to Filter on X-Netli-Forward-For value
I am trying to create an iRule that will look at the X-Netli-Forward-For value, and if it matches an IP address, it is forwarded on, if it does not, it is dropped. Basically, I only want to allow a gl...
hoolio
Cirrostratus
Aug 04, 2011If you create an address type datagroup you can use an iRule like this. Keep in mind that users can insert any arbitrary header. So if someone knew you were using this kind of logic they could bypass it.
when HTTP_REQUEST {
Check if the XFF header is set and not null
if {[HTTP::header X-Netli-Forward-For] ne ""}{
Look up the value in the allowed_ips_class datagroup
if {not [class match [IP::client_addr] equals allowed_ips_class]}{
Reset the connection
reject
}
}
}
Aaron
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