Forum Discussion
kh1
Nov 23, 2023Nimbostratus
specific internet source IP & internal IP allow
Hello, 1. we have requirement to allow specific 4 public source IP along with private internal IP's to access specific URI path. example: specific URI/path https://xyz.com/function/party/functi...
Daniel_Wolf
Nov 25, 2023MVP
Hi kh1,
this iRule should do. With or without ASM.
when HTTP_REQUEST priority 500 {
set content "<html>
<head>
<title>Go away!</title>
</head>
<body>
<h1>Go away!</h1>
<p>This page is for authorized users only.</p>
</body>
</html>"
if { ([HTTP::host] eq "hostname.xyz.com") and ([HTTP::uri] starts_with "/function/party/function-engine/v2/fuction/events-messages") } {
switch -glob -- [class match [IP::client_addr] eq dg_allowed_ipaddress] {
"1" {
return
}
default {
HTTP::respond 403 -version auto content $content noserver
}
}
} else {
return
}
unset -- content
}
You need a datagroup of the type Address, in this iRule called dg_allowed_ipaddress.
KR
Daniel
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