A step-by-step guide to performing the most common tasks associated with servicing Cisco Catalyst 2950 switches. Namely: configuring VLAN, resetting a password, reinstalling a damaged Cisco IOS operating system. Considered in detail the issue of connection, including through the com-port.
This article is a continuation of the
TCP / IP Basics for future amateurs , where I talked about the theoretical fundamentals of building a LAN. Like the last article, this one is designed for beginners in the field.
Connect to the switch
In order to perform any configuration of the switch, you need to connect to it from a personal computer or laptop. There are two types of connection - through the com port or through the web interface.
')
Connection via com port
To connect through the com port, you will need a "console wire". This is usually blue flat wire. It should be bundled with the switch. One end of the wire connects to the com port of your PC (laptops do not usually have a com port; of course, if you don’t carry a docking station with you). This end is called DB-9. The other end is inserted into the place to connect to the switch through the console. Where exactly it is located is impossible to say, it depends on the specific model. But, as a rule, it is signed accordingly, and is located on the rear panel of the switch. The place to connect the console looks the same as the usual 10mb / 100mb port on the switch. The connector (ie the lug) at the other end of the console wire, like the connector for a twisted pair, is called RJ-45. Thus, reading the documentation, you can see this definition: RJ-45 - to DB-9. So sometimes designate console wire. Connecting this wire should not cause you any difficulties, because To get confused or insert the wire to the wrong place is almost impossible.
Next you need to run the terminal. Click Start-> Run and type hypertrm (Windows OS). In the window that appears, type in any connection name and press Enter. Next, click on the "standard settings" button and select the com port to which the console wire was connected. In this case, the switch must be turned off. If you haven't turned it off, do it now. Then click OK. And then turn on the power switch. After a few seconds, you will see information about the switch operating system bootup on the console. But you can (and sometimes need to) turn on the switchboard without booting the operating system, and enter the bootloader and boot the system manually. Read more about this in
Installing iOS . Now you have to wait a little while the operating system is unpacked, flash memory is initialized and the system boots. Then an invitation will be displayed on the console, after which you have to wait another 10 seconds (depending on the switch model). And after all this, you finally get a management console in which you can type commands, thereby configuring the switch. The switch functionality is very large, and the younger the model, the greater the functionality. The explanation of all functions is beyond the scope of this help file. Here you can learn how to use one of the most important functions of the switch - setting up VLANs. Read more about the points VLANs, theory and VLANs, practice.
Perhaps the connection process may seem long and inconvenient to you, but in practice it takes no more than two minutes together with connecting the console wire. After you perform all the above actions, the first command you need to enter the switch is enable. This command gives you administrator rights to the switch, and the full set of commands that need to be configured becomes available to you. But, after typing the
enable command, the switch may ask you for a password. If you do not know the password and you have no one to ask it, then the password must be reset. In the future, as well as the password, you can reset all settings if they were unsuccessful. You can read more about this in the section
Restoring a Forgotten Password . If the settings have already been reset, the switch, after booting the OS, will ask you some questions regarding the basic settings. If you do not have difficulty reading technical literature in English, this should not be a problem for you. But I note that the second question, about managment, must be answered no.
If the operating system does not boot, you will probably have to reinstall it. Read more about this in
Installing iOS . But note that she could not boot without obvious reasons. If you are not sure what you are doing, then you should not follow the instructions from the iOS installation point. All the same, it is better to contact a specialist, if only to identify the reason why the OS is not loading. Such a case can be considered an emergency. There is nothing complicated in reinstalling the OS on the switch, but, again, without any apparent reason, the OS could not get out of standing. I will also warn you that there are such situations after which the switch can not be repaired in "home" conditions, and it will have to be maintained in the service, making a tidy sum for the repairs. If you are not sure what you are doing, you can accidentally put the switch into such a state.
Connection via web interface
If the switch is already turned on, you can connect to it via the web interface. To do this, you need to connect your PC or laptop to the switch port with a normal twisted pair (patchcord). Although this is not always possible, depending on the switch model, its location and the settings available on it (the web interface can be disabled / disabled). To connect via the web interface, you need to know the switch ip address (more precisely, the ip address, when accessing which switch gives web interface), and the port to which you need to connect.
If you do not know this, then you need to load the switch through the com port, as described above, delete / rename the configuration file, if it exists, and go through the initial configuration of the switch, during which you will be asked a question about ip address, going to the usual Browsing from your PC, you will get a switch web interface.
After you go to the switch’s web interface, you can manage it in two ways. First: click the corresponding buttons provided by the interface. Second: the usual set of commands, calling the console via the Telnet web interface.
I note that some versions of the switch operating system do not work with all browsers. You may also need java2 sdk (jdk) of a specific version.
VLANs, practice
It is assumed that you already have access to the web interface or telnet console of the switch. Configuration via a graphical console is carried out in different ways, depending on the version of the operating system. But the principle is always the same. A special case of VLAN configuration will be shown here via the web interface of the IOS 12.1 operating system.
VLAN configuration via web interface
Attention! When installing the port through which you manage the switch, to a non-interface vlan (by default, this is vlan 1), the connection with the switch will be interrupted. After logging in to the web interface, click on Smartports in the interface menu. Then select the ports to be used in the work and click the Customize button, as shown in the figure:
Then write the VLAN number to which the port should belong, and click the “done” button. If such a VLAN does not exist, it will automatically be created without asking any questions. For example, you can put ports 1, 2 and 3 in VLAN number 1, and ports 18 and 20 in VLAN number 37. Set the required ports for the VLAN you need as shown in the figure:
Then click the submit button (at the bottom of the page) for the changes to take effect.
Configuring VLAN via console
- Enter privileged mode with the enable command.
- Log into the vlan database : vlan database .
- Team ? You can see which commands you can do in the vlan database.
- Using the vlan 200 command, you will create and activate a new vlan. 200 is the vlan number. There can be any number from 1 to 1005.
- show will show you the available vlans and information about them.
- The no command does the opposite action of the command after it. For example, no vlan 200 will delete the vlan with the identification number 200.
- Now we write the exit command and exit the vlan database. Now we need to add the port we need to the vlan we need.
- To do this, enter configuration mode using the configure command. When asked what to configure, answer terminal.
- Then select the port you need using the interface interface FastEthernet 0/17 , where 17 is the port number.
- You are in port configuration mode. Just to see your opportunities, dial a team ? .
- To scroll the output to the line, press any button, on the screen - a space, interrupt the display of the list of information on the monitor - Ctrl + z or Ctrl + c.
- Then we use the switchport access vlan 200 command to install the port into the vlan we need. 200 is the vlan number.
- After exiting configuration mode, use the show vlan command to view the result of the actions performed.
Now you can connect personal computers to the appropriate ports, and the ping command will make sure that they are located individually on different networks, the way you configured vlan.
Forgotten password recovery
If you do not know the password to the switch, then you need to reset it. To do this, follow these steps:
Connect to the switch through the console. How to do this is described in detail in Connecting to the switch. But this time you need to connect a little differently. We need to go to the bootloader. To do this, before turning on the power switch, press and hold the "mode" button (button on the front panel, on the left, usually signed). Turn on the power while holding this button, and hold it until you see the bootloader's invitation on the console. This should happen a few seconds after power up.
From here you can manage files in the flash memory of the switch. But before that, it must be initialized. To do this, type the command
flash_init . After that you can view, copy, delete files and directories from memory. The commands for this are almost the same as in the MS-DOC operating system. In order to view the contents of flash memory, type the command
dir flash : I note that if in MS_DOC you typed "C:" or "D:", then you need to type "flash:", i.e. the "\" sign is not needed. After typing this command, you should see something like the following:
Directory of flash:/ 3 drwx 10176 Mar 01 2001 00:04:34 html 6 -rwx 2343 Mar 01 2001 03:18:16 config.text 171 -rwx 1667997 Mar 01 2001 00:02:39 c2950-i6q412-mz.121-9.EA1.bin 7 -rwx 3060 Mar 01 2001 00:14:20 vlan.dat 172 -rwx 100 Mar 01 2001 00:02:54 env_vars 7741440 bytes total (3884509 bytes free)
Here, html is the directory in which the web interface is located. config.text is a file in which all switch settings are stored, including the password. c2950-i6q412-mz.121-9.EA1.bin is the switch operating system. Depends on the switch series. vlan.dat - vlan settings are stored here. env_vars - file with environment variables. One day, you may need this file when you install the operating system on a formatted flash memory switch. Read more about this in
the IOS Installation Item.
Next, rename the configuration file if you need it in the future, or if you do not need the switch settings, just delete it. To rename, the command, respectively, is: r
ename flash: config.text flash: config.text.old . To delete
delete flash: config.text . Then we load the operating system either by turning the power off and on again,
using the reset command or the
boot command. The latter is preferable.
After loading, the operating system will ask you a question: “Continue with the configuration dialog? [yes / no]: ". If you do not need the configuration file, and you deleted it in the previous step, answer Y. At this point you can finish reading this item, because during the pre-configuration process, the switch will ask you what password to set. If the configuration file contains many settings that have worked stably in production, and you renamed it at the previous step, answer N.
Next, enter privileged mode with the
enable command. The switch will not ask for a password. Then rename the configuration file back
using the rename flash: config.text.old flash: config.text command. Now apply the settings from this file to the current switch configuration and set a new password:
switch
It's all. Now, when you enter the switch and enter the
enable command, the correct password will be the one you entered in the <password> place in the previous step.
IOS installation
Cisco Catalyst series switches and many other switches are running the IOS operating system. This OS is a single file, the size of 1.5 - 4.0 megabytes, depending on the version of the switch. Each version of IOS is designed for only one series of switches. A series of switches can consist of multiple switches. Below are several Catalyst 2950 series switches:



