Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

CCNP 642-811 BCMSN Exam Certification Guide - Cisco press

.pdf
Скачиваний:
161
Добавлен:
24.05.2014
Размер:
10.85 Mб
Скачать

96Chapter 4: Switch Configuration

copy running-config tftp:—A switch’s current running configuration is copied to a TFTP server. The server address and destination filename are prompted. Use this command to store a backup snapshot copy of the switch configuration.

copy tftp: startup-config—When a switch configuration is lost or needs to be restored to a known state, a backup copy of the configuration is copied from a TFTP server to the startup-config file. The new changes won’t take effect until the switch is reloaded, or until the startup-config is copied to the running-config. (You could also use copy tftp: running-config, but this would make immediate configuration changes as commands from the TFTP file are copied over. Use caution so that your configuration changes occur under controlled circumstances.)

erase startup-config—The entire contents of the startup-config file are erased. Use this command when a switch has been retired from one function and needs to be relocated or completely reconfigured.

Troubleshooting from the Operating System

The Cisco Catalyst IOS Software provides many commands that can verify or troubleshoot a switch in its current environment. Sometimes, you might wonder what software image or configuration commands are being used by a switch. A switch can also produce real-time debugging information about a feature or condition to aid in troubleshooting. Information is also available to help identify other neighboring Cisco devices in a network. This section explains each of these tasks and how to accomplish them using the relevant commands.

Show Configuration and File Contents

Cisco IOS Software offers many commands that you can use from the EXEC mode command line to display the contents of files, current configuration states, and values for troubleshooting. You can use the following commands to view and troubleshoot switch files and file systems:

show version—Displays the current version of IOS running in a switch, along with many details about available hardware, RAM and Flash memory, switch uptime, current running IOS image file, reason for the last reload, and the configuration register’s contents.

show running-config [interface type mod/num | vlan vlan-id | module mod]—Displays the contents of the running-config configuration file. You can jump to the relevant configuration of a specific interface, VLAN, or switch module, if desired.

show startup-config—Displays the startup-config configuration file’s contents.

show tech-support—Provides information to Cisco TAC support personnel; almost every known bit of information about the switch is displayed. Be sure to configure your terminal emulator to capture text to a file before issuing this command.

Troubleshooting from the Operating System 97

verify flash:filename—Verifies the checksum of the Flash file filename. This can ensure that an IOS image is not corrupted after it has been copied into Flash memory. (During the actual copy process, the checksum is automatically verified. You can use the verify command to make sure the file has not become corrupted since it was originally copied.)

more filesystem:filename—Displays the contents of a plain text file from the command line. This can be useful when you need to read configuration files that have been stored in a Flash file system. You can also view text files that are stored on a remote TFTP server—from the IOS command line.

NOTE You can filter the output of any show command so that you see only lines containing specific keywords. Append the “pipe” symbol (|) to the command line, followed by one of these keywords: begin text (start the output with the line containing text), include text (only display lines that contain text), or exclude text (only display lines that don’t contain text).

When a large amount of output is displayed, the switch usually shows a page at a time, pausing with a “-More-” prompt. You can either press the SPACE key to display the next page, the RETURN (Enter) key to display the next line, or /text to search forward and begin the page of output at the line containing text. Using the slash key allows a quick search within the context of the entire output.

Debugging Output

For more focused and real-time information about a certain switch feature, you can use the debug EXEC command. Debug output is not normally used, unless you suspect a problem with a feature or an interaction with other switches in the network.

You can use many options with the debug command—each pertaining to a switch feature or a specific activity. Type the debug command followed by ? to get context-based help on all the supported debugging commands and keywords.

After you enable a debug command, you can see the debug output listed as events can occur on the switch.

CAUTION Use the debug commands cautiously because they can generate a tremendous amount of output. Not only can this display slowly on a serial console connection, but also the debug process itself can bog the switch CPU down to the point that it severely impacts traffic forwarding.

98 Chapter 4: Switch Configuration

Always be sure to turn off any debugging commands when you finish with them. Do so by using the no debug options command, where the options keywords match the ones you used to enable debugging. To quickly disable all active debugging commands, use the no debug all or undebug all commands.

View CDP Information

