Configuring a Cisco switch from a Linux Terminal with Minicom

As much as I like playing in the terminal, the jury is still out as to how much I like working with Cisco. To be as objective as possible, I need to tell myself that: 1, I am not familiar with the command set or how they like to do things so I must be open minded; 2, Relax, the command line is a happy place to be and 3, this is new territory, don’t get frustrated, just write it down and enjoy the learning process. Also, my brother in-law, whose career is in network administration just loves this Cisco business so it turned out to be quite educational. The scope of this article is not how to set up a router, just, this is how I was able to get going with it.

The specific Cisco switch I configured was a Catalyst 3560 series PoE-48. I am sure these direction will work with other similar devices. Since I am an openSUSE user, the directions are tailored as such.

Minicom Installation

My first step was to find a piece of software that would work for me for this and I am sure that there are a ton of solutions but the one that worked the easiest for me was minicom. I am open to other suggestions, of course.

This is in the official repository so you can go into the terminal and type this to install it:

sudo zypper install minicom

I would give the alternative option to do the Direct Installation but since you will be in the terminal anyway, why would you do that?

https://software.opensuse.org/package/minicom

Set User Permissions

Before you run minicom you will need to add your user as a member of the groups: dialout, lock and uucp.

In all fairness, I don’t know if you actually need uucp but since I use it for serial transfers to Arduino type devices, I am just assuming.

To do this in YaST, select the Security and Users section, open the User and Group Management module and make the changes required for the user.

Alternatively, you can do this from the command line, enter the following as root:

usermod -a -G dialout,lock,uucp

The terminal method is way cooler, just saying.

Minicom Configuration

Before you can set up Minicom, you will have to determine where the serial port is that is connected to your computer. In my case, I have ttyS0 but if you have a USB serial port device, you may have something like ttyUSB0 or similar.

Now that you have an idea as to the name of your serial port you can begin the setup process. Some adjustments are needed so that you can successfully communicate with the router. In the terminal type:

minicom -s

This will bring you to a ncurses style menu system. Arrow down to Serial port setup entry.

To change the serial device to what you have, select A and adjust it to your particular serial interface. Then select E to set the Bps/Par/Bits

The baud rate (Speed) should be set to 9600 (C) and the Stopbits to 8-N-1 (Q).

That should do it. I must stress that this did indeed work for me and your results may vary. The speed and Stopbits seem to be key. I have seen some variations in Software and Hardware flow control but those settings didn’t seem to affect my results.

Connect

To make the connection, type minicom in the terminal and you will hopefully be logged into the smart switch.

Although I have screen captured how I configured the Cisco switch, I don’t think it would necessarily apply directly. I also don’t really know what I am doing and had to rely on an expert so I cannot adequately explain the process itself.

Final Thoughts

Setting up a smart switch in the terminal requires some real knowledge. The point of this write-up was to close some of those gaps that may exist if you decide to embark on going down the “fancy switch lane.” I don’t know if this will work for similar type devices or other Cisco switches. It is a starting point and something to build from. I hope it provides some use to someone other than me.

Additionally, I am very open to suggestions on other similar terminal applications for communicating over serial in the terminal.

References

https://www.cisco.com/c/en/us/products/collateral/switches/catalyst-3560-series-switches/product_data_sheet09186a00801f3d7d.html

http://www.allaboutlinux.eu/manage-cisco-switch-router-from-linux/

https://appuals.com/install-terminal-emulator-services-access-cisco-console-port-linux/

One thought on “Configuring a Cisco switch from a Linux Terminal with Minicom

Leave a Reply