The IOS operating system for the Cat2950 series switches will work on all of the switches shown. But, although, in this series, there is an exception - this is a LRE (Long Reach Ethernet) switch. It needs another version of IOS. The names of the operating system files look like this: c2950lre-i6k2l2q4-mz.121-22.EA7.bin. This is just the IOS for the last of the switches shown. As you can see, after the numbers "2950" are the letters "lre". The operating system is distributed as a binary file and, in most cases, as a * .tar archive. The archive contains the same binary file, as well as the html directory in which the switch web interface is located. The operating system must be attached to the switch. But if the attached disk with the OS is lost, or you want to update the OS, then you will have to download it. You can download IOS for any Cisco equipment from their official website (cisco.com), having paid in advance and made an agreement with them for service.
IOS installation can be done in three ways: copy the operating system file via xmodem or via TFTP server. The third way is through the web interface. But this feature is not always available, and it is implemented every time in different ways, depending on the version of IOS. Therefore, we consider only the first two methods.
Xmodem
Installation using the xmodem protocol should be done only if the operating system on the switch is either erased or damaged. The IOS copy time of 3 megabytes to the flash memory of the switch is approximately one hour. To reinstall IOS using the Xmodem protocol, you need to connect to the switch via the console, as described in Connecting to the switch and enter the bootloader, as described in Restoring a forgotten password.
Next, you need to initialize flash memory with the
flash_init command. Then review what is currently in the switch memory:
dir flash:. At the end of the list of files in memory, write the size of the memory and the available free space. Make sure you have enough space to download iOS. If there is no space, delete the * .tar and * .bin files with the command
delete flash: file_name.tar (bin) . You can also format the memory with the
format flash: command.
After the space is cleared, you can start copying. Type the
copy xmodem: flash: file_name.bin command and immediately (!) Send the required file through the terminal. Click in the menu of the Transfer-> Send File. In the window that appears, select xmodem, as shown in the figure, and the file you want to transfer:
I note that if you download the operating system in the form of a * .tar archive, this will lead to nothing. Because the bootloader has no unarchiving function.
After copying is complete, reboot the switch. Perhaps if you formatted flash memory, you will have to create an env_vars file in which you need to write the mac address of your switch. To do this, carefully review the information that the bootloader gives when downloading and find the mac address in it. Then,
using the set MAC_ADDR xx: xx: xx: xx: xx: xx command, enter the mac address in the list of environment variables, and then type the
set_param command. Flash memory must be initialized. After these steps, the file env_vars should be created, which you can check with the
dir flash: command. The Web interface can only be downloaded as a * .tar archive, since the html directory contains a huge number of files. It is better to do this via TFTP, since he is hundreds of times faster.
Tftp
IOS can be installed via TFTP only if the switch is currently in a working state (i.e., IOS is loaded) and you are in privileged mode (
enable command). To copy files using TFTP you need the TFTPServer program. You can download it from the Internet. It takes less than one and a half megabytes. Install this program on your computer and run. Do not forget to give appropriate instructions to your brandmaser, or turn it off while copying files. Copy the files you want to transfer to the directory to the TFTP server, or to any other directory, having previously specified it to the program, as shown in the picture:
You probably want to use TFTP only to download the web interface of the operating system. In this case, your * .tar arvite should contain only the html directory. The OS itself needs to be removed from the archive. To do this under windows, install the total commander program. This is a file manager that supports the * .tar archive format, i.e. Allows you to view the archive, delete / add files and directories and much more.
The switch must be turned on, the IOS loaded, the Telnet console running. Type in the console
copy tftp: flash:, and answer a few questions that the switch asks you. After which the download will begin. And, if only the web interface is in the archive, it will download in about 10-15 seconds. Then you need to unzip the web interface. To do this, type the
archive tar / xtract 1.tar flash: command, where 1.tar is the downloaded archive.
Reinstalling the IOS operating system on the switch is complete.