You are on page 1of 9

Network device configuration (ITec4113) Chapter Three Basic configuration of router and Switch

CHAPTER 3

Basics configuration of router and switch

3.1 Cisco IOS Modes of Operation


The Cisco IOS software provides access to several different command modes. Each command
mode provides a different group of related commands.
For security purposes, the Cisco IOS software provides two levels of access to commands: user
and privileged. The unprivileged user mode is called user EXEC mode. The privileged mode is
called privileged EXEC mode and requires a password. The commands available in user EXEC
mode are a subset of the commands available in privileged EXEC mode.
Note:
✓ User EXEC mode Limited to basic monitoring commands.
✓ Privileged EXEC mode Provides access to all other router commands.
✓ Global configuration mode Commands that affect the entire system.
✓ Specific configuration modes Commands that affect interfaces/processes only.
The following table describes some of the most commonly used modes, how to enter the modes,
and the resulting prompts. The prompt helps you identify which mode you are in and, therefore,
which commands are available to you.

Mode of Usage How to Enter the Mode? Prompt


operation
User EXEC Change terminal First level accessed. Router>
settings on a temporary
basis, perform basic
tests, and list system
information.
Privileged EXEC System administration, Router>enable Router#
set operating
parameters.
Global Config Modify configuration Router#configure Router(config)#
that affect the system terminal
as a whole.
Interface Config Modify the operation Router(config)#interface Router(config-if)#
of an interface. fastethernet 0/0

User EXEC Mode:

When you are connected to the router, you are started in user EXEC mode. The user EXEC
commands are a subset of the privileged EXEC commands.

Page 1 of 9 DTU Compiled By: Alemu W.


Network device configuration (ITec4113) Chapter Three Basic configuration of router and Switch

Privileged EXEC Mode:

Privileged commands include the following:

• Configure – Changes the software configuration.

• Debug – Display process and hardware event messages.

• Setup – Enter configuration information at the prompts.

Enter the command disable to exit from the privileged EXEC mode and return to user EXEC
mode.

Configuration Mode
Configuration mode has a set of submodes that you use for modifying interface settings, routing
protocol settings, line settings, and so forth. Use caution with configuration mode because all
changes you enter take effect immediately.

To enter configuration mode, enter the command configure terminal and exit by pressing Ctrl-Z.

3.2 Basic Router/Switch Configuration

Use the following topology for the whole basis router and switch configuration.

1. Getting Help
In any command mode, you can get a list of available commands by entering a question mark (?).
Router>?
To obtain a list of commands that begin with a particular character sequence, type in those
characters followed immediately by the question mark (?).
Router#co?

Page 2 of 9 DTU Compiled By: Alemu W.


Network device configuration (ITec4113) Chapter Three Basic configuration of router and Switch

Configure connect copy


To list keywords or arguments, enter a question mark in place of a keyword or argument. Include a
space before the question mark.
Router#configure?
memory Configure from NV memory
network Configure from a TFTP network host
terminal Configure from the terminal
You can also abbreviate commands and keywords by entering just enough characters to make the
command unique from other commands. For example, you can abbreviate the show command to
sh.

2. Disabling DNS lookup


DNS lookup can sometime take your time looking for the name translations even if you didn’t
configure any host name but we can disable the DNS lookup from your cisco device.
Example:
Router>enable
Router#configure terminal
Router(config)#no ip domain-lookup
Router(config)#exit

3. Rename the Router


To specify or modify the host name for the router, global configuration command HOSTNAME is
used. Hostname is case sensitive. The host name is used in prompts and default configuration
filenames. For instance the first router R1 can be renamed as DTUR1 as follow.
Router (config) # hostname DTUR1
DTUR1(config) #
The factory-assigned default host name is router.
4. 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 day month yyyy
clock set hh:mm:ss month day yyyy

In the following example, the system clock is manually set to 1:32 p.m. on May 12, 2001:
DTUR1# clock set 13:32:00 12 DEC 2015

Page 3 of 9 DTU Compiled By: Alemu W.


Network device configuration (ITec4113) Chapter Three Basic configuration of router and Switch

Show System Time


