Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
http://www.mcmcse.com/
http://www.mcmcse.com/
The Cisco Command Line Interface (CLI) is called EXEC. EXEC has two modes: User mode
Privileged mode
For security purposes the two EXEC modes serve as two levels of access to Cisco IOS
commands.
EXEC user commands allow you to
connect to remote devices
make temporary changes to terminal settings
perform basic tests
list system information
If you want to access privileged mode you have to enter a password. The commands
available in Privileged mode also include all those available in User mode. You can use
Privileged EXECcommands to: set operating parameters
perform a detailed examination of the router's status
test and debug router operation
access global and other included configuration modes
From Privileged mode you can enter global configuration mode. This gives you access to
configuration commands that affect the system as a whole, and to other configuration modes.
You can specify the source of the configuration commands as being from : a terminal
memory
the network
You can access many other specific configuration modes from Global Configuration mode
that allow complex configurations to be performed.
Setup Mode: If the router does not have a configuration file it will automatically enter Setup mode
when you switch it on. Setup mode presents you with a prompted dialog, called the system
configuration dialog, in which you establish an initial configuration.
Rom Monitor Mode: If the router does not find a valid operating system image, or if you interrupt the
boot sequence, the system may enter ROM monitor mode. From ROM monitor mode you can boot
the device or perform diagnostic tests.
Editing
&
Hot
keys
Cisco IOS
Cisco Internetwork Operating System software. The proprietary Cisco software that provides
common functionality, scalability, and security for Cisco products.
http://www.mcmcse.com/
CLI (Command Line Interface): The screen interface that allows the user to interact with the
operating system by entering commands and optional arguments.
Command Modes
A hierarchical level of Cisco IOS software. Each command mode permits you to configure different
configuration components. For example, you configure global parameters in global configuration
mode, interface parameters in interface configuration mode, and line parameters in line configuration
mode. There are five command modes. Each mode is represented by a different prompt, as shown in
the table below:
Command Mode
Prompt
User EXEC
Router1>
login
Privileged EXEC
Router1#
enable
Global configuration
Router1(config)#
configure terminal
Interface
configuration
Router1(config-if)#
interface type
(from global configuration mode)
number
Sub
interface Router1(configconfiguration
subif)#
interface type
number
(to configure a sub interface from within
interface configuration mode)
Router configuration
Router1(configrouter)#
router routing_protocol
(from global configuration mode)
Line configuration
Table-1:
Cisco
CLI
Command
Modes,
respective
prompts
line_number
and
commands.
Exec Mode
A console, modem, or Telnet command-line session to the router. There are two primary levels to the
EXEC mode: user-level EXEC mode, and privileged EXEC mode. User-level EXEC is the initial mode
entered upon logging into the router, and allows access only to basic monitoring commands. It is
indicated
by
the
>
prompt:
Router1>
Privileged-level EXEC mode, sometimes called enable mode, provides access to configuration mode,
which permits authorized users to configure and manage the router. To enter the privileged-level
EXEC mode, enter the enable command, enter the enable password, and press Return. The prompt
changes
to
the
pound
sign
(#)
as
shown
in
the
following
example:
Router1>
enable
Password:
netserv3
Router1#
http://www.mcmcse.com/
The commands entered in Global Configuration Mode affect the whole router. Here are the steps from
Privileged
EXEC
mode:-
Interface Mode
The commands entered in this mode affect the current interface only. Here are the steps from Global
Configuration
mode:-
Line Mode
The router has three types of terminal lines: one console line, one auxiliary line, and five virtual
(network)
lines:-
To list all commands available for a particular command mode, enter a question mark (?) at
the system prompt.
To obtain a list of commands that begin with a particular character string, enter the
abbreviated command entry immediately followed by a question mark (?). This form of help is
http://www.mcmcse.com/
called word help, because it lists only the keywords or arguments that begin with the
abbreviation you entered. e.g.
Router#
configureconnectcopy
co?
To list a command's associated keywords or arguments, enter a question mark (?) in place of
a keyword or argument on the command line. This form of help is called command syntax
help, because it lists the keywords or arguments that apply based on the command,
keywords, and arguments you have already entered .
e.g.
The following example shows how to use command syntax help to display the next argument of a
partially complete access-list command. One option is to add a wildcard mask. The <cr> symbol
indicates that the other option is to press Return to execute the command.
Router(config)#
A.B.C.D
<cr>
accesslist
Mask
99
deny
of
bits
10.5.8.24
?
to
ignore
Note: If you enter an incorrect command, the caret symbol (^) and help response indicate the error.
Notice that the caret symbol character is displayed at the point in the command string where the IOS
detected
that
you
entered
an
incorrect
command,
keyword,
or
argument.
This error location facility together with the interactive help system allows you to find and correct
syntax
errors
easily.
http://www.mcmcse.com/
Router(config)#hostnameHow2Pass
The factory-assigned default host name is router.
Setting the System Clock
The system clock runs from the moment the system starts up and keeps track of the current date and
time based on Coordinated Universal Time (UTC), also known as Greenwich Mean Time (GMT). The
system clock can be set from a number of sources, and in turn can be used to distribute the current
time through various mechanisms to other systems. To manually set the system clock, use one of the
formats of the clock set EXEC command.
clock
set hh:mm:ss
clock set hh:mm:ss month day yyyy
day
month
yyyy
In the following example, the system clock is manually set to 1:32 p.m. on May 12, 2001:
Router#
clock
Top
http://www.mcmcse.com/
set
13:32:00
12
May
2001
show
clock
the
MOTD
Router(config)#
banner
banner
appears
motd
before
the
login
message
prompt.
Here (#) sign is used as delaminating character. You can use any character.
Setting the Description for an Interface
To add a description to an interface configuration, use the description interface configuration
command.
Use
the no form
of
this
command
to
remove
the
description.
The description command is meant solely as a comment to be put in the configuration to help you
remember
what
certain
interfaces
are
used
for.
startup-config, show
interfaces,
and show
running-config
Top
Setting the Line Password
To specify a password on a line, use the password line configuration command. Use the no form of
this command to remove the password. The first character cannot be a number. The string can
contain any alphanumeric characters, including spaces, up to 80 characters.
Console Password
Console password is needed when logging into router at user EXEC mode from console.
Router(config)# line console 0
http://www.mcmcse.com/
Can have leading spaces, but they are ignored. However, intermediate and trailing spaces are
recognized.
http://www.mcmcse.com/
The Switch
A switch is a layer 2 network device that forwards frames using MAC addresses in the header of
frames. It is used to improve network performance by: segmenting the network and creating separate collision domains.
reducing competition for bandwidth.
In a switch frame forwarding is handled by specialized hardware called "Application Specific
Integrated Circuit" (ASIC). ASIC technology allows a silicon chip to be programmed to perform
specific
functions
much
faster
than
that
of
chip
programmed
by
software.
Top
Steps of Switch Functioning
Learning
When switch starts, the MAC address table has no entry. When a node transmits data on its wire the
MAC address of the node is learned by Switch Port connected to that node. In this way all the MAC
addresses are learned by respective ports and these entries remain in the cache for a specific time. If
during this specific time no new frame arrives from a node MAC address entry for that node is
dropped from cache.
Forwarding & Filtering
When a MAC address for a port is learnt, packets addressed to that MAC address are forwarded only
to the port associated with it, using one of the Switching Methods.
Loop Avoidance
Switches and Bridges use Spanning Tree Protocol (STP), specified by IEEE 802.1d, to prevent loops.
Top
Switching Methods
http://www.mcmcse.com/
Store & Forward: In this method complete frame is received by the switch. CRC, source address
and destination address are checked. This method has following features: Highest latency (delay in forwarding of frame) but may vary depending upon the length of frame.
Highest error checking.
Lowest frame forwarding speed.
Catalyst 500 switch uses this method.
Cut Through: In this method forwarding starts as soon as destination address of the frame is
received in header. Also known as WIRE SPEED. This method has following features: Lowest latency.
Lowest error checking.
Highest frame forwarding speed.
Fragment Free (Modified Cut Through): In this method forwarding starts as soon as first 64 bytes
of the frame are received as fragmentation occurs usually in first 64 bytes. This method has following
features: Latency approx 60Sec.
Sufficient error checking.
Moderate frame forwarding speed.
Top
The Bridge
It is a layer 2 device used to connect different network types or networks of the same type. Packets
having destination address on the same network segment are dropped. Bridges use "Store and
Forward" method to inspect the whole packet.
Advantages: Using a bridge to segment network can provide: Reliability.
http://www.mcmcse.com/
Manageability.
Scalability.
Disadvantages:
A bridge cannot filter out broadcast traffic.
It introduces 20 to 30 % latency.
Only 2 networks can be linked with a bridge.
Frame Relay
Frame
Frame
Frame
Frame
Frame
Relay
Overview
Relay
Relay
Relay
NBMA
Configuration
Sub
interface
Configuration
Relay
Configuration
and
and
Configuration
Verification
Verification
Summary
http://www.mcmcse.com/
FortWorth end has DLCI 101. These DLCIs, since they are on different local loops, do not
have to be different, but they usually are, anyway. When Dallas wants to send a packet to
FortWorth, Dallas must transmit the packet out the serial interface that contains the PVC,
and the frame header must contain the local DLCI, 100. The switch knows that the path of
the PVC with DLCI 100 on the Dallas side is supposed to go to the switch connected to
FortWorth. The switch connected to FortWorth knows the path of the PVC extends across
the local loop to FortWorth and the DLCI of the PVC on the local loop is 101. The switch
puts the DLCI 101 into the frame header so the FortWorth router knows, when it receives
the frame, that the frame came in on the PVC with local DLCI 101.
Dallas has two PVCs coming in on the same local loop; therefore, these PVCs must have
different local DLCIs. The frame relay topology shown in Figure 1 is called a partialmeshednetwork because not all of the routers have PVCs to all of the other routers. We
could also call this particular topology a hub-and-spoke network because there is one router
(the hub) that has a connection to each of the other routers (the spokes), and traffic from a
spoke router must go through the hub to reach another spoke router. A fully meshed network
has PVCs running between all of the router pairs; to make the Figure 1 frame relay topology
into a fully meshed network, we would have to add a PVC between FortWorth and Austin.
Routers and switches maintain contact with each other using Local Management
Interface(LMI). About every 10 seconds, routers and switches send an LMI keepalive across
the local loop. If a router is receiving LMI keepalives from a switch, the router makes the line
protocol of its interface up so the interface state will be up/up. If a Cisco router interface is
connected to a frame relay network and the state of the interface is up/up, the router has a
communication path to a frame relay switch. This has nothing to do with being able to reach
another router on the other end of a PVC. By default, a Cisco router uses LMI to request a
status report from the switch every six keepalives (about once a minute). The status report
contains a list of each of the local loops PVCs, their DLCIs, and their status.
There are two types of LMI that are widely used between routers and switches: Annex D and
Gang of Four. Annex D is from the American National Standards Institute (ANSI). The Gang
of Four LMI was jointly developed by Cisco, DIGITAL, Intel, and Stratacom. The router and
the local switch must agree on the type of LMI they will use between them.
http://www.mcmcse.com/
There are two ways of configuring frame relay on a Cisco router. The first configuration
method uses the classic, frame relay nonbroadcast multiaccess (NBMA) model. In this
configuration, the frame relay network is treated as a multiaccess network like a LAN;
however, unlike a LAN, a frame relay network has no broadcast capability. There is no
frame relay broadcast address. All of the routers connected to the NBMA network share a
network address such as an IP subnet address or an AppleTalk cable range. The second
configuration method involves treating each of the PVCs as a separate logical point-topoint network, which is done by creating a sub interface for each PVC. The sub interface
method requires more network addresses because each PVC has its own network
address.
Of the two methods, the sub interface method is usually the recommended one. Both
configuration methods are briefly described in the following sections.
We are going to move our IP traffic from the point-to-point serial links to a frame relay
network. To do this, we are going to do something that is not normally recommended in a
production network. We are going to remove the IP addresses from the point-to-point serial
links, and we are going to stop the current IP routing protocol, OSPF, which was configured
inChapter 7. Figure 13-2 shows the IP configuration changes on Dallas, FortWorth, and
Austin.
1) Dallas#configure terminal
http://www.mcmcse.com/
4) Dallas(config)#interface serial0
5) Dallas(config-if)#no ip address
6) Dallas(config-if)#interface serial1
7) Dallas(config-if)#no ip address
8) Dallas(config-if)#<Ctrl-Z>
9) Dallas#
10)
12) Enter configuration commands, one per line. End with CNTL/Z.
18) FortWorth(config-if)#<Ctrl-Z>
http://www.mcmcse.com/
19) FortWorth#
20)
22) Enter configuration commands, one per line. End with CNTL/Z.
28) Austin(config-if)#<Ctrl-Z>
29) Austin#
After issuing the commands in Figure 2, IP is no longer being routed across our WANs. We will
restore IP connectivity by configuring frame relay on the routers.
http://www.mcmcse.com/
Router Modes:
Router#: Privileged mode (exec-level mode) = Provides access to all other router
commands
Configuring passwords:
1
2
Encrypting passwords:
1
Configuring banners:
1
2
3
4
5
http://www.mcmcse.com/
! or DHCP
Saving configuration:
1
2
3
4
5
6
7
8
9
Working environment:
name lookup, history, exec-timeout and logging behavior, also valid for line con 0.
1
2
3
4
5
SW1(config)# no ip domain-lookup
SW1(config)# line vty 0 4
SW1(config-line)# history size 15
SW1(config-line)# exec-timeout 10 30
SW1(config-line)# logging synchronous
1
2
1
2
3
4
Aliases:
Used to create shortcuts for long commands.
http://www.mcmcse.com/
1
2
3
Shows information about the switch and its interfaces, RAM, NVRAM, flash, IOS,
etc.
SW1# show version
Shows the configuration file stored in NVRAM which is used at first boot process.
SW1# show startup-config
address if assigned.
SW1# show ip interface brief
1
1
access vlan.
SW1# show interfaces status
Shows the public encryption key used for SSH.
SW1# show crypto key mypubkey rsa
Shows detailed information about the specified interface, its status, protocol,
Shows an overview of all interfaces, their physical status, protocol status and ip
http://www.mcmcse.com/
Router Commands
Terminal Controls:
http://www.mcmcse.com/
Config# boot system tftp FILENAME SERVER_IP - Example: boot system tftp
2600_ios.bin 192.168.14.2
Config# boot system ROM
Config# boot system flash - Then - Config# reload
CDP:
http://www.mcmcse.com/
Clearing Counters:
IP Standard
1-99
IP Extended
100-199
http://www.mcmcse.com/
IPX Standard
800-899
IPX Extended
900-999
1000-1099
IP Standard:
http://www.mcmcse.com/
IPX Standard:
http://www.mcmcse.com/
http://www.mcmcse.com/
1.
Configure Interface
Other Options
http://www.mcmcse.com/
http://www.mcmcse.com/
http://www.mcmcse.com/
http://www.mcmcse.com/
Configuring VTP:
! options: shutdown,
The sticky keyword is used to let the interface dynamically learns and configures the MAC
addresses of the currently connected hosts.
http://www.mcmcse.com/
! options:
Configuring VLANs:
1
2
1
2
3
Configuring Trunks:
1
2
3
1
2
Configuring VTP:
The transparent VTP mode is used when an engineer wants to deactivate VTP on a
particular switch
! case-sensitive
! case-sensitive
http://www.mcmcse.com/
Lists all the trunk ports on a switch including the trunk allowed VLANs:
SW1# show interfaces trunk
Lists VTP configuration (mode, domain-name, version, etc) and revision number:
SW1# show vtp status
STP optimization:
1
2
3
4
1
Portfast and BPDU guard are enabled only on interfaces connected to end user hosts
1
2
http://www.mcmcse.com/
names capabilities:
SW1# show cdp neighbors
1
2
3
1
Shows information about the directly connected cisco devices including interfaces
Shows detailed information about the neighboring cisco devices including device
http://www.mcmcse.com/