Lab – Configuring Basic Router Settings with IOS CLI

Cisco Packet Tracer

Topology

Addressing Table

Device

Interface

IP Address

Subnet Mask

Default Gateway

R1

fa0/0

192.168.0.1

255.255.255.0

N/A

R1

fa0/1

192.168.1.1

255.255.255.0

N/A

PC-A

NIC

192.168.1.3

255.255.255.0

192.168.1.1

PC-B

NIC

192.168.0.3

255.255.255.0

192.168.0.1

Step 1: Configure Devices and Verify Connectivity

  • Configure the IP address, subnet mask, and default gateway settings on PC-A.

PC>ipconfig /all

FastEthernet0 Connection:(default port)

   Connection-specific DNS Suffix..: 
   Physical Address................: 0040.0B66.B934
   Link-local IPv6 Address.........: FE80::240:BFF:FE66:B934
   IP Address......................: 192.168.1.3
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 192.168.1.1
   DNS Servers.....................: 0.0.0.0
   DHCP Servers....................: 0.0.0.0
   DHCPv6 Client DUID..............: 00-01-00-01-D3-43-6B-E7-00-40-0B-66-B9-34


PC>
  • Configure the IP address, subnet mask, and default gateway settings on PC-B.

PC>ipconfig /all

FastEthernet0 Connection:(default port)

   Connection-specific DNS Suffix..: 
   Physical Address................: 0001.6314.01D0
   Link-local IPv6 Address.........: FE80::201:63FF:FE14:1D0
   IP Address......................: 192.168.0.3
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 192.168.0.1
   DNS Servers.....................: 0.0.0.0
   DHCP Servers....................: 0.0.0.0
   DHCPv6 Client DUID..............: 00-01-00-01-C3-4B-30-AB-00-01-63-14-01-D0


PC>

Step 2: Configure the router.

  • Assign a device name to the router.

Router>enable 
Router#configure terminal 
Router(config)#hostname R1
R1(config)#
  • Disable DNS lookup to prevent the router from attempting to translate incorrectly entered commands as though they were hostnames.

R1(config)#no ip domain-lookup 
  • Require that a minimum of 10 characters be used for all passwords.

R1(config)#security ?
  passwords  Password security CLIs
R1(config)#security passwords ?
  min-length  Minimum length of passwords
R1(config)#security passwords min-length ?
  <0-16>  Minimum length of all user/enable passwords
R1(config)#security passwords min-length 10
R1(config)#
  • Assign cisco12345 as the privileged EXEC encrypted password.

R1(config)#enable secret cisco12345
  • Assign ciscoconpass as the console password, establish a timeout, enable login, and add the logging synchronous command. The logging synchronous command synchronizes debug and Cisco IOS software output and prevents these messages from interrupting your keyboard input.

R1(config)#line console 0
R1(config-line)#password ciscoconpass
R1(config-line)#exec-timeout 5 0
R1(config-line)#logging synchronous 
R1(config-line)#exit
R1(config)#

For the exec-timeout command, what do the 5 and 0 represent? The session will timeout in 5 minutes and 0 seconds.

  • Assign ciscovtypass as the vty password, establish a timeout, enable login, and add the logging synchronous command.

R1(config)#line vty 0 4
R1(config-line)#password ciscovtypass
R1(config-line)#exec-timeout 5 0
R1(config-line)#logging synchronous 
R1(config-line)#exit
R1(config)#
  • Encrypt the clear text passwords.

R1(config)#service password-encryption
  • Create a banner that warns anyone accessing the device that unauthorized access is prohibited.

R1(config)#banner motd #Unauthorized access prohibited!#
  • Configure an IP address and interface description. Activate both interfaces on the router.

R1(config)#int fa0/0
R1(config-if)#description Connection to PC-B
R1(config-if)#ip address 192.168.0.1 255.255.255.0
R1(config-if)#no shutdown 
R1(config-if)#exit
R1(config)#int fa0/1
R1(config-if)#description Connection to S1
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#
  • Set the clock on the router; for example:

R1#clock ?
  set  Set the time and date
R1#clock set ?
  hh:mm:ss  Current Time
R1#clock set 10:25:00 ?
  <1-31>  Day of the month
  MONTH   Month of the year
R1#clock set 10:25:00 march ?
  <1-31>  Day of the month
R1#clock set 10:25:00 march 20 ?
  <1993-2035>  Year
R1#clock set 10:25:00 march 20 2020
R1#show clock
*10:25:6.57 UTC Fri Mar 20 2020
R1#
  • Save the running configuration to the startup configuration file.

