Serial console access to Cisco devices with macOS screen21 Dec 2018
Today brought me one step closer to being completely dongle free on my Mac and standardizing on one type of cable connection. Upon receiving my USB-C Cisco console cable I decided to experiemnt using the
screen terminal app and go beyond the basics of console port connectivity to understanding screen’s other features.
Displaying the device name
The first thing to do when connecting the USB-C console cable is identify the device name of the cable itself. The command
ls /dev will list all devices connected to my MacBook Pro but since this is a USB serial cable I will use
*usbser* to minimize the results.
Without the cable connected to my Mac
ls /dev/*usbser* ls: /dev/*usbser*: No such file or directory
With the cable connected to my Mac
ls /dev/*usbser* /dev/cu.usbserial-AH06ORDE
And there it is!
This tells terminal to use 9600 baud rate. Note that 8N1 is already the default asynchronous mode.
$ screen /dev/cu.usbserial-AH06ORDE 9600
Time to power on the router.
System Bootstrap, Version 16.9(1r), RELEASE SOFTWARE Copyright (c) 1994-2018 by cisco Systems, Inc. Current image running: Boot ROM0 Last reset cause: PowerOn C1111-8PWB platform with 4194304 Kbytes of main memory
Success! Screen has an active console connection to my router
? shows the screen menu
Additional screen commands
c will create another console window
SHIFT-A will allow renaming the current console
" display both terminals
p moves to next or previous windows
SHIFT-S displays the terminals as split screen
Tab toggles between split screen windows
i identifies which is the active window
Open another terminal window to list all active screen sessions
$ screen -list There is a screen on: 93529.ttys001.2594 (Attached) 1 Socket in /var/folders/sb/7dkxrqcs32z948hv4zpxjzfx5cxpbq/T/.screen.
d detaches from the session and display the terminal prompt
To re-attach to a screen session, or if you accidentally close terminal and need to get back to your console session.
$ screen -r
.screenrc if it does not exist
cd ~ touch .screenrc
.screenrc to add custom startup message or disable with