Wednesday, 3 June 2015

CCENT ICND1 Labs


http://www.freeccnaworkbook.com/workbooks/ccna/

 
Basic Router Switch Configuration :

A.Basic Switch Router Configuration.

1.Ping working

Router 1 (192.168.1.1 )----------Router 2 ( 192.168.1.2 192.168.2.1)---------Router 3 (192.168.2.2 )

192.168.1.1 can ping 192.168.1.2 ONLY
Cannot Ping 192.168.2.1 or 192.168.2.2

To be able to ping an interface from the same device , some device router/switch/hub
has to be connected there.

To go further we need to enable Routing Protocols or a Static Route.

2.Console Access PC to Router/Switch
Cable = Consle cable
Port = Console port

3.Hostname : Both Switch and Router

Router(config)#hostname ?
WORD This system's network name
Router(config)#hostname sith
sith(config)#

Switch(config)#hostname jedi
jedi(config)#


4.Modes : Both Switch and Router
User exec Mode (command enable to go to Privileged mode )

Privileged exec Mode( disable)

Configuration Mode (config t , t short for terminal)

Interface Configuration Mode:
int fa0/1
interface fastethernet 0/1
int g0/1
interface serial0/3/0
int s0/3/0
interface range f0/1-24

Switch(config)#int range f0/1 - f0/24
Switch(config-if-range)#exit
Switch(config)#int range f0/1 - 24
Switch(config-if-range)#
Router(config)#int range g0/0-2
Router(config-if-range)#
Router(config)#int range g0/0 - g0/2
Router(config-if-range)#

Subinterface :
                         Router(config)#int g0/0
                         Router(config-if)#int g0/0.1

(Only Router's not even L3 Switch's can have sub interfaces)

Setup Mode : Router#setup
 

More Interface commands:
Router(config)#int range f0/0 - f0/1
Router(config-if-range)#exit
Router(config)#int range f0/0 - 2
interface range not validated - command rejected
[as only Ports 0 and 1 exist and you are using 2]
Router(config)#int range f0/0 - 1
Router(config-if-range)#exit
Router(config)#int f0/0
Router(config-if)#int range f0/0.1
Router(config-if-range)#int range f0/0.1 -f0/0.3
Router(config-if-range)#exit
Router(config)#int f0/0
Router(config-if)#int range f0/0.1 -f0/0.3
[note]
Router(config-if-range)#

Also Note:
Router(config-if)#int range f0/0.1 -f0/0.3
Router(config-if-range)#ip access-group ?
<1-199> IP access list (standard or extended)
WORD Access-list name
Router(config-if-range)#ip access-group icmp-block in


Exit commands:
end : works from config mode but not privileged mode or user mode
exit : works from all modes including user mode,goes back one level
logout : works from privileged and configuration mode

5. Banner : Both Switch and Router

motd : message of the day banner
First message before anything else

Router(config)#banner motd # Welcome to cisco.com only authorized personel #

Login Banner : kicks in after console login password has been set.
Comes after motd banner

Exec banner : VTY line / Telnet

Note PT login banner VTY lines.


show History ( last 20 commands)
show terminal (terminal configuration and history buffer size )


6. Clock set:

Router#clock set ?
hh:mm:ss Current Time
Router#clock set 3:02:40
% Incomplete command.
Router#clock set 3:02:40 ?
<1-31> Day of the month
MONTH Month of the year
Router#clock set 3:02:40 2 4
^
% Invalid input detected at '^' marker.
Router#clock set 3:02:40 2 ?
MONTH Month of the year
Router#clock set 3:02:40 2 April
% Incomplete command.
Router#clock set 3:02:40 2 April ?
<1993-2035> Year
Router#clock set 3:02:40 2 April 2015

7. Console Password
line con 0
password cisco
login

Note : If below is done with no Password as below , privileged mode will be locked out.
Router(config)#line con 0
Router(config-line)#login
% Login disabled on line 0, until 'password' is set

And if login local is used and no username password is set than after logout
and than login ,username is asked ,virtually locking one out.

8.Telnet password:
line vty 0 15
pasword cisco
login

Verification:
show session
show users
disconnect

