Forum Discussion
Help with iRule filter by ip subnet
Need an iRule for a vip, if client is internal 10.0.0.0 /24 then pool websure else if the are public internet display maintenance page. this is not trggering..
when HTTP_REQUEST { if { [IP::addr [IP::client_addr]/24 equals 10.0.0.0] } { pool websure-pool } else { HTTP::respond 200 content { Site Maintenance Page We are sorry, Websure is currently down for essential maintenance. } } }
1 Reply
Hi Gill,
you may try the iRule below. It uses
syntax to strip route domain suffixes and generates an additional log line for further troubleshooting...[getfield]when HTTP_REQUEST { log local0.debug "Client: [IP::client_addr] Result = [IP::addr [getfield [IP::client_addr] "%" 1] equals "10.0.0.0/24"] (boolean)" if { [IP::addr [getfield [IP::client_addr] "%" 1] equals "10.0.0.0/24"] } then { pool websure-pool } else { HTTP::respond 200 content { We are sorry, Websure is currently down for essential maintenance. } } }Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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