Forum Discussion
sandiksk_35282
Altostratus
Mar 08, 2018allow traffic to VS based on the source IP fwded in the http get request
I need to come up with a design to allow traffic to VS based on the source IP sent in the http get request.
Based on the source IP i need to make a decision whether to allow it or drop it.
Please hel...
Sabir_Alvi
Altocumulus
Mar 09, 2018If you are looking for a whitelist iRule, then below iRule should work fine. You will need to create a datagroup, "Whitelist_IPs" in below example, with all the source IPs you want to allow access. So all http requests which match URL and source IP from whitelist will be allowed, others will get 403.
when HTTP_REQUEST {
if { ([matchclass [string tolower [HTTP::host]] equals "www.sample1.com"]) and !([matchclass [IP::remote_addr] equals "Whitelist_IPs"]) } {
HTTP::respond 403
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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