Note Error scenario:
Router(config)#line vty 0 15
Router(config-line)#login ?
authentication authenticate using aaa method list
local Local password checking
<cr>
Router(config-line)#login
% Login disabled on line 388, until 'password' is set
% Login disabled on line 389, until 'password' is set
% Login disabled on line 390, until 'password' is set
% Login disabled on line 391, until 'password' is set
% Login disabled on line 392, until 'password' is set
% Login disabled on line 393, until 'password' is set
% Login disabled on line 394, until 'password' is set
% Login disabled on line 395, until 'password' is set
% Login disabled on line 396, until 'password' is set
% Login disabled on line 397, until 'password' is set
% Login disabled on line 398, until 'password' is set
% Login disabled on line 399, until 'password' is set
% Login disabled on line 400, until 'password' is set
% Login disabled on line 401, until 'password' is set
% Login disabled on line 402, until 'password' is set
% Login disabled on line 403, until 'password' is set
[VTY lines get disabled similar to console password]
Router(config-line)#password cisco
Router(config-line)#login
Router(config-line)#

Note Error scenario:
Router#telnet 192.168.100.10
Trying 192.168.100.10 ...Open

User Access Verification

Password:
Router>en
% No password set.

[after Telnet ,privileged mode password has to be set, 
  else cannot go further ]


9.Password for Privileged Mode:
Router(config)#enable password cisco
Router(config)#enable secret jedi

last-resort
use-tacacs

10. exec-timeout

Router(config)#line con 0
Router(config-line)#exec-timeout ?
<0-35791> Timeout in minutes
Router(config-line)#exec-timeout 0 0
Router(config-line)#exit
Router(config)#line vty 0 15
Router(config-line)#exec-timeout 0 0

exec-timeout 0 0 : never timing out

Router(config-line)#exec-timeout 35791 ?
<0-2147483> Timeout in seconds
<cr>
Router(config-line)#exec-timeout 35791 2147483 ?
<cr>
Router(config-line)#exec-timeout 35791 2147483

11.Username Password console login:

line con 0
login local [password is checked for each user]

username jedi privilege 15 password cisco
username droid privilege 1 password cisco

Note : privilege level is 0 to 15 , 15 gives direct privileged level access.
0 gives user mode access.

12. Auxillary Port Password:
line aux 0
password cisco
login


13.SSH Configuration:

Brief:
hostname jedi
ip domain-name cisco.com
username droid password cisco
crypto key generate rsa
ip ssh version 2
line vty 0 15
transport input all
transport input ssh
transport input telnet

Detailed:
Switch(config)#hostname jedi
jedi(config)#ip domain-name cisco.com
jedi(config)#username droid password cisco
jedi(config)#crypto key generate rsa
The name for the keys will be: jedi.cisco.com
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]:
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]
jedi(config)#ip ssh version ?
*Mar 1 0:1:53.244: RSA key size needs to be at least 768 bits for ssh version 2
*Mar 1 0:1:53.244: %SSH-5-ENABLED: SSH 1.5 has been enabled
<1-2> Protocol version
jedi(config)#ip ssh version 2
Please create RSA keys (of at least 768 bits size) to enable SSH v2.
jedi(config)#crypto key generate rsa
% You already have RSA keys defined named jedi.cisco.com .
% Do you really want to replace them? [yes/no]: y
The name for the keys will be: jedi.cisco.com
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]: 768
% Generating 768 bit RSA keys, keys will be non-exportable...[OK]
*Mar 1 0:2:24.257: %SSH-5-ENABLED: SSH 1.99 has been enabled
jedi(config)#ip ssh version 2
jedi(config)#line vty 0 15
jedi(config-line)#transport input all
jedi(config-line)#transport input ssh ?
<cr>
jedi(config-line)#transport input ssh telnet ?
% Unrecognized command
jedi(config-line)#transport input ssh telnet
^
% Invalid input detected at '^' marker.

jedi(config-line)#transport input ssh
jedi(config-line)#transport input telnet




14. Telnet user database
Line vty 0 15
login local [enables telnet users password checking against local database ]

Router(config)#line vty 0 15
Router(config-line)#login local
Router(config)#username jedi ?
password Specify the password for the user
privilege Set user privilege level
secret Specify the secret for the user
<cr>
Router(config)#username jedi password cisco
Router(config)#username droid password cisco
Router(config)#enable secret cisco
Router(config)#int l0 (loopback interface created)
Router(config-if)#ip add 192.168.10.11 255.255.255.0

Router#telnet 192.168.10.11
Trying 192.168.10.11 ...Open


