Switch Configuration
Switch Configuration
Switch configuration
Switches
The following describes the purpose of the LED indicators and the meaning of their colors:
1. System LED: - shows whether the system is receiving power and is functioning properly.
If the LED is off, it means that the system is not powered on.
If the LED is green, the system is operating normally.
If the LED is amber, the system is receiving power but is not functioning properly.
Page 1 of 15
Faculty of Computing Technology
Network Device and Configuration
3. Port Status LED: - when selected, the port LEDs will display colors with different meanings.
If the LED is off, there is no link, or the port was administratively shut down.
If the LED is green, a link is present.
If the LED is blinking green, there is activity and the port is sending or receiving
data.
If the LED is alternating green-amber, there is a link fault.
If the LED is amber, the port is blocked to ensure that a loop does not exist in the
forwarding domain and is not forwarding data.
If the LED is blinking amber, the port is blocked to prevent a possible loop in the
forwarding domain.
4. Port Duplex LED: - indicates that the port duplex mode is selected when the LED is green.
When selected, port LEDs that are off are in half-duplex mode.
If the port LED is green, the port is in full-duplex mode.
5. Port Speed LED: - indicates that the port speed mode is selected. When selected,
If the LED is off, the port is operating at 10 Mb/s.
If the LED is green, the port is operating at 100 Mb/s.
If the LED is blinking green, the port is operating at 1000 Mb/s.
6. Power over Ethernet (PoE) Mode LED: - if PoE is supported, a PoE mode LED will be
present.
If the LED is off, it indicates that the PoE mode is not selected and that none of
the ports have been denied power or placed in a fault condition.
If the LED is blinking amber, the PoE mode is not selected but at least one of the
ports has been denied power, or has a PoE fault.
If the LED is green, it indicates that the PoE mode is selected and that the port
LEDs will display colors with different meanings.
7. Port Speed LED: -
If the port LED is off, the PoE is off.
If the port LED is green, the PoE is on.
If the port LED is alternating green-amber, PoE is denied because providing power
to the powered device will exceed the switch power capacity.
If the LED is blinking amber, PoE is off because of a fault.
If the LED is amber, PoE for the port has been disabled.
After a Cisco switch is powered on, it goes through the following five-step boot sequence:
Step 1: First, the switch loads a power-on self-test (POST) program stored in ROM.
POST checks the CPU subsystem. It tests the CPU, DRAM, and the portion of the flash
device that makes up the flash file system.
Page 2 of 15
Faculty of Computing Technology
Network Device and Configuration
Step 2: Next, the switch loads the boot loader software. The boot loader is a small
program stored in ROM that is run immediately after POST successfully completes.
Step 3: The boot loader performs low-level CPU initialization. It initializes the CPU
registers, which control where physical memory is mapped, the quantity of memory, and
its speed.
Step 4: The boot loader initializes the flash file system on the system board.
Step 5: Finally, the boot loader locates and loads a default IOS operating system software
image into memory and gives control of the switch over to the IOS.
Configuration Modes
The Cisco IOS command-line interface is divided into different command modes in which each
command mode has its own set of commands available for the configuration, maintenance, and
monitoring of router and network operations. The commands available to you at any given time
depend on the mode you are in. Entering a question mark (?) at the system prompt (switch
prompt or router prompt) allows you to obtain a list of commands available for each command
mode.
The standard order that a user would access the modes is as follows:
Page 3 of 15
Faculty of Computing Technology
Network Device and Configuration
hostname command followed by the name changes the name of the switch (ICT in this case)
Switch> enable
Switch# configure terminal
Switch(config)# hostname ICT_Switch
ICT_Switch(config)#
Configuring Banner
A banner is a message presented to a user who is using the Cisco switch. Based on the type
of banner you configured for use, the message will be shown to users of Cisco switch.
Switch ports can be manually configured with specific duplex and speed settings.
Use the duplex interface configuration mode command to manually specify the duplex mode
for a switch port.
Page 4 of 15
Faculty of Computing Technology
Network Device and Configuration
Use the speed interface configuration mode command to manually specify the speed for a
switch port.
In the figure below, it shows how the switches (eg. S1 on port Fa0/1) are manually
configured with the full keyword for the duplex command, and the 100 keyword for the
speed command.
Privileged EXEC mode has to be password protected in order to prohibit unauthorized users.
So we can set a password using commands enable password or enable secret.
enable password
It is the less secure of the two commands as it simply stores the password in plaintext.
ICT_Switch# conf t
ICT_Switch(config)# enable password Ci$$c0
To encrypt the password set by enable password, we can use the following command
ICT_Switch(config)#service password-encryption
Page 5 of 15
Faculty of Computing Technology
Network Device and Configuration
OR
enable secret
This is used when we need to manage and configure the switch using the computer connected
using console cable.
ICT_Switch# conf t
ICT_Switch (config)# line console 0
ICT_Switch (config-line)# password con0
ICT_Switch (config-line)# login
ICT_Switch (config-line)# end
ICT_Switch#
Page 6 of 15
Faculty of Computing Technology
Network Device and Configuration
NB
The command end or ctrl + Z help you to return directly into privileged mode from other modes
(eg. From the line configuration mode in the above case)
Following this, in order to configure from the computer connected t the switch using console
cable:
Configuring Telnet
Cisco switches can be configured with a special IP address known as the switch virtual
interface (SVI). The SVI, or management address, can be used for remote access to the
switch to display or configure settings. If the VLAN 1 SVI is assigned an IP address, by
default, all ports on VLAN 1 have access to the SVI IP address.
The task could be accomplished using the following steps
Page 7 of 15
Faculty of Computing Technology
Network Device and Configuration
Step 2: -Then, in order to login into the switch from a remotely connected computer, we have to
first assign a virtual IP ( 192.168.99.100/24) to the VLAN (Currently we only have the default
VLAN, i.e VLAN 1)
Step 3: - Go to the command prompt from the computer connected to the switch (Click on the
computerselect Desktop Tab click Command Prompt
Password: tel1015
Type enable command to enter into the privileged mode, then password of the switch
ICT_Switch>enable
Password:
ICT_Switch# -------------------- ( You now have entered into the privileged mode)
Page 8 of 15
Faculty of Computing Technology
Network Device and Configuration
Switch port Security is a network security feature that associates specific MAC addresses
of devices with specific interfaces on a switch to restrict access to a given switch
interface so that only the authorized devices can use it.
If an unauthorized device is connected to the same port, you can define the action that the
switch will take, such as discarding the traffic, sending an alert, or shutting down the port.
ICT_Switch# conf t
ICT_Switch(config)#int fa0/1
ICT_Switch(config-if)# switchport mode access
ICT_Switch(config-if)#switchport port-security
ICT_Switch(config-if)#switchport port-security mac-address sticky
ICT_Switch(config-if)#switchport port-security violation shutdown
ICT_Switch(config-if)#switchport port-security maximum 1
Page 9 of 15
Faculty of Computing Technology
Network Device and Configuration
Violation modes
While defining the action that the switch will take when a frame from an unathorized device is
received. This is done using the switchport port-security violation {protect | restrict | shutdown}
interface command. Though all the three options discard the traffic from the unauthorized device,
they have differences.
Shutdown: -
In this mode, the switch ports shuts down when the violation occurs. Also, a SNMP trap
is sent and the message is logged. You can enable the port again with the no
shutdown interface configuration command
Protect: -
When the maximum number of secure MAC addresses has been reached, packets from
devices with unknown source addresses are dropped until you remove the necessary
number of secure MAC addresses from the table. In this mode, you are not notified when
a security violation occurs.
Restrict: -
It is identical with protect mode, but notifies you when a security violation occurs.
Specifically, a SNMP trap is sent, a syslog message is logged and the violation counter
increments.
Page 10 of 15
Faculty of Computing Technology
Network Device and Configuration
Configuring VLAN
A Virtual LAN (VLAN) is simply a logical LAN, just as its name suggests. VLANs have
similar characteristics with those of physical LANs, only that with VLANs, you can
logically group hosts even if they are physically located on separate LAN segments.
We treat each VLAN as a separate subnet or broadcast domain. For this reason, to move
packets from one VLAN to another, we have to use a router or a layer 3 switch.
Initially every port in a switch is part of a default VLAN (i.e. VLAN 1) and it is not
possible to delete the default VLANs.
According to the above figure, Fa0/1 and Fa0/2 are assigned to VLAN 10 and Fa0/3 and
Fa0/4 are assigned to VLAN 20.
Fa0/5 will act as a trunk
Page 11 of 15
Faculty of Computing Technology
Network Device and Configuration
Step 1: - configuring VLAN Id and VLAN Name (lets name VLAN 10 and VLAN 20 as HR,
and MGT respectively
ICT_Switch# conf t
ICT_Switch(config)#vlan 10
ICT_Switch(config-vlan)# name HR
ICT_Switch(config-vlan)# vlan 20
ICT_Switch(config-vlan)# name MGT
ICT_Switch(config-vlan)# end
ICT_Switch#
ICT_Switch> enable
ICT_Switch# conf t
ICT_Switch(config)#int Fa0/1
ICT_Switch(config-if)# switchport mode access
ICT_Switch(config-if)# switchport access vlan 10
ICT_Switch(config-if)# int Fa0/2
ICT_Switch(config-if)# switchport mode access
ICT_Switch(config-if)# switchport access vlan 10
ICT_Switch(config-if)# end
ICT_Switch#
Fa0/3 and Fa0/3 are assigned to VLAN 20 (using range of ports to save time)
ICT_Switch> enable
ICT_Switch# conf t
ICT_Switch(config)#int range Fa0/3-4
ICT_Switch(config-if-range)# switchport mode access
ICT_Switch(config-if-range)# switchport access vlan 20
ICT_Switch(config-if-range)# end
Page 12 of 15
Faculty of Computing Technology
Network Device and Configuration
ICT_Switch#
ICT_Switch> enable
ICT_Switch# conf t
ICT_Switch(config)#int Fa0/5
ICT_Switch(config-if)# switchport mode trunk
ICT_Switch(config-if)# switchport trunk allowed 1-20
ICT_Switch(config-if)# end
ICT_Switch#
The command below restricts the trunk port (Fa0/5) to be only used by vlans whose ID are in
between 1 and 20 (For instance, If we have vlan 30, it is not allowed to use this trunk)
An access port is assigned to a single VLAN. These ports are configured for switch ports
that connect to devices with a normal network card, for example a PC in a network.
On the other hand, a trunk port is a port that can be connected to another switch or
router. This port can carry traffic of multiple VLANs.
Page 13 of 15
Faculty of Computing Technology
Network Device and Configuration
Step 4: - Assign static IP addresses to the four PCs which are located in the separate VLANs.
PC1 and PC2 fall in VLAN 10 while PC3 and PC4 fall in VLAN 20.
In order to let communication among computers that belong to different VLANs possible a
router is needed
We’ll configure the router so that it will enable communication between the two vlans via a
single physical interface.
We’ll divide the single physical interface on the router into logical interfaces (sub interfaces).
Each sub-interface will then serve as a default gateway for each of the VLANs. This scenario
is called router on a stick (R.O.A.S) and will allow the VLANs to communicate through the
single physical interface.
Router> enable
Router# conf t
Router(config)#int Fa0/0
Router(config-if)#no shutdown
Router(config-if)# int Fa0/0.10
Router(config-subif)# encapsulation dot1q 10 -------- (10 refers VLAN id for Fa0/1 and Fa0/2)
Router(config-subif)# ip address 192.168.10.254 255.255.255.0 -------- (ip address of the default
gateway for PC1and PC2)
Router(config-subif)# int Fa0/0.20
Router(config-subif)# encapsulation dot1q 20 ----- (20 refers VLAN id for Fa0/3 and Fa0/4)
Router(config-subif)# ip address 192.168.20.254 255.255.255.0 -------- (ip address of the default
gateway for PC3and PC4)
Page 14 of 15
Faculty of Computing Technology
Network Device and Configuration
NB
Now, we can ping from PC1 to PC3 and PC4 and vice versa.
Page 15 of 15
Faculty of Computing Technology