Forum Discussion
AngryCat_52750
Nimbostratus
Oct 28, 2014FTP irule to resolve hostname
i have a request to build an FTP LTM VIP that will need to resolve a hostname to an IP address. i have a working example for http transaction and i need help with the ftp variables.
essentially, the server will call the VIP by an internal DNS entry, the irule was look up the end point name and resolve an IP and send it to that address.
Can someone help with the FTP portion?
when CLIENT_ACCEPTED {
set address [RESOLV::lookup @/Common/VS_DNS -a "example.company.com"]
log local0. "DNS lookup for example.company.com returned $address"
}
when HTTP_REQUEST {
set host_used [HTTP::host]
set uri_used [HTTP::uri]
set node_used [lindex $address 0]
HTTP::header replace Host "example.company.com"
log local0. "[IP::client_addr] sent request $host_used $uri_used to $node_used $uri_used"
}
4 Replies
- R_Eastman_13667Historic F5 Account
Try adding the "node"command to send traffic to the node in the $address variable.
when HTTP_REQUEST { set host_used [HTTP::host] set uri_used [HTTP::uri] set node_used [lindex $address 0] HTTP::header replace Host "example.company.com" node ${node_used} 21 log local0. "[IP::client_addr] sent request $host_used $uri_used to $node_used $uri_used" }- AngryCat_52750
Nimbostratus
so in my example, i am using a HTTP_Request event.. would it also work with FTP??
- R_Eastman_13667Historic F5 Account
You could try:
when CLIENT_ACCEPTED { set address [RESOLV::lookup @/Common/VS_DNS -a "example.company.com"] set node_used [lindex $address 0] node ${node_used} 21 log local0. "DNS lookup for example.company.com returned $address" }- AngryCat_52750
Nimbostratus
Thanks.. i shall give that a try..
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