User Access Verification

Username: jedi
Password:
Router>en
Password:
Router#

15. service-password encryption

Router(config)#service password-encryption

vlan



16. Description

Router(config)#int g0/0
Router(config-if)#description internal LAN

sh int description


17.Interface specific

Router(config-if)#duplex ?
auto Enable AUTO duplex configuration
full Force full duplex operation
half Force half-duplex operation

Router(config-if)#speed ?
10 Force 10 Mbps operation
100 Force 100 Mbps operation
1000 Force 1000 Mbps operation
auto Enable AUTO speed configuration

Router(config-if)#bandwidth ?
<1-10000000> Bandwidth in kilobits

18.Clock rate
Note only for serial interface connections:
Router(config-if)#clock rate 56000

show controllers verification
Cisco router serial interfaces are all DTE – data terminal equipment
which means closcking must be provied in lab environment.
DCE – Data connection equipment.

19. Assigning IP Address to an Interface:
Router(config-if)#ip address 192.168.10.10 255.255.255.0

Router(config-if)#ip address 192.168.20.20 255.255.255.0 secondary
[add a second subnet ]

20.
show running-config
copy running-config startup-config (copies current config to NVRAM)
show startup-config
sh ru
erase startup-config
reload

21. Bringing up an interface.
no shutdown
no shut

Verification : show int f0/0


22.Backing up Cisco configuration.
copy running-config tftp
copy startup-config tftp

Router#copy s ?
flash: Copy to flash file
ftp: Update (merge with) current system configuration
running-config Update (merge with) current system configuration
tftp: Update (merge with) current system configuration
Router#copy s tftp ?
<cr>
Router#copy s tftp
Address or name of remote host []? 192.168.3.2
Destination filename [Router-confg]? droid

Writing startup-config...!!
[OK - 820 bytes]

820 bytes copied in 0.012 secs (68000 bytes/sec)
Router#

































23.Restoring Cisco configuration.
Copy tftp running-config
Steps:
1. Create a configuration and copy it to a tftp server.
2. Erase the configuration.
3. Reload.
4. Copy tftp ru
5. show r , show start –verification

Router#copy tftp r
Address or name of remote host []? 192.168.3.2
Source filename []? droid
Destination filename [running-config]?

Accessing tftp://192.168.3.2/droid....
Loading droid from 192.168.3.2: !
[OK - 820 bytes]

820 bytes copied in 3.005 secs (272 bytes/sec)
Router#

NOTE:
Router#copy tftp ?
flash: Copy to flash: file system
running-config Copy configuration from system
startup-config Copy startup configuration from system
Router#copy ?
flash: Copy from flash: file system
ftp: Copy from ftp: file system
running-config Copy from current system configuration
startup-config Copy from startup configuration
tftp: Copy from tftp: file system
Router#copy flash ?
ftp: Copy to ftp: file system
running-config Update (merge with) current system configuration
startup-config Copy to startup configuration
tftp: Copy to tftp: file system
Router#show flash

System flash directory:
File Length Name/status
3 33591768 c2900-universalk9-mz.SPA.151-4.M4.bin
2 28282 sigdef-category.xml
1 227537 sigdef-default.xml
[33847587 bytes used, 221896413 available, 255744000 total]
249856K bytes of processor board System flash (Read/Write)


Router#copy tftp flash
Address or name of remote host []? 192.168.3.2
Source filename []? droid
Destination filename [droid]?

Accessing tftp://192.168.3.2/droid...
Loading droid from 192.168.3.2: !
[OK - 820 bytes]

820 bytes copied in 0.001 secs (820000 bytes/sec)

Router#show flash

System flash directory:
File Length Name/status
3 33591768 c2900-universalk9-mz.SPA.151-4.M4.bin
4 820 droid
2 28282 sigdef-category.xml
1 227537 sigdef-default.xml
[33848407 bytes used, 221895593 available, 255744000 total]
249856K bytes of processor board System flash (Read/Write)


