Scaling API-first – The story of a global engineering organization
Using the cisco console in linux
1. Guide: Using the Cisco console in Linux
People who work with Cisco network equipment need to be able to
connect to the console port on their devices. In Windows, you can simply
fire up HyperTerminal to get basic access to your devices. If you are using
Linux, then you need to know how this can be done with an application
called Minicom.
Hardware
First, you are going to need a Cisco console cable, a Cisco device, and a
computer. If your computer has a serial port, then you can use the
standard console cable that comes with every Cisco device.
If you do not have a serial port (like most new laptops), then you need to
purchase a USB to Serial adapter that supports Linux. This device will
allow you to use the standard Cisco cable, which has a serial port on one
end.
2. Install Minicom
You can easily install Minicom by using "System > Administration >
Synaptic Package Manager". Search for "minicom" and choose to install
the package. Click "Apply" and Minicom should be installed within a few
seconds.
3. Find the name of your serial port
The first thing you need to find out is which device your serial port is
mapped to. The easiest way to do this is to connect the console cable to
a running Cisco device. Now open up a Terminal using "Applications >
Accessories > Terminal" and type this command:
dmesg | greptty
The output will look something like this:
Look in this output for words that contain "tty". In this case, it is "ttyS0".
That meas the name of the device the corresponds to your serial port is
"ttyS0". Now we are ready to configure Minicom to use this information.
Configure Minicom
Open a terminal using "Applications > Accessories > Terminal". Now type
this command to enter the configuration menu of Minicom:
sudominicom -s
Use the keyboard arrow keys to select the menu item labeled "Serial Port
Setup" and then hit "Enter". This will open a window that looks similar to
the one below:
4. Change your settings to match the ones in the picture above. Here is
what I had to change:
Change the line speed (press E) to "9600"
Change the hardware flow control (press F) to "No"
Change the serial device (press A) to "/dev/ttyS0"
o Be sure to use the device name that you learned in the
previous step
Once your screen looks like mine, you can hit "Escape" to go back to the
main menu. Next, you need to select "Save setup as dfl" and hit "Enter"
to save these settings to the default profile. Then select "Exit Minicom"
to exit Minicom... ;)
5. To find out if you have configured Minicom correctly, type this command
in the terminal:
sudominicom
After entering your Ubuntu user password, you should be connected to
your Cisco device.
Note: You may want to delete the Minicominit string if you see a bunch
of gibberish every time you connect to a device. To do this, enter
Minicom configuration with:
sudominicom -s
Then select "Modem and dialing". Press "A" to edit the Init string, and
delete all characters so that it becomes empty. Make sure you save this
to the default profile with "Save setup as dfl". You should no longer see
gibberish when you connect to devices.
Create a desktop launcher
If you want to have quicker access to Minicom, you can create a desktop
launcher.
1. Right-click on the desktop and choose "Create launcher"
2. Click on "Icon" and choose the picture you want to use
6. 3. Use the "Type" pull-down menu and select "Application in
terminal"
4. Create a name like "Cisco Console" in the field labeled "Name"
5. Enter this command into the field labeled "Command"
o sudominicom
6. Hit "OK" and your desktop launcher is ready for you to use.
More Discussion from Cisco Users
How to Connect aCisco Router to a PC Running Linux?
Here is how to connect a cisco router to a PC running Linux:
1) You have a Cisco router, with a flat, blue console cable. The console
cable will have an RJ45 connector at one end, and a 9 pin din serial
connector on the other.
2) You have a computer running Linux (I'm using RedHat/Fedora), which
7. has a 9 pin din serial port available.
First, make sure that the serial ports are detected at boot time. I do this
with dmesg and grep:
bemo@booker:/home/bemo>dmesg |grepttyS
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
3) Connect the router to one of the Linux serial ports.
4) You should have a communications program. I use minicom, which is
available by default in RedHat 9, as well as Fedora Core up to 4 (and
probably beyond). You must run minicom as root.
Set the communication parameters to 9600 N81. The router will not
work any faster.
5) Start minicom, and set the serial port and commparmaters. That
should do it. The next thing you see on the console should be the router
prompt:
Router>