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 24, 2013I´ve tried to solve it with catch in a single-line but still got TCL errors.
(Probably due to the nesting.) This one works now and inserts an A record for a sorrypage in case of no match: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]"
}
}
}
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