24.DHCP:
Router(config)#ip dhcp ?
excluded-address Prevent DHCP from assigning certain addresses
pool Configure DHCP address pools
Router(config)#ip dhcp pool ?
WORD Pool name
Router(config)#ip dhcp pool linux ?
<cr>
Router(config)#ip dhcp pool linux
Router(dhcp-config)#?
default-router Default routers
dns-server Set name server
exit Exit from DHCP pool configuration mode
network Network number and mask
no Negate a command or set its defaults
option Raw DHCP options
Router(dhcp-config)#network 192.168.1.0 255.255.255.0
Router(dhcp-config)#dns-server 192.168.1.100
Router(dhcp-config)#default-router 192.168.1.1
(Gateway IP)
Router(config)#ip dhcp excluded-address 192.168.1.100
( DNS server exluded)

Note : DHCP IP's are assigned as per Interface.
One router interface maybe 192.168.1.1 it assigns 192.168.1.0 /24
as per subnet another 192.168.2.1 192.168.2.0 / 24 etc

DHCP Relay:
Router(config)#int g0/0
Router(config-if)#ip helper-address 192.168.1.100


show dhcp lease
show ip dhcp binding
show ip dhcp server statistics
show ip dhcp conflict
show ip dhcp pool [poolname]


25.NTP:Network Time Protocol:
NTP Server (PC) makes sure every Router Switch Server
receives the same time.

Configuration:
Router#show clock
*0:1:19.747 UTC Mon Mar 1 1993
[before NTP Server is assigned ]

Router(config)#ntp server 192.168.1.4

Router#show clock
*14:1:47.730 UTC Thu Apr 2 2015
[after NTP Server is assigned]

Verification:
show ntp status
show ntp associations

26.CDP Protocol :

cdp run
no cdp run
cdp holdtime
cdp timer
show cdp neighbors
show cdp neighbors detail
show cdp

Router#show cdp entry * protocol
[To find a neighbors Network layer address , needed for pining]

Router#show cdp ?
entry Information for specific neighbor entry
interface CDP interface status and configuration
neighbors CDP neighbor entries
<cr>
Router#show cdp entry ?
* all CDP neighbor entries
WORD Name of CDP neighbor entry
Router#show cdp entry jedi ?
protocol Protocol information
version Version information
<cr>


Using CDP to get Neighbors IP:
Switch#show cdp entry *

Device ID: Router
Entry address(es):
IP address : 192.168.1.1
Platform: cisco C2800, Capabilities: Router
Interface: FastEthernet0/1, Port ID (outgoing port): FastEthernet0/0
Holdtime: 146

Version :
Cisco IOS Software, 2800 Software (C2800NM-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 06:21 by pt_rel_team

advertisement version: 2
Duplex: full

27.Telnet

telnet
can also directly type IP to Telnet in Cisco device.
show sessions
show users
disconnect

28.Host Table

ip host [host_name] [ip_address]

ip host switch2 192.168.10.20

show hosts
show sessions

29.Using DNS to resolve names. [ should have DNS server on Network]

ip domain-lookup
ip name-server 10.1.1.1
ip domain-name cisco.com

now can ping the above hostname
ping switch2

note use this to avoid delay in resolving domain name : Router(config)#no ip domain-lookup
see below

Troubleshooting:

[takes time]
Router#jedi
Translating "jedi"...domain server (255.255.255.255)
% Unknown command or computer name, or unable to find computer address

Router(config)#no ip domain-lookup

[now it does not take time]
Router#jedi
Translating "jedi"
% Unknown command or computer name, or unable to find computer address

30.Traceroute: (shows hops to a remote device )

Router#traceroute ?
WORD Trace route to destination address or hostname
ip IP Trace
ipv6 IPv6 Trace
<cr>
Router#traceroute ip 192.168.1.1

31.Debugging
Router#debug ?
aaa AAA Authentication, Authorization and Accounting
custom-queue Custom output queueing
eigrp EIGRP Protocol information
frame-relay Frame Relay
ip IP information
ipv6 IPv6 information
ntp NTP information
ppp PPP (Point to Point Protocol) information
Router#debug ip ?
icmp ICMP transactions
nat NAT events
ospf OSPF information
packet Packet information
rip RIP protocol transactions
routing Routing table events
Router#debug ip icmp ?
<cr>
Router#debug ip nat ?
<cr>
Router#debug ipv6 ?
inspect Stateful inspection events
ospf OSPF information
Router#debug ntp ?
packets NTP packets

debug all
no debug all
debug ip icmp

show processes


32.Loopback interface:(with description command)
int l10
ip add 192.168.1.10 255.255.255.0
description loopback interface

33.Null interface :
ip route 192.168.1.0 255.255.255.0 null 0


34.Logging-synchronous





To configure the system to apply a time stamp to debugging messages or system
logging messages, use the service timestamps command in global configuration mode


35.Ping

Extended Ping:

Router#
Router#ping
Protocol [ip]:
Target IP address: 192.168.1.1
Repeat count [5]: 5
Datagram size [100]: 100
Timeout in seconds [2]: 2
Extended commands [n]: n
Sweep range of sizes [n]: 2
% Please answer 'yes' or 'no'.
Sweep range of sizes [n]: yes
% This version of Packet Tracer does not support this option.
Sweep range of sizes [n]: n
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)


