Forum Discussion
Chris_Phillips
Nimbostratus
Feb 16, 2006Forward using hostname as node, not IP
Hi,
I require the ability to create a forwarding server to forward traffic to a hostname rather than an IP address. A third party we are connecting to provides resilience to their syst...
Colin_Walker_12
Feb 16, 2006Historic F5 Account
No problem...
Well, mmoeller is on the right track, if you're looking to do hostname lookups in an iRule. The NAME::lookup command will allow you to do just that.
Something like:
when RULE_INIT {
set ::time [clock clicks -seconds]
}
when HTTP_REQUEST {
if{ [expr {$::time + 30}] <= [clock clicks -seconds] } {
NAME::lookup "hostnametobeused.com"
set ::time [clock clicks -seconds]
} else {
node $::node 80
}
}
when NAME_RESOLVED {
set ::node [NAME::response]
node $::node 80
}
Would probably get you close to where you're trying to go, but I'd be a little concerned about the overhead it would generate, since it would have to process the current time and compare it to the previous one plus the interval (30 in this case). You could possibly set it up so that it only checked every n connections (10, 50, 100, whatever), which might help circumvent this.
Is this the sort of thing you had in mind?
-Colin
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