R1#copy running-config startup-config 
Destination filename [startup-config]? 
Building configuration...
[OK]
R1#

Step 3: Verify network connectivity.

  • Ping PC-B from a command prompt on PC-A.

PC-B>ping 192.168.1.3

Pinging 192.168.1.3 with 32 bytes of data:

Reply from 192.168.1.3: bytes=32 time=2ms TTL=127
Reply from 192.168.1.3: bytes=32 time=0ms TTL=127
Reply from 192.168.1.3: bytes=32 time=0ms TTL=127
Reply from 192.168.1.3: bytes=32 time=0ms TTL=127

Ping statistics for 192.168.1.3:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 2ms, Average = 0ms

PC-B>

Step 4: Configure the router for SSH access.

  • Enable SSH connections and create a user in the local database of the router.

R1#configure terminal 
R1(config)#ip domain-name kelaspar.ir
R1(config)#username admin privilege 15 secret adminpass1
R1(config)#line vty 0 4
R1(config-line)#transport input ssh
R1(config-line)#login local
R1(config-line)#exit
R1(config)#crypto key generate rsa 
The name for the keys will be: R1.kelaspar.ir
Choose the size of the key modulus in the range of 360 to 2048 for your
  General Purpose Keys. Choosing a key modulus greater than 512 may take
  a few minutes.

How many bits in the modulus [512]: 1024
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

R1(config)#
  • Remotely access R1 from PC-A .

PC-A>ssh -l admin 192.168.1.1
Open
Password: 

Unauthorized access prohibited!

R1#

Step 5: Display Router Information

  • Retrieve important hardware and software information. Use the show version command to answer questions about the router.

R1#show version 
Cisco IOS Software, 1841 Software (C1841-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Wed 18-Jul-07 04:52 by pt_team

ROM: System Bootstrap, Version 12.3(8r)T8, RELEASE SOFTWARE (fc1)

System returned to ROM by power-on
System image file is "flash:c1841-advipservicesk9-mz.124-15.T1.bin"


This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.

Cisco 1841 (revision 5.0) with 114688K/16384K bytes of memory.
Processor board ID FTX0947Z18E
M860 processor: part number 0, mask 49
2 FastEthernet/IEEE 802.3 interface(s)
191K bytes of NVRAM.
63488K bytes of ATA CompactFlash (Read/Write)

Configuration register is 0x2102

R1#

What is the name of the IOS image that the router is running? c1841-advipservicesk9-mz.124-15.T1.bin

Step 6: Display the routing table on the router.

  • Use the show ip route command on the router to answer the following questions.

R1#show ip route 
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.0.0/24 is directly connected, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/1
R1#

How many route entries are coded with a C code in the routing table? 2

Step 7: Display a summary list of the interfaces on the router.

  • Use the show ip interface brief command on the router to answer the following question.

R1#show ip interface brief 
Interface              IP-Address      OK? Method Status                Protocol
 
FastEthernet0/0        192.168.0.1     YES manual up                    up
 
FastEthernet0/1        192.168.1.1     YES manual up                    up
 
Vlan1                  unassigned      YES unset  administratively down down
R1#

Step 8: Initialize and reload the router.

  • Type the erase startup-config command to remove the startup configuration from NVRAM.

R1#erase startup-config 
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
%SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
R1#
  • Issue the reload command to remove an old configuration from memory. When prompted to Proceed with reload, press Enter to confirm the reload. (Pressing any other key aborts the reload.)

R1#reload
Proceed with reload? [confirm]
System Bootstrap, Version 12.3(8r)T8, RELEASE SOFTWARE (fc1)
Initializing memory for ECC
..
c2811 processor with 524288 Kbytes of main memory
Main memory is configured to 64 bit mode with ECC enabled

Readonly ROMMON initialized

Self decompressing the image :
########################################################################## [OK]
              Restricted Rights Legend
  • You may be prompted to save the running configuration prior to reloading the router. Type no and press Enter.

         --- System Configuration Dialog ---

Continue with configuration dialog? [yes/no]: no

Keywords:

yaser rahmati , یاسر رحمتی , CISCO , Configuring Basic Router Settings with IOS CLI , DNS lookup , hostname , Configure the router , Cisco IOS , enable secret , console password , line console 0 , logging synchronous , exec-timeout 5 0 , service password-encryption , banner , motd , copy running-config startup-config , SSH , router , switch , kelaspar.ir , crypto key generate rsa , rsa , Configuration register , 0x2102 , show version , routing table , show ip route , Gateway , interface , show ip interface brief , reload , erase startup-config , ROMMON

Last updated