Forum Discussion
spalande
Nacreous
Sep 23, 2013Need help for iRule
Need help on iRule for mapping private IP hosted on GTM (A record) to public IP (owned by customer DMZ).
eg. 192.168.4.242 is the private IP hosted on GTM, while sending DNS response need to map...
StephanManthey
Nacreous
Sep 25, 2013Testing for A records in the response is already build in and would be logged:
when DNS_REQUEST {
if {[DNS::question type] ne "A"} {
log local0. "incoming query for [DNS::question name] is of type [DNS::question type]"
}
}
when DNS_RESPONSE {
foreach item [DNS::answer] {
if {[DNS::type $item] eq "A"} {
log local0. "[DNS::rdata $item]"
log local0. "[DNS::type $item]"
if { [class match -value [DNS::rdata $item] equals dg_internal_external] eq "" } {
log local0. "no match for internal A record [DNS::rdata $item]"
DNS::rdata $item 10.141.141.10
} else {
log local0. "[class match -value [DNS::rdata $item] equals dg_internal_external]"
DNS::rdata $item [class match -value [DNS::rdata $item] equals dg_internal_external]
}
} else {
log local0. "[DNS::type $item]"
}
}
}
The log will show now:
incoming query for test.lb-net.bit is of type AAAAHelp guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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