Smarter by Design.Simpler for Business
sys-cmd telnet
sys-cmd telnet is an interactive client that opens a TCP connection to a port of a target from the route table selected in WEB-CLI. It shows instantly whether the connection is established; if it is, every line written is sent to the server and its response is seen on the screen. It is used to check manually whether a backend port is open and what the first response of the service is.
Command Summary
# type telnet and press Tab: a free parameter
admin@TR7LBWAF01> sys-cmd telnet
<telnet-parameter-1>
admin@TR7LBWAF01> sys-cmd telnet <target> <port>
admin@TR7LBWAF01>
Everything written after the word telnet is passed to the tool as it is. There is no mandatory field; the target and the port are written separated by a space.
How It Works
| Subject | Behavior |
|---|---|
| Context | The connection is opened from within the selected v-device and route table. |
| Interaction | It opens a full terminal session. Everything typed on the keyboard and keys such as Ctrl+C, Ctrl+D and Esc go to the telnet tool, not to the CLI. |
| Exit | With Ctrl+] the command line of the tool is reached and quit is written. When the server closes the connection, the session ends by itself. |
| Pipe | It cannot be used: "Pipe" operator is not allowed after interactive commands. |
| Recording | Every run is written to the user logs; what is written inside the session is not recorded. |
Connection Results
| The message on the screen | Meaning |
|---|---|
Connected to … | The TCP connection was established; the port is open and a service is listening |
Connection refused | The target was reached but there is no service listening on that port |
| A long wait and a timeout | The packet may be being dropped on the way or on the target by a firewall |
Examples
admin@TR7LBWAF01> sys-cmd telnet 10.20.0.30 8080
admin@TR7LBWAF01>
admin@TR7LBWAF01> sys-cmd telnet 10.20.0.30 80
# after connecting, the two lines below are written, then Enter for an empty line
GET /health HTTP/1.1
Host: app.example.com
admin@TR7LBWAF01>
admin@TR7LBWAF01> sys-cmd telnet 10.0.7.25 25
admin@TR7LBWAF01>
Things to Know
- It connected but the screen is empty. Many services wait for the client to speak first; this is not an error. In protocols such as HTTP the request is written manually.
- Not suitable for a script. Because it is interactive, its output cannot be filtered or written to a file; for the port state
nmapis used, and for the HTTP responsecurl. - Encrypted ports. On ports that use TLS such as 443, the connection is established but the plain text written does not get a meaningful response; for a TLS check
sslscanis used.
