Switch Initial configuration (5)
Switch Initial configuration (5)
The following graphic and table summarize the basic command mode prompts of the switch.
In the start, all the cisco switches have multiple command modes which are mentioned below;
a. User EXEC -
a. Prompt: Switch>
b. How to enter: first time login user will get into this mode.
c. How to exit: users can use command: exit, logout, disconnect.
d. Details: This mode, also known as User mode, allows a user to view a limited amount
of information. Essentially, the user can look around but not break anything by
executing non-disruptive commands.
b. Privileged EXEC -
a. Prompt: Switch#
b. How to enter: by using command: enable
c. How to exit: by using command: exit, disable.
d. Details: This mode, also known as Enable mode, allows the user to execute powerful
or privileged commands, such as reload which tells the switch to reboot the Cisco
IOS.
c. Global Configuration -
a. Prompt: Switch(config)#
b. How to enter: by using command: configure terminal
c. How to exit: by using command: exit, ctrl+z.
d. Details: This mode allows the user to make global configurations on the switch (or
configurations which affect the whole switch), such as the hostname of the switch.
d. Line Configuration mode-
a. Prompt: Switch(config-line)#
b. How to enter: by using command: Switch(config)# line <type> <number>
c. How to exit: by using command: exit, ctrl+z.
d. Details: Use this mode to configure parameters for the terminal line, such as the
console, Telnet, and SSH lines.
e. Interface configuration mode -
a. Prompt: Switch(config-if)#
b. How to enter: by using command: Switch(config)# interface fastethernet <port
number>
c. How to exit: by using command: exit
d. Details: The switch has multiple interface modes depending on the physical (or
logical) interface type. For this course, you should be familiar with the following
switch interface modes:
1. Ethernet (10 Mbps Ethernet)
2. FastEthernet (100 Mbps Ethernet)
3. GigabitEthernet (1 GB Ethernet)
4. VLAN
Note: The VLAN interface configuration mode is used to configure the switch IP
address and other management functions. It is a logical management interface
configuration mode, instead of a physical interface configuration mode as used for
the FastEthernet and GigabitEthernet ports.
Note: Do not confuse the config-vlan mode with the VLAN interface configuration
mode.
Remote Access
By default, there are no such output ports are available on the cisco switches/routers. For
management purposes, all devices have a console port available. As the console cable connectivity
required the physical presence around the switch devices, hence it is not useful way to access
switch/router CLI access using the console cable. We can configure the remote access of our switch
or router devices so that we can access their CLI mode remotely sitting on our own PC/laptop.
There are two common protocols for remote management to your Cisco IOS router or switch: telnet
and SSH.
There are two versions: version 1 and 2. Version 2 is more secure and commonly used.
Command Description
Switch(config)# interface vlan 1 Go into the vlan 1 interface (virtual interface)
Switch(config-if)# ip address <IP> <subnet To set IP address on VLAN 1 interface
mask>
Switch(config-if)# no shutdown To enable the interface
Router(config)#hostname R1 To change the default hostname of the switch
or router.
R1(config)#ip domain-name <domain name> To change/set the domain name of the switch
or router.
R1(config)#crypto key generate rsa general- This command will generate a key to encrypt
keys modulus 1024 the data.
R1(config)#ip ssh version 2 To enable ssh version 2. By default, version 1.99
is enabled.
R1(config)#line vty 0 4 To enable vty communication for 5 (0-4)
terminals.
R1(config-line)#transport input ssh Allow only ssh based communication for
remote access.
R1(config-line)#login local To allow local user database should be used for
authentication.
R1(config)#username <username> password To create user and set their password.
<password>
PC> ssh -l <username> <Sw/Router IP> This command can be used to ssh from PC
devices in packet tracer.
How to configure telnet access to a cisco device?
Telnet is easy to configure but not used often anymore since it is insecure, everything you do is sent
in plaintext while SSH uses encryption. However, some older devices might only support telnet, so
it’s good to know how to configure it. Besides remote management, the telnet client is also very
useful to test access-lists, routing and if certain ports are listening or not.
Note: make a note that the management IP has been for the VLAN 1, hence no other VLAN members
are allowed to access the remote connection using telnet/SSH using management IP of VLAN 1.
Command Description
R1(config)#line vty 0 4 Enable the 5 vty terminal for remote access of
CLI. Here 0 indicates the minimum limit and 4
indicates the maximum terminal users limit.
R1(config-line)#transport input telnet To enable telnet only communication for
remote access
R1(config-line)#password <password> Password command allows you to set the
password for telnet access.
R1(config-line)#login Login command allows users to login using
telnet.
R1(config-line)# login local This command configure telnet to be accessed
using username and password both
parameters.
For this we need to add user and set their
password locally on the switch using
“username <username> password
<password>” command.
Note: If one link partner has the duplex manually-configured and the other link partner is using auto-
negotiation, a mismatch will occur, resulting in very poor performance and Layer 2 error frames. This
is because the auto-negotiating link partner did not receive auto- negotiation parameters from the
other link partner and consequently defaulted to half duplex as defined in the IEEE 802.3u
specification.
• Always manually configure the speed and duplex settings for critical connections. Use auto-
negotiation for connections to user workstations.