show History ( last 20 commands)
show terminal (terminal configuration and history buffer size )




Troubleshooting :


CCENT debug command - Troubleshooting.

debug command :

Cisco recommends that the use of debug commands should
be performed under the direction and guidance of specialized
technical personnel, because they may lead to operation
disruption and even total device failure.

Source:http://blog.pluralsight.com/cisco-debug-commands

Take a look at your router’s CPU load by issuing the
show processes cpu command.

Router#debug ?
  aaa           AAA Authentication, Authorization and Accounting
  custom-queue  Custom output queueing
  eigrp         EIGRP Protocol information
  frame-relay   Frame Relay
  ip            IP information
  ipv6          IPv6 information
  ntp           NTP information
  ppp           PPP (Point to Point Protocol) information

Router#debug ip ?
  icmp     ICMP transactions
  nat      NAT events
  ospf     OSPF information
  packet   Packet information
  rip      RIP protocol transactions
  routing  Routing table events


CDP Protocol Cram

1.
 CDP Stands for Cisco Discovery protocol.

CDP is primarily used to obtain protocol addresses of
neighbouring devices and discover the platform of those
devices. CDP can also be used to display information about
the interfaces your router uses. CDP is media- and protocol-
independent, and runs on all Cisco-manufactured equipment
including routers, bridges, access servers, and switches. 

2.
Runs on device running Cisco IOS.

3.
Commands

Router#show cdp neighbors detail
Router#show cdp entry *

Both show IP of immediately connected neighbors.
For Switch it will be VLAN IP
For Router it will be Router connected IP.


4.
Router(config)#cdp run ?
  <cr>
Router(config)#no cdp run


Router#show cdp neighbors detail
% CDP is not enabled

5.
Can telnet into a device and than run CDP.

6.

Router(config)#int g0/0
Router(config-if)#cdp ?
  enable  Enable CDP on interface
Router(config-if)#cdp enable ?
  <cr>
Router(config-if)#no cdp enable

Router#show cdp neighbors
% CDP is not enabled


7.Specific Device details.
Router#show cdp entry Switch

Device ID: Switch
Entry address(es):
  IP address : 192.168.2.10
Platform: cisco 2960, Capabilities: Switch
Interface: GigabitEthernet0/1, Port ID (outgoing port): GigabitEthernet1/2
Holdtime: 177

Version :
Cisco IOS Software, C2960 Software (C2960-LANBASE-M), Version 12.2(25)FX, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2005 by Cisco Systems, Inc.
Compiled Wed 12-Oct-05 22:05 by pt_team

advertisement version: 2
Duplex: full
---------------------------

Router#show cdp entry Router

Device ID: Router
Entry address(es):
  IP address : 192.168.1.2
Platform: cisco C2900, Capabilities: Router
Interface: GigabitEthernet0/0, Port ID (outgoing port): GigabitEthernet0/0
Holdtime: 124

Version :
Cisco IOS Software, C2900 Software (C2900-UNIVERSALK9-M), Version 15.1(4)M4, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Thurs 5-Jan-12 15:41 by pt_team

advertisement version: 2
Duplex: full
---------------------------

Router#show cdp entry ?
  *     all CDP neighbor entries
  WORD  Name of CDP neighbor entry

clear cdp counters
clear cdp table
cdp holdtime
cdp timer


Troubleshooting possibilities:

1.IP / Subnet is wrong.
2.Cabling is wrong.
3.Wild card mask is wrong.
4.Two ACL's same direction
5.No route back from destination , use show ip route at both ends
6.Interface specific settings missmatch
7.Protocol specific specifications missmatch 
8.Gateway is wrong.

show ru > first run this
show ip route   > at both ends
show cdp  

No comments:

Post a Comment