bindummawat
Sep 28, 2023Altostratus
iRule giving error: rule [/common/ecs_rule] error: /common/ecs_rule:6: error: [undefined procedure:
Hi
I am trying to run a setup with GTM.
Here I have ECS enabled on client requesting DNS query. Behind F5 I have 2 DNS server configured. Now I can see the packet recived by F5 has client subnet information.
But F5 still round robin between the server while selecting the server for a query. I want to forward request to a particluar server instead of round robin based on Client Subnet value. For example if client subnet is
172.31.177.0, send it to server 172.30.112.9 else send it to 172.30.112.8
I am trying to create iRule like below but am not able to create it as getting error: rule [/common/ecs_rule] error: /common/ecs_rule:6: error: [undefined procedure: host]
Any suggestion or way to create this setup?
when DNS_REQUEST {
if { [DNS::edns0 exists] } {
# log local0. [DNS::edns0 subnet address]"
set ecs_address [DNS::edns0 subnet address]
if { $ecs_address == "172.31.177.0" } {
log local0. "Received EDNS request from [IP::client_addr]:$ecs_address"
host 172.30.112.9
}else {
log local0. "Received EDNS request from [IP::client_addr]:$ecs_address"
host 172.30.112.8
}
}
}