Forum Discussion
Bciesz_171056
Cirrus
Aug 21, 2017iRule if based on incoming IP
Hi,
I have a problem here... I'm trying to make an iRule perform specific action if incoming traffic comes from a specific IP address. I have:
if {[IP::addr [IP::client_addr] equals 10.8.199...
Stanislas_Piro2
Cumulonimbus
Aug 21, 2017Hi,
you can extract Route domain and IP Address with split and compare it with IP::addr (useful if you need to compare network with netmask evaluation)
elseif {$incURI contains "csmon"}{
set _redirect "0"
log local0. "IDMS test Monitoring: [HTTP::uri]"
log local0. "IDMS test inc IP: [IP::client_addr]"
lassign [split [IP::client_addr] "%"] IP_addr rd
if {[IP::addr $IP_addr equals "10.8.199.231"] && $rd equals [ROUTE::domain]} {
log local0. "IDMS dupa"
}
}
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