Forum Discussion
ottleydamian
Cirrus
Sep 03, 2019Block request based on domains
In migrating from Microsoft TMG to F5 I noticed that the TMG allowed/blocked users based on domains and not IP addresses. This is specific for MS Exchange EWS service. I don't have a test F5 device. ...
Sep 03, 2019
Hi ottleydamian,
Line 2 is not valid. You can create a data-group and use it in iRule.
Data-group:
ltm data-group internal domain_list {
records {
abc.domain.com { }
xyz.mydomain.com { }
qwerty.mydomain.com { }
}
type string
}
iRule:
when HTTP_REQUEST {
if { not ([class match [string tolower [HTTP::host]] equals domain_list]) } {
log local0. "Rejected domain [HTTP::host]"
reject
# or
# HTTP::respond 404 noserver content "<html>...</html>"
}
}
The system applies iRules in the order in which it appears in list. You can use "priority" command.
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