2019 August

How to connect to a Cisco Device using USB Console

This article was written using instructions for Ubuntu, but was actually tested on a Raspberry Pi. Cool, eh?
https://www.youtube.com/watch?v=PRwHNd-u_cA

Install minicom

$ sudo apt-get install minicom

Find the device

$ dmesg | grep ttyUSB
[    5.494345] usb 1-1.2: Moschip 2 port adapter converter now attached to ttyUSB0

Note the device: In this case it is ttyUSB0

Configure Minicom

Run minicom in setup mode

$ sudo minicom -s
+-----[configuration]------+
| Filenames and paths      |
| File transfer protocols  |
| Serial port setup        |
| Modem and dialing        |
| Screen and keyboard      |
| Save setup as dfl        |
| Save setup as..          |
| Exit                     |
| Exit from Minicom        |
+--------------------------+

Configure the Serial Device

Select ‘Serial port setup’ and press [ Enter ]

+-----------------------------------------------------------------------+
| A -    Serial Device      : /dev/tty8                                 |
| B - Lockfile Location     : /var/lock                                 |
| C -   Callin Program      :                                           |
| D -  Callout Program      :                                           |
| E -    Bps/Par/Bits       : 115200 8N1                                |
| F - Hardware Flow Control : Yes                                       |
| G - Software Flow Control : No                                        |
|                                                                       |
|    Change which setting?                                              |
+-----------------------------------------------------------------------+

At the ‘Change which setting?’ prompt, press [A]

There is no need to press [ Enter ], your cursor will be moved to the end of the Serial Device Path

Change the setting to match the setting found from the dmesg command.

In this example, we’ll change /dev/tty8 to /dev/ttyUSB0.

After the setting has been changed, press [ Enter ] to return to the ‘Change which setting’ prompt.
+-----------------------------------------------------------------------+
| A -    Serial Device      : /dev/ttyUSB0                              |
| B - Lockfile Location     : /var/lock                                 |
| C -   Callin Program      :                                           |
| D -  Callout Program      :                                           |
| E -    Bps/Par/Bits       : 115200 8N1                                |
| F - Hardware Flow Control : Yes                                       |
| G - Software Flow Control : No                                        |
|                                                                       |
|    Change which setting?                                              |
+-----------------------------------------------------------------------+

Press [E] to edit the Bps/Par/Bits setting

+---------[Comm Parameters]----------+
|                                    |
|     Current: 115200 8N1            |
| Speed            Parity      Data  |
| A: <next>        L: None     S: 5  |
| B: <prev>        M: Even     T: 6  |
| C:   9600        N: Odd      U: 7  |
| D:  38400        O: Mark     V: 8  |
| E: 115200        P: Space          |
|                                    |
| Stopbits                           |
| W: 1             Q: 8-N-1          |
| X: 2             R: 7-E-1          |
|                                    |
|                                    |
| Choice, or <Enter> to exit?        |
+------------------------------------+

Press [C], then [Q]

The ‘Current: ‘ setting at the top of the menu will change to ‘9600 8N1’

+---------[Comm Parameters]----------+
|                                    |
|     Current: 9600 8N1              |
| Speed            Parity      Data  |
...

Press [ Enter ] to return to the Serial port settings menu.

You will see the new setting on the ‘Bps/Par/Bits’ section.

...
| E -    Bps/Par/Bits       : 115200 8N1                                |
...

Press [ Enter ] to return to the ‘configuration’ menu.

+-----[configuration]------+
| Filenames and paths      |
| File transfer protocols  |
| Serial port setup        |
| Modem and dialing        |
| Screen and keyboard      |
| Save setup as dfl        |
| Save setup as..          |
| Exit                     |
| Exit from Minicom        |
+--------------------------+

Select ‘Save setup as..’ then press [ Enter ]

...
| Save setup as..          |
...

At the ‘Give name to this configuration?’ prompt, enter a short name for these settings then press [ Enter ].

For this example, I’m using ‘cisco’

