GTM Monitors internal LTM, but I need Public IP as Answer
Problem this snippet solves: A WideIP is linked to an LTM Virtual Server that uses Internal IP Addresses. the DNS should reply with External IP addresses. although its possible via gui, its quiet tr...
Published Feb 16, 2017
Version 1.0Mustaki_64997
Nimbostratus
Joined April 04, 2011
Mustaki_64997
Nimbostratus
Joined April 04, 2011
Stanislas_Piro2
Nov 02, 2018Cumulonimbus
If you want to rewrite the answer data, you can replace rdata without deleting it, and create a array with NAT values.
when RULE_INIT {
array set static::DNS_NAT {
a.a.a.a b.b.b.b
c.c.c.c d.d.d.d
}
}
when DNS_RESPONSE {
set rrs [DNS::answer]
foreach rr $rrs {
if { [DNS::type $rr] == "A" && [DNS::class $rr] == "IN"} {
if { [info exists static::DNS_NAT([DNS::rdata $rr])]} {
DNS::rdata $rr $static::DNS_NAT([DNS::rdata $rr])
}
}
}
}