0

I'm experiencing strange behavior with a Cisco UC520 router.

When I am directly connected to the router and telnet to it using this:

telnet 192.168.1.1 23

Then I get a successful login prompt:

Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
Cisco Configuration Assistant. Version: 3.0. Fri Jan 14 11:35:39 EST 2011

User Access Verification

Username:

However, when forward the port remotely to another machine:

ssh root@another_machine -R 127.0.0.1:23:198.168.1.1:23

And then on that other machine try and connect to the router via telnet:

telnet 127.0.0.1 23

I get a different message, and immediately disconnected:

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
SSH-1.99-Cisco-1.25
Connection closed by foreign host.

This seemed really odd so I double checked to make sure I was port forwarding port 23 and not port 22. I also tried mapping the router's name in the /etc/hosts file of the computer I forwarded ports to, so that I could do telnet RouterName 23 in case it didn't like the hostname. I also tried using a different forwarding port (10023) which did not work.

I don't see anything in the man page for telnet that indicates there is a --verbose option like ssh -v would give, which would be my next step in debugging. I don't see any problems in any of the /var/log/ files on the machine that the ports are forwarded to.

This seems quite strange and I think what is happening is that somehow the router thinks I'm trying to make an SSH connection instead of a telnet connection.

2
  • not a definitive answer, but in first case you use telnet protocol, while in second case you use ssh protocol. maybe cisco OS listen both on port 22 and 23, but is able to handle telnet: and ssh: protocol.
    – Archemar
    Commented Oct 21, 2014 at 5:12
  • @Archemar - you misunderstood. The ssh command is forwarding port 23 to a remote machine, on which I'm executing telnet
    – cwd
    Commented Oct 22, 2014 at 1:39

1 Answer 1

2

Cisco routers has Telnet open by default. You have to explicitly make the configuration for SSH (set a domain, generase RSA, enable SSH 2.0 etc).

Read the Cisco's documentation about how to configure Cisco and SSH.

2
  • Both are enabled, I would like to know how the router can tell that something is different about the second connection ( which is why I believe it is trying to provide an SSH connection instead of the telnet connection )
    – cwd
    Commented Oct 22, 2014 at 1:42
  • Found transport preferred from here which helped - and seems I may have also had a typo on the config
    – cwd
    Commented Oct 22, 2014 at 4:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .