I have an IP subnet in meeting_redirect-ip. If the users subnet is equat to that subnet, I want to redirect them to meet.contractor.com. If the IP address does not match, I want the request to forward to the pool members.
I keep getting command is vaid in current event context.
when CLIENT_ACCEPTED {
if { ![class match [IP::client_addr] equals meetingplace_redirect_ip] }{
The HTTP filter haven’t been hit in CLIENT_ACCEPTED so you won’t be able to use HTTP commands there. You can do a check of the client IP once per connection in CLIENT_ACCEPTED and send a redirect in HTTP_REQUEST. Or you could just move the code to HTTP_REQUEST.
If you’ve defined the subnets in an address type data group, a bitwise comparison is done using class match.
when HTTP_REQUEST {
if { not [class match [IP::client_addr] equals meetingplace_redirect_ip] }{
HTTP::redirect "https://meet.contractor.com"
}
}