Forum Discussion
Andrea_361
Nimbostratus
Oct 22, 2009URI access restricted to ip subnet
hi people,
I have F5 running version 9.4.7 , I try to implement iRule in order to limit access to defined URI only to internal subnet, but i'm unable to obtain the correct result, the URI is allowed or denied without care on ip class and subnet defined.
Anyone can check my iRule syntax, and/or give me suggestion?
Thanks in advance!
the following is my iRule script:
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/cms/" }{ if {not [matchclass [IP::client_addr] equals $::Agusta_internal]} { log local0. "[IP::client_addr]:[TCP::local_port]: Matched IP check. Discarding request to [HTTP::uri]" drop } } }
4 Replies
- hoolio
Cirrostratus
Hi Andrea, - hoolio
Cirrostratus
Is the datagroup defined as a type 'address'? Can you add more logging to the iRule and retest?when HTTP_REQUEST { log local0. "[IP::client_addr]:[TCP::local_port]: New [HTTP::method] request to [HTTP::host][HTTP::uri]" if { [HTTP::uri] starts_with "/cms/" }{ log local0. "[IP::client_addr]:[TCP::local_port]: Matched URI check. Class contents: $::Agusta_internal" if {not [matchclass [IP::client_addr] equals $::Agusta_internal]} { log local0. "[IP::client_addr]:[TCP::local_port]: Matched IP check. Discarding request to [HTTP::uri]" drop } } }
- Andrea_361
Nimbostratus
Yes, is defined as address, tomorrow I'll be able to retest and give more info. - hoolio
Cirrostratus
Can you test this on a test VIP so it doesn't affect any live traffic? If so, can you add the iRule example I posted above and reply with the output from /var/log/ltm?
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