Forum Discussion
Kmussa_164917
Nimbostratus
Dec 20, 2015GTM Private to Public Translation
I have a GTM in DMZ using private IP addresses for wide IP. I need to translate the 1st three octets of the wide IPs to public addresses. I believe I have to use an irule to accomplish this. I tried ...
Kai_Wilke
MVP
Dec 21, 2015Hi Kmussa,
customized Hamish Marson's "GTM traslation" iRule for you needs...
Original iRule can be found here: https://devcentral.f5.com/wiki/iRules.GTM-Translation.ashx
when DNS_RESPONSE {
foreach rr [DNS::answer] {
if { ([DNS::type $rr] eq "A") } then {
if { [IP::addr [DNS::rdata $rr] equals 10.10.10.0/24]) } then {
log -noname local0.debug "DNS Rewrite: [DNS::rdata $rr] > 1.1.1.[getfield [DNS::rdata $rr] "." 4]"
DNS::rdata $rr "1.1.1.[getfield [DNS::rdata $rr] "." 4]"
} elseif { [IP::addr [DNS::rdata $rr] equals 20.20.20.0/24]) } then {
log -noname local0.debug "DNS Rewrite: [DNS::rdata $rr] > 2.2.2.[getfield [DNS::rdata $rr] "." 4]"
DNS::rdata $rr "2.2.2.[getfield [DNS::rdata $rr] "." 4]"
}
}
}
}
Note: I don't have a GTM to my hands, hope it will work out... 🙂
Cheers, Kai
Help 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