Forum Discussion
Kevin_Jones_505
Feb 16, 2007Historic F5 Account
Telnet Proxy iRule
We would like an iRule that would accept a client connection on port 23, prompt the user for the desired destination (host name or IP), and then open an associated telnet session to an external host. ...
Kevin_Jones_505
Feb 21, 2007Historic F5 Account
Thanks, Colin. This is a beginning. Hmm. I see your suggestion seems to include a SERVER_CONNECTED event .... and while this should happen in this application, no decisions are needed at that point. I suspect I didn't explain the problem well or I don't understand your solution.
The TCP::respond command looks very useful. It would seem we would have something like:
Client side connection, iRule sends prompt, gathers client input
when CLIENT_ACCEPTED {
TCP::respond "Enter the IP address of destination site.\r\n"
TCP::collect 20
}
Once client data collected, verify whether it's a valid IP
when CLIENT_DATA {
set ip [regexp -inline {([:digit:]{1,3}\.){3}[:digit:]{1,3}} [TCP::payload] ]
if { [matchclass $ip equals $::validIPs] } {
node $ip
additional statement to open serverside connection if ip is valid
} else {
TCP::respond "The IP address is invalid. Hostnames are currently not supported...\r\n"
}
TCP::release
}
Now, once we have a valid IP address (I'm letting host names go for now), we would need to open a telnet connection to that device. It would seem appropriate if we could do that once the ip address is deemed valid .. just after "node" is assigned $ip.
Once the server side connection is formed, the iRule is no longer needed.
We'll keep working on it, but I know we've got a bit to go.
Thanks again!
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