To display the system clock, use the show clock EXEC command. If time has not been set by the
clock set command then this command will show the time elapsed since router is up.
DTUR1# show clock
5. Setting the Banner
To specify a message-of-the-day (MOTD) banner, use the banner motd global configuration
command. The no form of this command deletes the MOTD banner. When someone connects to
the router, the MOTD banner appears before the login prompt.
DTUR1(config)# banner motd # message #
Here (#) sign is used as delaminating character. You can use any character.
6. Setting Passwords
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.
a. Console Password
Console password is needed when logging into router at user EXEC mode from console.
DTUR1 (config)# line console 0
DTUR1 (config-line)# password conolePassword
DTUR1 (config-line)#login

b. Vty lines password


Virtual terminal lines (vty) are used to allow remote access to the router (by telneting through its
interfaces). The router has five virtual terminal lines by default.
DTUR1 (config)# line vty 0 4
DTUR1 (config-line)# password vtyPassword
DTUR1 (config-line)#login

c. Privileged Access Password


To set a local password to control access to various privilege levels, use the enable password
global configuration command. Use the no form of this command to remove the password
requirement.
An enable password is defined as follows:
• Must contain from 1 to 25 uppercase and lowercase alphanumeric characters.
• Must not have a number as the first character.
• Can have leading spaces, but they are ignored. However, intermediate and trailing spaces
are recognized.
DTUR1 (config)# enable password WeakPrivilegePassword

Page 4 of 9 DTU Compiled By: Alemu W.


Network device configuration (ITec4113) Chapter Three Basic configuration of router and Switch

Setting Secret (Encrypted) Password


To set an encrypted local password to control access to various privilege levels, use the enable
secret global configuration command. Use the no form of this command to remove the password
requirement.

DTUR1 (config)# enable secret StrongPrivilegePassword


7. Bring up an interface
On cisco routers all interfaces by default are in shut down mode means administratively down
You can check the status of these interfaces by using the command show ip interface brief at the
user privellige mode on cisco routers. To bring up the status of an interface we use the no
shutdown command.
Example:
DTUR1>enable
DTUR1#configure terminal
DTUR1 (config)#interface serial2/0
DTUR1 (config-if)#no shutdown
DTUR1 (config-if)#exit
DTUR1 (config)#interface fastethernet0/0
DTUR1 (config-if)#no shutdown
DTUR1 (config-if)#exit
8. Clock rate on serial interfaces
Serial interface with DCE ends of a router need to be configured with the clock rate and following
example describe the commands used to set the clock rate on serial interfaces.
Example:
DTUR1>enable
DTUR1#configure terminal
DTUR1 (config)#interface serial2/0
DTUR1 (config-if)#no shutdown
DTUR1 (config-if)#clock rate 4800
DTUR1 (config-if)#exit
The clock rate can be set from some specific values.
9. 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.
The following example shows how to add a description for a T1 interface:
Router(config)# interface serial 2/0
DTUR1 (config-if)# description T1 line to DTUR1- 128 Kb/s

Page 5 of 9 DTU Compiled By: Alemu W.


Network device configuration (ITec4113) Chapter Three Basic configuration of router and Switch

The description "T1 line to DTUR1- 128 Kb/s" appears in the output of the following EXEC
commands: show startup-config, show interfaces, and show running-config
DTUR1# show startup-config
DTUR1# show interfaces
DTUR1# show running-config

10. IP addressing
Every interface need to be configured with an IP address on the router to communicate over the
network. Consider an example in which we will assign the ip address 192.168.10.1 with subnet
mask 255.255.255.0 on FastEthernet interface of router and ip address 192.168.20.1 with subnet
mask 255.255.255.0 on the serial interface of router.
DTUR1>enable
DTUR1#configer terminal
DTUR1 (config)#interface fastethernet0/0
DTUR1 (config-if)#ip address 10.10.10.1 255.255.255.0
DTUR1 (config-if)#no shutdown
DTUR1 (config-if)#exit
DTUR1 (config)interface serial2/0
DTUR1 (config-if)#ip add 192.168.20.1 255.255.255.252
DTUR1 (config-if)#no shutdown
DTUR1 (config-if)exit
11. Handling configuration Files
Any time you make changes to the router configuration, you must save the changes to memory
because if you do not they will be lost if there is a system reload or power outage. There are two
types of configuration files: the running (current operating) configuration and the startup
configuration.
Use the following privileged mode commands to work with configuration files.
• configure terminal – modify the running configuration manually from the terminal.
• show running-config – display the running configuration.
• show startup-config – display the startup configuration.
• copy running-config startup-config – copy the running configuration to the startup
configuration.
• copy startup-config running-config – copy the startup configuration to the running
configuration.
• erase startup-config – erase the startup-configuration in NVRAM.
• copy tftp running-config– load a configuration file stored on a Trivial File Transfer
Protocol (TFTP) server into the running configuration.
• copy running-config tftp– store the running configuration on a TFTP server.

Page 6 of 9 DTU Compiled By: Alemu W.


Network device configuration (ITec4113) Chapter Three Basic configuration of router and Switch

Viewing, saving and erasing configurations


After you are done with your router’s configurations you can view save and erase the
configurations of your router.
Example:
Viewing
DTUR1>enable
DTUR1#show running-config

Saving
DTUR1>enable
DTUR1#copy running-config starup-configOr
DTUR1#write
Erasing startup configurations
DTUR1>enable
DTUR1#erase startup-config

12. no and do commands


Almost every configuration command also has a no form. In general, use the no form to disable a
feature or function. Use the command without the keyword no to re-enable a disabled feature or to
enable a feature that is disabled by default. For example, IP routing is enabled by default. To
disable IP routing, enter the no ip routing command and enter ip routing to re-enable it. For
instance to remove previously configured IP address in DTUR1 router fast Ethernet 0/0 you can
type the following.
DTUR1(config)#int fa0/0
DTUR1(config-if)#no ip address

13. Disabling Logging synchronous messages


When configuring routers and switches sometime some interrupting messages may disturb you. To
stop this kind of messages use the following command
DTUR1(config)#line console 0
DTUR1(config-line)#logging synchronous

Page 7 of 9 DTU Compiled By: Alemu W.


Network device configuration (ITec4113) Chapter Three Basic configuration of router and Switch

3.3 Troubleshooting: TCP/IP Utilities


TCP/IP also provides a number of command-line utilities that can be useful when troubleshooting
networks. You can use any of these utilities at the DOS command prompt in Windows.

1 .Ping
To test if your network connection is complete between two computers, you can use the Packet
Internet Groper, better known as ping. The ping utility works by sending a message to a remote
computer. If the remote computer receives the message, it responds with a reply message (see
Figure 1). The reply consists of the remote workstation's IP address, the number of bytes in the
message, how long it took to reply - given in milliseconds (ms) - and the time-to-live (TTL) in
seconds. If you receive back the message "Request timed out," this means that the remote
workstation did not respond before the TTL time expired. This might be the result of heavy
network traffic or it might indicate a physical disconnection in the path to the remote workstation.

2 .Tracert
Another utility that documents network performance is called tracert. While the ping utility
merely lets us know that the connection from A to B is complete, tracert informs us of the route
and number of hops the packet of data took to arrive at its destination.

3. Ipconfig
Another useful software troubleshooting tool is ipconfig. This diagnostic command displays all
current TCP/IP network-configuration values. This command is useful on systems running DHCP,
allowing users to determine which TCP/IP configuration values have been configured by DHCP.
An example of using the ipconfig utility is shown in Figure 2. The output lists the current IP
address of the computer, the subnet mask, and the default gateway. The subnet mask indicates
which class of network the computer is a part of. Because the first three numbers in the subnet
mask are 255 this means that the computer is on a class C network (i.e. the first 24 bits of the IP
address are fixed). If this computer needs to send a packet of data to a computer outside of this
subnet, it must first send it to the default gateway. The default gateway is a computer or router on
the subnet that is responsible for forwarding packets to addresses outside the subnet.

5 .Nslookup
Nslookup is a utility that can be used to manually query the DNS database. It can be a useful
troubleshooting tool if the DNS server is not working correctly.

6. Netstat
The netstat command can be used to display the currently active TCP connections on a computer.

Page 8 of 9 DTU Compiled By: Alemu W.


Network device configuration (ITec4113) Chapter Three Basic configuration of router and Switch

7. Route
Every computer and network routing device stores a routing table in its RAM. A routing table
stores information about which routers to send network packets to. The route command can be
used to display and modify the routing table of a computer.

Exercise:
Use the above topology
1. Configure Router R2 (Follow the configuration done on DTUR1)
2. Configure the Switch( rename, set passwords, disable DNS lookup etc)
3. Statically assign IP addresses to PCs
4. Remotely configure R2 from PC A (use telnet and SSH)
5. Check all network troubleshooting commands discussed in the material on both a Physical machine and
PCs used in Packet Tracer for the above topology
6. What is the function of a Clock rate command? Clock rate Vs bandwidth commands

Page 9 of 9 DTU Compiled By: Alemu W.

You might also like