Forum Discussion
Nomar-13
Feb 16, 2024Nimbostratus
irule to Redirect client from specific Public IP to a specific node
Hello, I have a virtual server that is accessible by users on the internet with one pool. This pool has 2 nodes. I have a scenario where I need users coming from a specific PUBLIC IP to go to a ...
- Feb 17, 2024
Hi Nomar-13
If the public IP is just a single IP and not a range, you do not want IP::addr as that is used for comparisons. Try something like this instead:
when CLIENT_ACCEPTED { if { [IP::client_addr] == '192.168.1.100' } { set matched_ip 1 } else { set matched_ip 0 } } when HTTP_REQUEST { if { $matched_ip } { node 10.10.1.1 80 } else { node 10.10.1.2 80 } }
JRahm
Feb 17, 2024Admin
Hi Nomar-13
If the public IP is just a single IP and not a range, you do not want IP::addr as that is used for comparisons. Try something like this instead:
when CLIENT_ACCEPTED {
if { [IP::client_addr] == '192.168.1.100' } {
set matched_ip 1
} else { set matched_ip 0 }
}
when HTTP_REQUEST {
if { $matched_ip } {
node 10.10.1.1 80
} else { node 10.10.1.2 80 }
}
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