Switching

last person joined: 2 days ago 

Ask questions and share experiences about EX and QFX portfolios and all switching solutions across your data center, campus, and branch locations.
  • 1.  Escape Sequence Character - Console Stuck at Remote Device

    Posted 04-08-2012 10:40

    Suppose I'm consoled into a Juniper device and from there, I ssh to another network device.  Then on that remote device I do something that makes that device unreachable (which doesn't cause a TCP-FIN or RESET to be sent back to the local device).  How do I "escape back" to the local device I'm consoled into?  Otherwise it just appears that my local console port is hung, where it's really the remote device that's unreachable.

     

    On a Cisco device, I'd use the escape character (ctrl-shift-6, x) to be sent back to the local device.  How do I do that on Juniper?

     

    Here are the things I've thought of?

     

    -wait a few hours (current method, not really a good idea)

    -reboot local device (bad)

    -tcp keepalives (not sure how to implement on Juniper)

    -outbound exec timeouts (not sure how to implement on Juniper)

     

     

     

     



  • 2.  RE: Escape Sequence Character - Console Stuck at Remote Device

     
    Posted 04-08-2012 13:29
    SSH to the device and request system logout the console user.


  • 3.  RE: Escape Sequence Character - Console Stuck at Remote Device
    Best Answer

    Posted 04-08-2012 22:48

    I have not tested this, but the normal SSH break sequence is ~#   (and ~. disconnects the hung session).  Those characters need to be preceeded by a CR/LF.

     

    So, [enter key]~.

     

    If you're multi-level SSH'd, be aware that this will break all the way back to the first device.  For example, if I'm on my PC, and I SSH to a device, then SSH from that device to another, then SSH from that device to another... if the session gets stuck and I send the break sequence, it will take me all the way back to my PC, which could cause session issues on the intermediate devices.  I'm not sure if the Juniper SSH client supports multi-level breaks -- on some SSH clients you can send multiple tilde characters, for example from my PC, SSH to a device, then SSH to another device.  Some SSH clients will allow a CR/LF,~~. and it will disconnect only the SSH to the last device.



  • 4.  RE: Escape Sequence Character - Console Stuck at Remote Device

    Posted 04-09-2012 15:05

    Awesome!  The <ENTER>~. worked to disconnect from the hung SSH session, and the <CTRL>] followed by "quit" worked to kill the hung telnet session!!!

     

    root@ex3200-1> ssh cisco@172.16.2.1 
    
    
    *** This is my login banner. ***
    
    Password: 
    
    
    *** This is my motd banner. ***
    
    
    r1841-1# <---- This is where I typed <ENTER> followed by ~ followed by .
    r1841-1#Connection to 172.16.2.1 closed.
    
    root@ex3200-1> 
    
    root@ex3200-1> telnet 172.16.2.1 
    Trying 172.16.2.1...
    Connected to 172.16.2.1.
    Escape character is '^]'.  <----- notice this on telnet sessions
    
    
    *** This is my motd banner. ***
    
    
    
    *** This is my login banner. ***
    
    
    
    User Access Verification
    
    Username: cisco
    Password: 
    
    r1841-1#  <---- this is where I typed <CTRL> followed by ]
    telnet> quit <--- then type quit to get back to the original device
    Connection closed.
    
    root@ex3200-1>