2 - Cisco Router and Switch
2 - Cisco Router and Switch
It is easier to manage and troubleshoot your network when you give the
devices a meaningful name.
Command:
Router> enable
Router# configure terminal
Router(config)# hostname Management
Management(config)#
Clock
Setting the correct date and time is a requirement for some advanced
configuration and it helps when troubleshooting the device.
Command:
Management# clock set 14:30:00 August 15 2023
Banner
Management(config)# exec-timeout 30 0
Management(config-line)# login
Management(config-line)# end
Management(config-line)# exec-timeout 30 0
Management(config-line)# login
Management(config-line)# end
Packet Tracer - Lab
1. Basic switch setup
A new switch just purchased from Cisco contains no default configuration. You need to configure
the switch with setup mode or from scratch using the command line interface (CLI) before
connecting it in your network environment. As a Network Administrator, it is very important to
know the basic Cisco switch configuration commands to improve the performances and the
security of the enterprise network.
Network Diagram
1. Use the local laptop connect to the switch console and configure the laptop with the right
parameters for console access to the Cisco 2960 Catalyst switch
2. Configure Switch hostname as LOCAL-SWITCH
Switch(config)#hostname LOCAL-SWITCH
3. Configure the message of the day as "Unauthorized access is forbidden"
Switch(config)#banner motd $Unauthorized access is forbidden$
4. Configure the password for privileged mode access as "cisco". The password must be md5
encrypted
Switch(config)#enable secret cisco
5. Configure password encryption on the switch using the global configuration command
Password encryption is an important setting for securing switch credentials as default behavior
is saving clear-text passwords in the running-config. Although useful to avoid naive hacking,
be advised that tools have been released to crack those passwords. Use the service password-
encryption command with additional security measures
Switch(config)#service password-encryption
Switch(config)#line con 0
Switch(config-line)#password ciscoconsole
Switch(config-line)#logging synchronous
Switch(config-line)#login
Switch(config-line)#history size 15
Switch(config-line)#exec-timeout 6 45
Switch(config)#line vty 0 15
Switch(config-line)#exec-timeout 8 20
Switch(config-line)#password ciscotelnet
Switch(config-line)#logging synchronous
Switch(config-line)#login
Switch(config-line)#history size 15
8. Configure the IP address of the switch as 192.168.1.2/24 and it's default gateway IP
(192.168.1.1).
Switch(config)#interface Vlan1
Switch(config-if)#ip address 192.168.1.2 255.255.255.0
Switch(config-if)#ip default-gateway 192.168.1.1
9. Test telnet connectivity from the Remote Laptop using the telnet client.
2. Interfaces configuration
Network diagram
This lab will test your ability to configure speed, duplex, and vlan settings on the network
interfaces of a Catalyst 2960 switch using Cisco Packet Tracer.
Explicitly configuring the speed with the speed 100 IOS command of a Cisco Catalyst network
interface disable auto-negociation on this interface
2. Settings to be configured on each port are :
Switch(config)#interface FastEthernet0/4
Switch(config-if)#switchport access vlan 1
On every interface that has to be configured for trunk operation, configure the following
settings
Switch(config)#interface GigabitEthernet1/X
Switch(config-if)#switchport mode trunk
Verify interface operational mode using the show interface GigabitEthernet1/X switchport
command :
Name: Gig1/2
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Another useful IOS command is show interfaces trunk :