Tuesday, March 20, 2012

Reverse Telnet on auxiliary port and its configuration


At some point in your career as a network engineer I am sure you would have come across a situation where you will have to configure a device remotely with no network connectivity to the device. It can be no biggie if you have a terminal server or out-of-band access into the device, but what if you don’t have any of these and all you have is one Cisco device there at site. Reverse telnet to the rescue!!! Reverse Telnet or Direct Telnet gives you the ability to telnet into a device and then console to another device from there.

For those of you who are rolling your eyes and going "that is easy!" , this post is not for you. This is for people like me who had no clue when I started off my career. ( In fact well into my career ). I will be using Cisco gear for configuration and setup examples.

All you will need is a Cisco device at site which has an Auxiliary port ( marked AUX) and a device with a console port (which you wish to connect to ) and a straight through cable.   

A Straight through cable as the name suggest is a straight through cable. Pins 1-8 are mapped to Pins 1-8 ( simple enough ). Please note that long cables and higher baud rates have known to cause issues. I always recommend that we keep the cable lengths ~5M or less.


Configuration on the Cisco routers are straight forward. You will need to configure the auxiliary line on them to accept sessions. I have given a sample configuration below.

cisco#config t
cisco(config)#line aux 0
cisco(config-line)#modem InOut
cisco(config-line)#transport input all
cisco(config-line)#speed 9600
cisco(config-line)#exit

The speed/baud rate can change with the device you wish to connect to. I have used 9600 here, which is default for cisco gear. Please refer to the hardware manual of the device to get the correct values for your device.

Once the device is configured you will need to connect the AUX to the console port using the straight through cable. You will need to figure out the port which you will need to use to telnet. Port assignments for Aux vary from device to device. You will be able to find this out using the command "sh line".

cisco>sh line
   Tty Line Typ     Tx/Rx          A Modem  Roty AccO AccI  Uses  Noise Overruns  Int
     0    0 CTY                            -       -            -         -       -         0            0         0/0        -
     1    1 AUX   9600/9600    -       -            -         -       -        62          0         0/0        -
    66   66 TTY   9600/9600   -      -            -         -       -        2             0    0/80592    -
*  322  322 VTY                      -      -            -         -      33       57         0    0/0              -
****TRUNCATED****

To telnet into the device you will need to use the port number of the AUX (i.e. 2000+line#.  seen in the above output ). So in the above example it would be 2001. The syntax is as below:

cisco> telnet  <ip_address> <port_number>

The IP address can be any IP on the device you are on. eg. loopback, LAN etc. and you are all set!

 


No comments:

Post a Comment