Monday, December 1, 2008

Configure cisco devices via console port with Linux using USBserial cable!


If you were using Windows, then you might not notice any problem trying to configure cisco devices via a console port usign usbserial cable, just plug it in the USB of your laptop and install the appropriate driver, and you are done.

You will not notice a problem with MAC OS X either, some usbserial cables even do not need any driver.

But, when you are using Linux, then you are wondering, how to obtain the driver.

In Linux ,for ease of understand, comparing to Windows, drivers = kernel modules. So, you need to load the appropriate kernel module, to have the cable works.

Here is how to have this up and running, after reading this tutorial you will be able to configure your cisco devices or any other server via console port with your laptop using usbserial cable.

If you don't know how the usbserial cable looks like, here I have a picture for mine:

1. Load the kernel module: 'sudo modprobe pl2303'

pl2303 is the kernel module that will enable using the usbserial, to verify that is has been loaded successfully use this command, 'echo $?', if the result is "0", then it is ok.

use: 'lsmod | grep pl2303' to see what are the modules that are loaded currently or depends upon by ours.
lsmod | grep pl2303

pl2303 22020 0
usbserial 35816 1 pl2303
usbcore 146412 7 pl2303,usbserial,usbhid,hci_usb,ehci_hcd,uhci_hcd
You can see that usbserial/usbcore modules are depended upon by pl2303.

2. plug the cable into any USB port in your laptop, and issue 'screen /dev/ttyUSB0 9600', supposing that your device's speed is 9600 and using the default for flow control and other parameters. If your devices uses speed other than 9600, then you have to specify it, if any of the parameters are different then you have to specify it either, read the manual page of the screen to see how.

3. your are now in your device console.


No comments: