Console Access with Minicom (Linux)

The most common way to access a switch is through a serial port. This port, usually similar looking to an ethernet or phone port, is (normally) located on the rear of the switch. It should be labeled “Console” as well. Plug in a serial to USB adapter and connect that adapter to a computer or laptop.
If you’re using Windows, use the puTTY guide found here: https://neatrack.richweb.com/console-accessing-using-putty-windows/
Otherwise, you can use a computer or laptop that has Linux on it.
The device name you have to configure in minicom depends on the method:
  • Use /dev/ttyUSB0 for USB to serial cable
  • Use /dev/ttyS0 for direct server serial port
Note: Anything in this
fonts
or
fonts
means that you’ll be typing in the terminal or what you’ll be seeing in the terminal.
Install minicom using the following apt-get command if it is not already installed.
example@example-laptop:~$ sudo apt install minicom
sudo: unable to resolve host example-laptop
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  snap-confine
  Use 'sudo apt autoremove' to remove it.
  The following NEW packages will be installed:
    minicom
    0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
    Need to get 232 kB of archives.
    After this operation, 928 kB of additional disk space will be used.
    Get:1 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 minicom amd64 2.7-1build1 [232 kB]
    Fetched 232 kB in 0s (1,869 kB/s)
    Selecting previously unselected package minicom.
    (Reading database ... 178919 files and directories currently installed.)
    Preparing to unpack .../minicom_2.7-1build1_amd64.deb ...
    Unpacking minicom (2.7-1build1) ...
    Processing triggers for man-db (2.7.5-1) ...
    Setting up minicom (2.7-1build1) ...
Then access minicom using:
example@example-laptop:~$ sudo minicom
If you get an error message about not being able to access /dev/modem, then run the setup on minicom first.
sudo minicom -s

 

Pick Serial port setup
(A) Set Serial Device to /dev/ttyS0 (or /dev/ttyUSB0 if using the USB to serial cable)
(E) Set Bps to 9600 8N1
(F) Hardware flow control to Yes
(G) Software flow control to No

You could save the configuration as console by typing save set as and type in the word console. Then next time you run minicom you can do:
sudo minicom console
And it should remember your serial port settings. You can also select “save setup as dfl” to be able to type “minicom” and it use your desired settings by default.
 

Exiting Minicom

After you are finished configuring a switch or router, you need to exit minicom and go back to the server’s terminal. To do this, type these commands: Ctrl + a, and then x
Make sure to type the “x” after you enter Ctrl+a. Once you do this, you should get a popup that asks “Leave Minicom?” Select yes, and you will exit out.
Minicom uses “Ctrl+a” to send you into a mode in which you can send special commands to minicom. X (for exit) is just one of those. You can type “Ctrl+a” and then “z” to get a full list of the commands.
Minicom X-ON/X-OFF Characters (Screen Freezing Issue)
Minicom has certain characters that you have to watch out for. They are X-ON X-OFF characters that will freeze your session until you unfreeze it. They are in-band control codes. You can read more about serial protocols if you are interested.
If you inadvertently hit one of these commands, the terminal may freeze up. If this happens, you can either execute the X-ON key sequence (Ctrl+q) or quit minicom and restart the switch/router.
These problems may be mitigated by disabling “Software Control Flow” in the minicom serial port settings menu.