TL;DR
Routers generally cannot reliably detect transitive or cascaded telnet sessions (where a user connects to one router, then uses that router to connect to another). Standard logging and monitoring features focus on direct connections. However, you can sometimes infer such activity by analysing connection times, source IPs, and looking for unusual patterns in your logs.
Understanding the Problem
Telnet is an unencrypted protocol. When a user telnets to a router (Router A), then from Router A telnets to another router (Router B), Router B only sees the connection originating from Router A’s IP address, not the original user’s IP.
Steps to Investigate and Potentially Detect Transitive Sessions
- Check Router Logs: This is your first step. Look for telnet connections in your router logs. The specific commands vary by vendor (Cisco, Juniper, etc.).
- Cisco IOS/IOS-XE: Use the
show loggingcommand to view logs. Filter for “telnet” or relevant IP addresses.show logging | include telnet - Juniper Junos: Use the
show log messagescommand, filtering by facility and severity.show log messages | match telnet
- Pay attention to the time difference between connections. A very short gap suggests a potential cascade.
- Check your router’s documentation for extended logging options.
- Disable Telnet: The best solution is often to disable telnet entirely and use SSH (Secure Shell) instead. SSH encrypts the connection, making it much more secure.
configure terminalno ip telnet server - Restrict Access: If you must use telnet, restrict access to specific IPs only.
Limitations
Keep in mind these limitations:
- Encryption: Telnet’s unencrypted nature makes it difficult to inspect the contents of the session.
- Log Rotation: Logs are often rotated, so you may not have historical data available.
- Router Capabilities: Not all routers offer advanced logging features.