Forum Discussion
Mike_61640
Sep 01, 2012Nimbostratus
iRule to check Datagroup for allowed servers through a default VS
I'm sure there is a posting here that has an iRule that will check a datagroup or list of servers to see if they are allowed through a Virtual Server. Like to control traffic between two internal seg...
Mike_61640
Sep 02, 2012Nimbostratus
I found a solution to this by customizing an iRule based on other posts I found. Here is the rule that I used. The Datagroups are just a list of server IPs using an Datagroup with type "Address".
when CLIENT_ACCEPTED {
Is client IP address defined in the FE datagroup?
if { [class match [IP::client_addr] equals sj01-fe-servers] }{
Log the client IP address:port -> destination IP address:port
log local0. "admin request accepted from client: \
[IP::client_addr]:[TCP::client_port] -> [IP::local_addr]:[TCP::local_port]"
} elseif { [class match [IP::client_addr] equals sj01-strongmail-servers] }{
Client IP address is defined in the strongmail datagroup
Log the client IP address:port -> destination IP address:port
log local0. "restricted client request accepted from client: \
[IP::client_addr]:[TCP::client_port] -> [IP::local_addr]:[TCP::local_port]"
} else {
Request didn't match the conditions for allowing the request
Log the client IP address:port -> destination IP address:port
log local0. "unknown request rejected from client: \
[IP::client_addr]:[TCP::client_port] -> [IP::local_addr]:[TCP::local_port]"
drop
}
}
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