+-----------------------------------------+
|Give name to save this configuration?    |
|> cisco                                  |
+-----------------------------------------+
After pressing [ Enter ] you'll see a brief pop-up letting you know the configuration was saved.

Select ‘Exit from Minicom’ and press [ Enter ]

 

Run Minicom

 

Back at the Linux command prompt, run minicom with the name of the configuration you saved.

 

$ sudo minicom cisco
Welcome to minicom 2.7.1

OPTIONS: I18n
Compiled on Aug 13 2017, 15:25:34.
Port /dev/ttyUSB0, 11:06:34

Press CTRL-A Z for help on special keys

Press [ Enter ] to see the prompt for the device you are now consoled into.

Router>
By admin on August 1, 2019 | Cisco, Linux, Linux, Raspberry Pi

Linux TOP command

1st Row – top

top - 11:37:19 up 30 min,  3 users,  load average: 0.02, 0.01, 0.06
  • current time (11:37:19)
  • uptime of the machine (up 30 min)
  • users sessions logged in (3 users)
  • average load on the system (load average: 0.02, 0.01, 0.06) the 3 values refer to the last minute, five minutes and 15 minutes.

2nd Row – task

Tasks:  131 total,   1 running,  129 sleeping,   0 stopped,   1 zombie
  • Processes running in totals (131 total)
  • Processes running (1 running)
  • Processes sleeping (129 sleeping)
  • Processes stopped (0 stopped)
  • Processes waiting to be stopped from the parent process (1 zombie)

3rd Row – cpu

Cpu(s):  0.2%us,  0.3%sy,  0.0%ni, 99.5%id,  0.0%wa,  0.0%si,  0.0%st

The sum of all the percentages will equal 100% of the cpu.

  • Percentage of the CPU for user processes (0.2%us)
  • Percentage of the CPU for system processes (0.3%sy)
  • Percentage of the CPU processes with priority upgrade nice (0.0%ni)
  • Percentage of the CPU not used (99.5%id)
  • Percentage of the CPU processes waiting for I/O operations(0.0%wa)
  • Percentage of the CPU serving hardware interrupts (0.0% hi — Hardware IRQ
  • Percentage of the CPU serving software interrupts (0.0% si — Software Interrupts
  • The amount of CPU ‘stolen’ from this virtual machine by the hypervisor for other tasks (such as running another virtual machine) this will be 0 on desktop and server without Virtual machine. (0.0%st — Steal Time)

4th and 5th Rows – memory

KiB Mem :  3920076 total,   564520 free,  1498724 used,   1855940 buffers
KiB Swap:  4071932 total,  4071932 free,        0 used,   1893112 avail Mem
  • Total available memory in KiB (3920076)
  • Total free memory in KiB (564520)
  • Used memory in KiB (1498724)
  • Buffers (aka cached)
    • Temporary memory that has been used, but is available if a system needs it.
    • It is often used when a file has been accessed to prevent re-reading from that file from the disk.
      • Any re-reads will come from this memory and will significantly improve system performance.
    • To know how much actual ram is available, add the free and buffers values together.

Processes List

  PID USER     PR  NI   VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
 2372 joe      20   0 390384 237936  91792 S  4.6  6.1  37:47.11 gnome-shell
13505 root     20   0  41908   3772   3132 R  1.6  0.1   0:50.88 top
  • PID – Process ID of the process(2372)
  • USER – The user that is the owner of the process ( joe)
  • PR – priority of the process (20)
  • NI – The “NICE” value of the process (0)
  • VIRT – virtual memory used by the process (390384)
  • RES – physical memory used from the process (237936)
  • SHR – shared memory of the process (91792)
  • S – indicates the status of the process: S=sleep R=running Z=zombie (S)
  • %CPU – This is the percentage of CPU used by this process (4.6)
  • %MEM – This is the percentage of RAM used by the process (6.1)
  • TIME+ –This is the total time of activity of this process (37:47.11)
  • COMMAND – And this is the name of the process (gnome-shell)

 


    
By admin on | Linux