特殊:Badtitle/NS100:CiscoConsole:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
 
(未显示同一用户的1个中间版本)
第5行: 第5行:
== Hardware ==
== 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.
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.
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. Many of them do not require a driver in Linux. Make sure the item is plugged in at boot time & the system should find it. This device will allow you to use the standard Cisco cable which has a DB9 serial connector on one end & an RJ45 connector on the other.
== Install Minicom ==
== 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.
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.
== Find the name of your serial port ==
== Find the name of your serial port ==
Next, 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:
Next, you need to find out is which device your serial (including the USB adapter) ports are 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 | grep tty'''
'''dmesg | grep tty'''
The output will look something like this:
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.
'''[    0.788856] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A'''
'''[    0.789144] 00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A'''
'''[94023.461242] usb 2-1: pl2303 converter now attached to ttyUSB0'''
'''[107561.131086] type=1503 audit(1260922689.994:33): operation="open" pid=27195 parent=27185 profile="/usr/sbin/cupsd" requested_mask="w::" denied_mask="w::" fsuid=0 ouid=0 name="/dev/ttyUSB0"'''
Look in this output for words that contain "tty". In this case, it is "ttyS0". That meas the name of the device that corresponds to your serial port is "ttyS0". The name of your defice that corresponds to your USB port has a definition of name="/dev/ttyUSB0" (make sure it's plugged in). Now we are ready to configure Minicom to use this information.
== Configure Minicom ==
== Configure Minicom ==
Open a terminal using "Applications > Accessories > Terminal". Now type this command to enter the configuration menu of Minicom:
Open a terminal using "Applications > Accessories > Terminal". Now type this command to enter the configuration menu of Minicom:
第18行: 第22行:
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:
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:
Change your settings to match the ones in the picture above. Here is what I had to change:
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 line speed (press E) & change to "9600"
* Change the hardware flow control (press F) to "No"
* Change the hardware flow control (press F) & change to "No"
* Change the serial device (press A) to "/dev/ttyS0"
* Change the serial device (press A) & change to "/dev/ttyS0"
* Be sure to use the device name that you learned in the previous step
* Or to use your USB port, change the serial device to "/dev/ttyUSB0"
* Be sure to use the device name that you learned with the grep output.
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... ;)
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... ;)
To find out if you have configured Minicom correctly, type this command in the terminal:
To find out if you have configured Minicom correctly, type this command in the terminal:
'''sudo minicom'''
'''sudo minicom'''
After entering your Ubuntu user password, you should be connected to your Cisco device.
After entering your Ubuntu user password, you should be connected to your Cisco device.
Once inside, press Ctrl+A, to access minicom commands. Press 'Ctrl+A', then 'Z' to access help. Ctrl-A, then another letter, like 'X' & you will eXit. Help will show a list of available commands.
Note: You may want to delete the Minicom init string if you see a bunch of gibberish every time you connect to a device. To do this, enter Minicom configuration with:
Note: You may want to delete the Minicom init string if you see a bunch of gibberish every time you connect to a device. To do this, enter Minicom configuration with:
'''sudo minicom -s'''
'''sudo minicom -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.
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 ==
== Create a desktop launcher ==
If you want to have quicker access to Minicom, you can create a desktop launcher.
If you want to have quicker access to Minicom, you can create a desktop launcher.

2010年5月19日 (三) 21:53的最新版本

{{#ifexist: :CiscoConsole/zh | | {{#ifexist: CiscoConsole/zh | | {{#ifeq: {{#titleparts:CiscoConsole|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:CiscoConsole|1|-1|}} | zh | | }}

Introduction

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. Many of them do not require a driver in Linux. Make sure the item is plugged in at boot time & the system should find it. This device will allow you to use the standard Cisco cable which has a DB9 serial connector on one end & an RJ45 connector on the other.

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.

Find the name of your serial port

Next, you need to find out is which device your serial (including the USB adapter) ports are 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 | grep tty The output will look something like this: [ 0.788856] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A [ 0.789144] 00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A [94023.461242] usb 2-1: pl2303 converter now attached to ttyUSB0 [107561.131086] type=1503 audit(1260922689.994:33): operation="open" pid=27195 parent=27185 profile="/usr/sbin/cupsd" requested_mask="w::" denied_mask="w::" fsuid=0 ouid=0 name="/dev/ttyUSB0" Look in this output for words that contain "tty". In this case, it is "ttyS0". That meas the name of the device that corresponds to your serial port is "ttyS0". The name of your defice that corresponds to your USB port has a definition of name="/dev/ttyUSB0" (make sure it's plugged in). 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: sudo minicom -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: Change your settings to match the ones in the picture above. Here is what I had to change:

  • Change the line speed (press E) & change to "9600"
  • Change the hardware flow control (press F) & change to "No"
  • Change the serial device (press A) & change to "/dev/ttyS0"
  • Or to use your USB port, change the serial device to "/dev/ttyUSB0"
  • Be sure to use the device name that you learned with the grep output.

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... ;) To find out if you have configured Minicom correctly, type this command in the terminal: sudo minicom After entering your Ubuntu user password, you should be connected to your Cisco device. Once inside, press Ctrl+A, to access minicom commands. Press 'Ctrl+A', then 'Z' to access help. Ctrl-A, then another letter, like 'X' & you will eXit. Help will show a list of available commands. Note: You may want to delete the Minicom init string if you see a bunch of gibberish every time you connect to a device. To do this, enter Minicom configuration with: sudo minicom -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
  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"
  • sudo minicom
  1. Hit "OK" and your desktop launcher is ready for you to use.

References

Using the Cisco console in Linux