To view information learned from CDP advertisements of neighboring Cisco devices, use one of the following commands:

Switch# show cdp interface [type mod/num]

Switch# show cdp neighbors [type mod/num | vlan vlan-id] [detail]

The first command displays CDP information pertaining to a specific interface. If the type, module, and port information is omitted, CDP information from all interfaces is listed. The second command displays CDP information about neighboring Cisco devices. A specific interface or VLAN can be given to display only neighbors connected to it. Using the detail keyword results in the display of all possible CDP information about each neighbor.

Recall that CDP messages are sent out every 60 seconds, and all entries received are placed in a cache. The cache is updated with new entries, and stale entries are aged out after a hold time of 180 seconds. If you suspect a problem with a neighboring switch, you might want to clear the CDP cache of all potentially state information to see what new information is being received from neighbors. Do this with the clear cdp table command.

As demonstrated in Example 4-1, the show cdp neighbors and the show cdp neighbors detail command can be useful when you are connected to a switch and need to know more about what other switches are nearby in a network. Particularly useful are the IP address entries, allowing Telnet access to previously unknown switches. To see a brief listing of only the neighbor switch names and their management IP addresses, use the show cdp entry * protocol command.

Example 4-1 Displaying CDP Information for Neighboring Devices

Switch# show cdp neighbors

 

 

 

 

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge

 

S - Switch, H - Host, I - IGMP, r - Repeater

 

Device ID

Local Intrfce

Holdtme

Capability

Platform

Port ID

BuildingA-1

Gig 2/1

158

S I

WS-C3550-4Gig 0/1

CoreSwitch-1

Gig 1/1

158

T S

WS-C6509

4/16

Switch# show cdp neighbors gig 1/1 detail

-------------------------

Device ID: CoreSwitch-1

Entry address(es):

IP address: 192.168.199.9

Troubleshooting from the Operating System 99

Example 4-1 Displaying CDP Information for Neighboring Devices (Continued)

Platform: WS-C6509, Capabilities: Trans-Bridge Switch

Interface: GigabitEthernet1/1, Port ID (outgoing port): 4/16

Holdtime : 130 sec

Version :

WS-C6509 Software, Version McpSW: 7.2(2) NmpSW: 7.2(2)

Copyright (c) 1995-2002 by Cisco Systems

advertisement version: 2

VTP Management Domain: 'Core'

Switch# show cdp entry * protocol

Protocol information for BuildingA-1 :

IP address: 192.168.199.107

Protocol information for CoreSwitch-1 :

IP address: 192.168.199.9

Switch#

100 Chapter 4: Switch Configuration

Foundation Summary

The Foundation Summary is a collection of tables that provides a convenient review of many key concepts in this chapter. If you are already comfortable with the topics in this chapter, this summary can help you recall a few details. If you just read this chapter, this review should help solidify some key facts. If you are doing your final preparation before the exam, the following tables are a convenient way to review the day before the exam.

Table 4-3 Switch Management Configuration Commands

Task

Command Syntax

 

 

Identify switch

hostname hostname

 

 

Set EXEC level password

line type number

 

password password

 

 

Set privileged level password

enable secret password

 

 

Set IP address

interface vlan vlan-id

 

ip address ip-address netmask

 

ip default-gateway ip-address

 

 

CDP (default is enabled on every switch port)

cdp enable

 

 

Table 4-4 File Management Commands

Task

Command Syntax

 

 

Directory of Flash

dir [flash:[directory]]

 

 

Change directory

cd flash:directory

 

 

Copy a file between Flash and a TFTP server

copy flash:[filename] tftp:

 

-OR-

 

copy tftp: flash:[filename]

 

 

Delete a file in Flash

delete flash:filename

 

 

 

 

 

Foundation Summary 101

Table 4-4 File Management Commands (Continued)

 

 

 

 

 

 

 

Task

 

Command Syntax

 

 

 

 

 

Clear Flash contents

 

erase flash:

 

 

 

-OR-

 

 

 

format flash:

 

 

 

 

 

Save the running configuration

 

copy running-config startup-config

 

 

 

-OR-

 

 

 

copy running-config tftp:

 

 

 

 

 

Overwrite the running configuration

 

copy startup-config running-config

 

 

 

 

 

