Forum Discussion
walt_97468
Nimbostratus
Feb 09, 2010inbound requests for FTP and sFTP
We have a need to send requests to different nodes within a pool, based on source IP address. For example if a request comes in from 172.16.95.5 send it to node 192.168.1.10, and if the request comes from 172.16.95.6, send it to 192.168.1.11. Here's what I have:
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 172.16.95.5] } {
use node 192.168.1.10
}
if { [IP::addr [IP::client_addr] equals 172.16.95.6] } {
use node 192.168.1.11
}
}
Will this work for inbound FTP request as well as sFTP (SSH)? How do I differentiate between these inbound protocols?
Any assistance is appreciated!
Walt
- The_Bhattman
Nimbostratus
Hi Walt,when CLIENT_ACCEPTED { if { [IP::addr [IP::client_addr] equals 172.16.95.5] } { node 192.168.1.10 21 } else if { [IP::addr [IP::client_addr] equals 172.16.95.6] } { node 192.168.1.11 21 } }
- hoolio
Cirrostratus
As SFTP and FTP run on separate ports, ideally, you'd configure a separate VIP for SFTP on port 22 and a VIP on 21 for FTP. For the FTP VIP you can add an FTP profile to allow LTM to handle the data channel natively. - walt_97468
Nimbostratus
Hoolio, Basically, we are migrating clients from an FTP/sFTP server to another box. As cleint's are migrated, we would send traffic based on that client's source address to either the existing FTP/sFTP node or the new FTP/sFTP node. So we would enable all ports on the Big IP VIP, and would only allow certain ports thru the firewall for this, as per the source IP address. We wouldn't do any port checking on the Big IP. - hoolio
Cirrostratus
If that's the case, I think you could use bhattman's iRule and remove the port on the node commands. If you don't specify a port on the node command, I believe LTM will not do destination port translation (and just use the same destination port the client used on the connection to the node address). - walt_97468
Nimbostratus
Aaron, I'd like to try the datagroups idea. We are still running version 9.2.3. Please advise and thanks! - The_Bhattman
Nimbostratus
Hi Walt,class net1 { 172.16.95.5 255.255.255.255 } class net2 { 172.16.95.6 255.255.255.255 }
when CLIENT_ACCEPTED { if { [matchclass [IP::client_addr] equals $::net1] } { node 192.168.1.10 } else if { [matchclass [IP::client_addr] equals $::net2] } { node 192.168.1.11 } }
- walt_97468
Nimbostratus
Thanks Bhattman I will set this up in the lab to test. Appreciate the assistance! - hoolio
Cirrostratus
If do have now or have had an active support contract while a more recent LTM version has been released, you could upgrade from 9.2.3 to a supported version. See SOL7727 for details (Click here). You can reactivate your license on license.f5.com to update the service activation date to the last time you had active support. 9.4.8 would be good from a stability perspective. 10.0.1 or 10.1.0 would be good from a feature perspective.class ip_mapping_class { "1.1.1.1 2.2.2.2" "1.1.1.2 2.3.4.5" }
when CLIENT_ACCEPTED { Check if the destination IP is in the first field of the datagroup set dest [findclass [IP::clientaddr] $::ip_mapping_class " "] Check if there was a match if { $dest ne "" } { Use the match as the destination IP node $dest } }
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