Forum Discussion
Cleiton_Lobo_de
Nimbostratus
Sep 21, 2019Allow access to URI-based Internet specific URL
I am trying to develop an irule whereby access to a specific URL is allowed only when a specific URL is presented .
The URL specifies abc.domain.com/marketplace must be available for external and internal network.
Other all URLs abc.domain.com/* must be available for internal network only (rfc 1918 addresses)
regards
Hi,
Can you try this iRule?
when HTTP_REQUEST { if { [HTTP::host] equals "abc.domain.com"} { if { not ([string tolower [HTTP::uri]] starts_with "/marketplace") } { switch -glob [IP::client_addr] { "10.*" - "192.168.*" - "172.16.*" - "172.17.*" - "172.18.*" - "172.19.*" - "172.20.*" - "172.21.*" - "172.22.*" - "172.23.*" - "172.24.*" - "172.25.*" - "172.26.*" - "172.27.*" - "172.28.*" - "172.29.*" - "172.30.*" - "172.31.*" { # log local0. "Host: [HTTP::host] Uri: [HTTP::uri] ClientIP: [IP::client_addr]" } default { reject } } } } else { reject } }
- Cleiton_Lobo_de
Nimbostratus
Thanks guy!
Worked perfectly.
Regards!
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