Forum Discussion
Jonathan_Robins
Nimbostratus
Aug 26, 2010GTM iRule to block certain IPs DNS Query of a WideIP
Hello
I need to stop a GTM Wide IP from responding to client IPs unless they are in a whitelist.
Ideally the GTM would respond with an NSDOMAIN rather than drop the request.
I am trying the following but am not having much luck, can anyone offer any help.
when DNS_REQUEST {
if {[matchclass [IP::remote_addr] ne $::ip_allowed_datagroup]} {
drop
}
}
Error: 01070151:3: Rule [hello] error: line 2: [undefined procedure: matchclass] [matchclass [IP::remote_addr] ne $::ip_allowed_datagroup]
Many thanks
Jonathan
- The_Bhattman
Nimbostratus
Hi Jonathan,when DNS_REQUEST { if { ![matchclass [IP::remote_addr] eq $::ip_allowed_datagroup] } { drop } }
when DNS_REQUEST { if { [matchclass [IP::remote_addr] eq $::ip_allowed_datagroup] } { } else { drop } }
- Jonathan_Robins
Nimbostratus
Thanks for the reply Bhattman, I now get the following error:
01070151:3: Rule [GAM_block_non_intranet_dns_query] error: line 1: [undefined procedure: matchclass] [matchclass [IP::remote_addr] eq $::ip_allowed_datagroup]
- Jonathan_Robins
Nimbostratus
I had to make one further change as for some reaon the IP:addrr match was not matching a client ip to a subnet/mask. - Chris_Miller
Altostratus
Can you try this syntax for matchclass?when DNS_REQUEST { if { ![class match [IP::client_addr] eq ip_allowed_datagroup] } { cname "somewhere.else" } }
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