Forum Discussion
Josh_Hildebran1
Nimbostratus
Aug 15, 2008FTP welcome message for redirecting
I'd like to create an iRule that I can put on a VIP that doesn't have any pool associated with it. The VIP will be listening on port 21 for FTP.
I'd like an iRule that accepts the FTP ...
James_Quinby_46
Aug 18, 2008Historic F5 Account
Just for fun, I whipped this together. It's pretty much the bare essentials:
when CLIENT_ACCEPTED {
TCP::respond "220 XYZ Inc. FTP Server\r\n"
TCP::respond "211 This FTP server is currently out of service. Please try again later.\r\n"
TCP::close
}
Applied to a VS, it yields the following responses.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\>ftp 10.2.2.54
Connected to 10.2.2.54.
220 XYZ Inc. FTP Server
This FTP server is currently out of service. Please try again later.
Connection closed by remote host.
C:\Documents and Settings\>
It's close, anyway. Other FTP clients seem to want to authenticate before failing. I expect this is because the LTM is attempting to proxy the FTP traffic to an FTP server in the background. As there isn't one, it sort of just croaks. This is with the Linux FTP client on the LTM itself:
ftp 10.2.2.54
Connected to 10.2.2.54 (10.2.2.54).
220 XYZ Inc. FTP Server
Name (10.2.2.54:root): asdf
This FTP server is currently out of service. Please try again later.
Login failed.
No control connection for command: Broken pipe
ftp>
There are probably more elegant ways to do this. I took a look at the FTP RFC to see if I should be prepending status codes to the banner text, for example. The differing client behavior is a little puzzling as well.
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