Overwrite the permanent configuration

 

copy tftp: startup-config

 

 

 

-OR-

 

 

 

erase startup-config

 

 

 

 

Table 4-5 Troubleshooting Commands

 

 

 

 

 

 

Task

Command Syntax

 

 

 

 

Display the current running environment and

show version

 

IOS version

 

 

 

 

 

 

Display the running configuration

show running-config [interface type mod/num | vlan

 

 

vlan-id | module mod]

 

 

 

 

Display the permanent configuration

show startup-config

 

 

-OR-

 

 

show config

 

 

 

 

Display all technical support information

show tech-support

 

 

 

 

Verify an image checksum

verify flash:filename

 

 

 

 

continues

102 Chapter 4: Switch Configuration

Table 4-5 Troubleshooting Commands (Continued)

Task

Command Syntax

 

 

Enable or disable debugging

debug keywords

 

no debug keywords

 

-OR-

 

no debug all

 

-OR-

 

undebug all

 

 

Display CDP information

show cdp interface [type mod/num]

 

-OR-

 

show cdp neighbors [type mod/num | vlan vlan-id]

 

[detail]

 

-OR-

 

show cdp entry * protocol

 

 

Q&A 103

Q&A

The questions and scenarios in this book are more difficult than what you should experience on the actual exam. The questions do not attempt to cover more breadth or depth than the exam; however, they are designed to make sure that you know the answer. Rather than allowing you to derive the answer from clues hidden inside the questions themselves, the questions challenge your understanding and recall of the subject. Hopefully, these questions will help limit the number of exam questions on which you narrow your choices to two options and then guess.

You can find the answers to these questions in Appendix A.

1.When Cisco IOS Software is used on a Catalyst switch, the switch must perform routing. True or false?

2.What is the major difference between the IOS and CatOS command sets?

3.What switch command will enter privileged EXEC or “enable” mode on a Catalyst 4500?

4.Match these default command line prompts with their respective modes:

a.

Switch#

 

Normal user EXEC mode

b.

Switch(config)

 

Privileged EXEC or enable

c.

Switch(config-if)#

 

Global configuration

d.

Switch>

 

Interface configuration

5.With the command line prompt testlab#, what command has been used to customize the prompt?

104 Chapter 4: Switch Configuration

6.The following commands have just been entered, assuming interface VLAN 10 did not previously exist:

interface vlan 10

ip address 192.168.199.10 255.255.255.0 no shutdown

Suddenly, the power cord is pulled out of the switch. What will happen when the power is restored?

7.Can you configure an enable secret password (enable secret password) for the switch console and a different enable secret for Telnet access?

8.When you configure an IP address and subnet mask on a Layer 2 switch for management purposes, which VLAN are you required to use?

a.VLAN 1

b.VLAN 0

c.VLAN 1001

d.Any VLAN that is appropriate

e.You can’t assign an IP address to a VLAN.

9.What commands will allow Telnet and ping access to a switch management interface at 192.168.200.10, subnet mask 255.255.255.0, on VLAN 5? A router is available at address 192.168.200.1.

10. CDP advertisements occur every

 

seconds.

11.When a Cisco Catalyst switch receives a CDP multicast frame, it relays it to neighboring switches. True or false?

12.Eight access layer switches connect to a central distribution layer switch using Gigabit Ethernet connections. Each connection is assigned to VLAN 1 so that no link is in trunking mode. On one of the access switches, how many neighboring switches will be shown by the show cdp neighbor gigabit 0/1?

13.Which IOS image file is more recent: c3550-i5q3l2-mz.121-12c.EA1.bin or c3550-i9q3l2-mz.121-11c.EA1.bin?

14.A new switch has just been configured with 100 command lines from the console. You realize the need to save the new configuration and type copy start run. Where will your configuration be stored?

15.What command can you use to see what Cisco IOS Software version is currently running on a switch?

Q&A 105

16.Complete this command so that the output is displayed starting with the configuration for interface VLAN 100:

show run

17.The debug spanning-tree all command has been given from the EXEC mode command line. What commands can you use to stop or disable the debugging output?

18.What command can you use to verify CDP configuration on switch port GigabitEthernet 3/1?

Соседние файлы в предмете Сети и Телекоммуникации