Using reverse telnet and ssh

Sometimes I find a need to use a console cable remotely, but getting someone to set up a PC or laptop with a serial connection for remote access can be quite a hassle.   I have used the following configurations to get remote serial access using only an onsite router.

  1. Create a rollover cable if you do not already have a flat blue Cisco cable (the one with rj-45’s on both ends).  Cisco has a guide here, but the easiest way I have found is create a staight-through cable and flip one of the rj-45’s upside down before terminating the connection.
  2. Connect your roll over cable to the AUX port of the router.
  3. add the following configs to the router

    line aux 0
    session-timeout 30 output
    modem InOut
    no exec
    transport input all
    stopbits 1
  4. log into the router and do a show line to see what the tty of the aux port is.

    LAB-1-RTR#show 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 - inout - - - 0 0 0/0 -
    LAB-2-RTR#show line
    Tty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise Overruns Int
    0 CTY - - - - - 0 0 0/0 -
    65 AUX 9600/9600 - inout - - - 0 0 0/0 -

    Note the first example is “1” and the second one is “65”
  5. From the router telnet to itself on port 2000 + the tty number
  6. Login using the creditals for the router you are using as the console server.
  7. If you need to leave the console and return to the router use the following keystrokes ctrl-shift-6 followed by x to return to the router.  Note if you hit enter without entering anything else you will return to the console session
  8. To end your session, escape back to the router and enter clear line aux 0 and you are done

Leave a Reply

Your email address will not be published.