Forum Discussion
How to restrict a url access from a specific two ip's
only IPs 104.123.3.1 and 117.23.2.1 can acces to path "/abc/update". remainng Ip connections from internet towards acess path "/abc/update" should be droped/blocked
Thanks for confirming.
I made a few minor adjustments to fix syntax issues, but this should work:
when HTTP_REQUEST {
if { [HTTP::path] contains "/abc/update" and (([IP::addr [IP::client_addr] equals 104.123.3.1]) or ([IP::addr [IP::client_addr] equals 117.23.2.1])) } {
}
else {
reject
}
}- CHRISTY_THOMASJan 05, 2024
Cirrus
i have checked in my application. while i am calling this irule in VS the other url's pertaining to the application also not loading in the browser
- CHRISTY_THOMASJan 05, 2024
Cirrus
i have checked LTM logs also below error recieving:
tmm[9714]: 01220001:3: TCL error: /Common/UIp_TEST <HTTP_REQUEST> - invalid command name "if{/" while executing "if{[HTTP::path] contains "/uHi/upjateMobShSRrq" and (([IP::addr [IP::client_addr] equals 1XX.250.X0.X]) or ([IP::addr [IP::client_addr] equals 1XX.1XX..."
- Jan 05, 2024
Try this:
when HTTP_REQUEST { if { [HTTP::path] contains "/abc/update" and !(([IP::addr [IP::client_addr] equals 104.123.3.1]) or ([IP::addr [IP::client_addr] equals 117.23.2.1])) } { reject } } }
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
