Forum Discussion
Lou_125071
Nimbostratus
Dec 09, 2014Load balance to specific pool by reading the X-Forwarded-For IP address
I've been asked if we can send specific client to a different pool based on the X-Forwarded-For IP address. I suspect this must be done via an IRule. Any help would be appreciated.
Thanks
nitass
Employee
Dec 09, 2014you can retrieve x-forwarded-for header value by using HTTP::header command and then you can do whatever you want e.g. send to specific node (node command) or pool (pool command), etc.
HTTP::header
">https://devcentral.f5.com/wiki/iRules.HTTP__header.ashx" target="_blank">">https://devcentral.f5.com/wiki/iRules.HTTP__header.ashx
Lou_125071
Nimbostratus
Dec 10, 2014Thanks this worked by just ORing the other IP addresses. I was going to try and do it with a data group list which was why I was having trouble getting it to work. I'll probably also add the real client IP in case the IP comes in not in the X-Forwarded-For.
Thanks again for the help
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