cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Join Customer Connection to register!
859
Views
5
Helpful
9
Replies
Fenderbridge
Beginner

Telnet drops connection after enter

I have a router that I am telnetting into via raspberry pi.  Works perfectly fine on switches, but on the two 1921 routers, after hitting enter more than twice, or getting a log message, the connection gets dropped. 

"2001" is an alias for "telnet 127.0.0.1 2001", where 2001 is the port number.

 

 

@raspberrypi:~$ 2001
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

ser2net port 2001 device /dev/ttyUSB0 [9600 N81] (Debian GNU/Linux)

>
RouterA>
RouterA>
RouterAConnection closed by foreign host.
Me@raspberrypi:~$

 

 

 

Any ideas?  Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Fenderbridge
Beginner

Well, I'm not sure why, I'm not entirely sure how, but the problem appeared to be that particular serial connection.  After moving it to another one of the Gearmo's 3 ports and on a different USB port, it started working normally.

 

I'm just going to call it a win, and use a different port for the router.

 

Thanks for your help, folks!

View solution in original post

9 REPLIES 9
balaji.bandi
VIP Expert

You already logged in to Router by below prompt :

 

RouterA>

 

I am thinking becuase there is no inputs - it time out and closed the connection.

 

can you post router config here?

BB

***** Rate All Helpful Responses *****

How to Ask The Community for Help

Yes, sir, I do connect, and when i immediately hit enter, it disconnects.

 

This is as far as i could get over telnet

 

Me@raspberrypi:~$ 2001
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

ser2net port 2001 device /dev/ttyUSB0 [9600 N81] (Debian GNU/Linux)


RouterA>en
Password:
RouterA#sho run
Building confiConnection closed by foreign host.
Me@raspberrypi:~$

 

I'll try and grab the configs when i get a chance to be physically available to them

Hello @Fenderbridge ,

according to the following ouput:

 

>>

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

>>>ser2net port 2001 device /dev/ttyUSB0 [9600 N81] (Debian GNU/Linux)

 

You are using the rasberry pi as a terminal server by making telnet to 127.0.0.1 TCP port 2001, but actually you are using a USB to serial console cable to connect to RouterA.

The issues are likely related to some settings on device /dev/ttyUSB0.

 

This explains why you are able to reach the router prompt even if only SSH is allowed on the router vty lines as noted by @joelm .

 

Edit:

you are actually attempting to connect to router console not via telnet and when you use your laptop as console connection it works fine

 

Hope to help

Giuseppe

 

Instead of using telnet, I connected my laptop directly to the console instead of going through raspberry pi telnet, got in no problem.

 

Building configuration...


*Jun 15 01:55:05.723: %SYS-5-CONFIG_I: Configured from console by console
Current configuration : 1454 bytes
!
! Last configuration change at 01:55:05 UTC Mon Jun 15 2020
!
version 15.7
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
!
hostname RouterA
!
boot-start-marker
boot-end-marker
!
!
enable password 7 [password]
!
aaa new-model
!
!
!
!
!
!
!
!
aaa session-id common
!
!
!
!
!
!
!
!
!
!
!
!
no ip domain lookup
ip domain name mydomain.com
ip cef
no ipv6 cef
multilink bundle-name authenticated
!
!
!
license udi pid CISCO1921/K9 sn FTX17238341
!
!
username me password 7 [password]
!
redundancy
!
!
!
!
!
!
interface Embedded-Service-Engine0/0
no ip address
shutdown
!
interface GigabitEthernet0/0
ip address 172.16.0.1 255.255.255.252
duplex auto
speed auto
!
interface GigabitEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/0/0
no ip address
!
interface FastEthernet0/0/1
no ip address
!
interface FastEthernet0/0/2
no ip address
!
interface FastEthernet0/0/3
no ip address
!
interface Vlan1
no ip address
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
ip ssh version 2
!
!
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line 2
no activation-character
no exec
transport preferred none
transport output pad telnet rlogin lapb-ta mop udptn v120 ssh
stopbits 1
line vty 0 4
logging synchronous
transport input ssh
!
scheduler allocate 20000 1000
!
end

line 2
 no activation-character
 no exec
 transport preferred none
 transport output pad telnet rlogin lapb-ta mop udptn v120 ssh
 stopbits 1
line vty 0 4
 logging synchronous
 transport input ssh

You're coming in on line 1, right?  If so, the transport input is set to ssh only.  Try changing that line to transport input telnet or transport input all

You should also strongly consider using SSH instead of telnet so the traffic is encrypted.

I am coming in through line console 0.

 

Here's my setup.

 

Laptop > ssh or vnc to Raspberry pi > gearmo usb to 4-port serial > routers and switches

 

My RPi is set up to telnet through the usb to serial.

 

Thing is, I can connect just fine to the switch 3750, but not the router 1921.

Leo Laohoo
VIP Community Legend

Duplicate IP address

Not sure that ip address matters if I am directly connected via console cable.

 

Not to menti9n, i move the console cable over to the switch and there is no problem at all!

Fenderbridge
Beginner

Well, I'm not sure why, I'm not entirely sure how, but the problem appeared to be that particular serial connection.  After moving it to another one of the Gearmo's 3 ports and on a different USB port, it started working normally.

 

I'm just going to call it a win, and use a different port for the router.

 

Thanks for your help, folks!

View solution in original post