You are on page 1of 29

Basic configuration

of Router and Switch


Part-I
IOS and CLI
How to use Cisco Command Line Interface

• The operating system of Cisco Switch and Router


is known as IOS (Internetwork Operating System).
• IOS is accessed,
1. By Terminal Emulator in CLI mode.
2. By Web Interface in GUI mode.

CLI is Command Line Interface.


GUI is Graphical User Interface.
IOS

• Why do we need IOS ?


-It provides a CLI and GUI interface to user for
configuration purpose to manage the device.
-It implements and controls the logic function
of the device like other Operating Systems.

CLI mode of IOS is accessed by the Terminal


Emulator (Putty, TeraTerm, Hyperterminal of
Windows).
How to access IOS in CLI mode ?

• Console port (a special physical interface on


device to provide the physical connection,
basically when the device is near and new).
• Telnet or SSH (use IP network between user’s PC
and device to provide the logical connection,
basically for remote access).
Console Port
• Console port is like Ethernet RJ-45 port.
• It supports RJ-45 connector.
• USB console is also available with newer models
of routers and switches.
• Generally console cable uses connectors RJ-45
and DB-9, known as Roll over cable.
• USB to USB console cable is also available. If
user’s PC does not support DB-9 serial port a USB
converter is used.
Console/Roll Over Cable Pin Out
Application to access CLI of IOS:Terminal Emulator

• To access the IOS in CLI mode.


• PC’s serial port and console port must be
synchronized, otherwise the IOS can not be
accessed over console.
Part-II
Basic Commands
CLI configuration

• User mode:
when we access the CLI, the first prompt we
get
switch> this is known as User EXEC mode.

The 2nd prompt we get,


Switch# this mode is known as Enable mode/
Privileged mode/Privileged EXEC mode.
Move from User EXEC to Enable mode
switch>enable
switch#disable
switch>
switch>
Enable mode is more powerful than User EXEC
mode and commands used in these 2 modes are
known as EXEC commands.
switch>reload ----------> not accepted

switch#reload ----------> accepted and


switch reboots the
IOS.
Global configuration Mode

switch>enable
switch#configure terminal
switch(config)# --------------> this is Global
Configuration
Mode
Host name configuration of Router and Switch

switch(config)#hostname inet_ccna
inet_ccna(config)#hostname jadavpur
jadavpur(config)#no hostname
switch(config)#
How to configure interface of a Router
or Switch

#show ip interface brief

This command is used to find the available


physical and logical interfaces in a device.
CLI help features

• ? Lists all the commands available in a mode.


switch#?
It lists all the command available in Enable
Mode.
• <tab> tells IOS to write the rest part of an
incomplete correct command.
switch#configure ter<tab>
switch#configure terminal
Some sub-configuration modes
• switch(config-line)# -------------> Line sub-configuration
mode

• switch(config-if)# ------------> Interface sub-configuration


mode.

• Router(config-router)# ------------> routing sub-


configuration mode.

• <ctrl+z> or end command is used to go back to Enable


mode from any mode except User Exec mode.
Show & debug commands
• show command helps to find the status of almost
every feature of Cisco IOS.
#show ip interface brief
EX: This command lists all the interfaces of a switch/router.
• debug command helps to tell the user about a
running operation of a device/process(not
recommended without technical knowledge).
#debug ip icmp
EX: This command displays the operation of ICMP
packets of a device.
Both commands are used in ENABLE/PRIVILEGE
mode.
Switch/Router memory components
• RAM: Volatile in nature, lost all its content if the
power is off or device is reloaded. Running or
active configuration file is stored here.
#show running-config
• Flash: Non-volatile in nature. Either an inside
chip or removable memory card. Stores IOS by
default, can store other files.
#show flash:
• ROM: Non-volatile in nature. Stores bootstrap
program. Bootstrap program loads during the
power on of the device, finds IOS image and
loads IOS image to RAM.

• NVRAM: Non-volatile in nature, stores startup


configuration. Startup-configuration is used
when the device is powered on or reloaded.
#show startup-config
Copying and erasing the configuration
files:

• We need to copy the running-configuration to


NVRAM from RAM so that the next time when
the device is powered on or reloaded it can
use the previously configured configuration.
• To show the content of RAM,
#show running-config
• To show the content of NVRAM,
#show startup-config
• To copy the content of RAM to NVRAM,
#copy running-config startup-config
or
#write
• To erase the startup-configuration from NVRAM,
#write erase or
#erase startup-config or
#erase nvram:
Special modes of Router/Switch….
• Setup mode: When only the default configuration
is present in a device (router/switch), it will ask
to enter a mode called setup mode. This mode
gives us instructions of configuration in device.
Normally we do not use this mode to manage or
configure the device. This mode is used by only
non-technical persons. Ctrl+C is used to exit from
this mode.
• ROMMON mode: ROM Monitor mode, low
level diagnostic mode. If IOS is corrupted or
console password is forgot, this mode is used.
To enter this mode over console, device is
powered off first, then powered on and
Ctrl+PauseBreak is pressed at a time.
Part-IV
Some Useful
Commands
• #show history
It lists the commands currently held in history
buffer.
• If a command is mistyped in Enable mode, IOS
thinks that user finds a device through Telnet by
its name. So, IOS tries to use DNS name
resolution. To stop this,
(config)#no ip domain-lookup
• To synchronize the CLI with syslog messages,
(config)#line console 0
(config-line)#logging synchronous
(config)#line vty 0 15
(config-line)#logging synchronous
• By default switch automatically disconnects console
or vty users after 5 minutes of inactivity.
(config)#line console 0
(config-line)#exec-timeout 0 0
(config)#line vty 0 15
(config-line)#exec-timeout 0 0
It means that the connection never timed out.

For verification,
#show line console 0

You might also like