Professional Documents
Culture Documents
SWITCHING : The mechanism for moving data between different computer networks
and network segments is called switching. A dedicated device perform
these tasks called switch
SWITCH : It is a network device which is used to connect multiple host, it is also called
Multi-Port Network bridge
Switch works on Layer -2 , but some switches works on Layer-3, these are called L3
or multi-layer Switches. ( Support Routing )
SWITCH WORKING
1- It works on Forwarding Table / MAC table / CAM table
Send “frames” to destination on the basis of MAC address. Route Packet with help of IP address
Work with MAC address only Can perform functioning of both 2 layer and 3 layer switch
Quite fast as they do not look at the Layer 3 portion of the Takes time to examine data packets before sending them
data packets. to their destination
Can communicate within a network only. Can communicate within or outside network.
CONFIGURATION OF SWITCH
Requirements
Switch>en
Switch#conf t
Switch(conf)#hostname upBrain
upBrain(conf)#^z
upBrain#copy run start
now assigh ip addresses from 192.168.1.0 network on each pc with default gateway 192.168.1.1
check connectivity with ping command now go on any PCs command prompt and type telnet
192.168.1.1
HOW TO SET USERNAME PASSWORD ON A SWITCH
CONSOLE WIRE
switch>en
switch#conf t
switch(conf)#username upbrain secret ccna
switch(conf-line)#line console 0
switch(conf-line)#login local
switch(conf-line)#exit
switch#copy run start
switch#exit
Username : upbrain
Password : ccna
Switch>
HOW TO CONFIGURE SSH ON A SWITCH
Requirements
switch#conf t
switch(conf)#enable secret ccnp
switch(conf)#int vlan 1
switch(conf-if)#ip add 192.168.1.1 255.255.255.0
switch(conf-if)#no shut
switch(conf-if)#username upbrain secret ccna
switch(conf)#hostname SW1
SW1(conf)#ip domain-name upbrain.in
SW1(conf)#crypto key generate rsa 1024
SW1(conf)#ip ssh version 2 Testing:
SW1(conf)#line vty 0 15 Go to any PC and try to ping switch with the IP
SW1(conf-line)#password ccna 192.168.1.1
SW1(conf-line)#login local Now click on telnet/ssh client on pc
SW1(conf-line)#exit select
SW1(conf)#^z SSH , type ip address / name = 192.168.1.1
SW1#sh run username – upbrain then click on connect
SW1#copy run start
WHAT IS VLAN AND HOW TO CONFIGURE VLAN
VIRTUAL LAN (VLAN) : is a concept in which we can divide the devices logically on layer 2 (data
link layer). Generally, layer 3 devices divide broadcast domain but broadcast domain can be
divided by switches using the concept of VLAN
VLAN TYPES :
VLAN 0, 4095: These are reserved VLAN which cannot be seen or used.
VLAN 1: It is the default VLAN of switches. By default, all switch ports are in
VLAN. This VLAN can’t be deleted or edit but can be used.
VLAN 2-1001: This is a normal VLAN range. We can create, edit and delete
these VLAN.
VLAN 1002-1005: These are CISCO defaults for fddi and token rings. These
VLAN can’t be deleted.
The cost of Local Area Network is high. The cost of Virtual Local Area Network is less.
The latency of Local Area Network is high. The latency of Virtual Local Area Network is low.
In local area network, the Packet is In virtual local area network, packet is send to specific
advertised to each device. broadcast domain.
Local area network is less efficient than Virtual local area network is greater efficient than local area
virtual local area network. network.
CONNECTION TYPES FOR VLAN
TYPES OF CONNECTIONS IN VLAN : The type of connections are based on the connected devices
i.e. whether they are VLAN-aware(A device that understands VLAN formats and VLAN
membership) or VLAN-unaware(A device that doesn’t understand VLAN format and VLAN
membership).
1.Trunk – All connected devices to a trunk link must be VLAN-aware. All frames on this
should have a special header attached to it called tagged frames. Switch to PC
2.Access – It connects VLAN-unaware devices to a VLAN-aware bridge. All frames on the
access link must be untagged. Switch to Switch
BENEFITS OF VLAN :
Switch>en
Switch#conf t
Switch(conf)#VLAN 2
Switch(conf)#Name sales
Switch(conf)#VLAN 3
Switch(conf)#Name account
Switch(config)#int fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access Vlan 2
Switch(config)#int fa0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access Vlan 2
PORT ASSIGNING FOR A VLAN
Switch(config)#int fa0/1 - 2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access Vlan 2
Switch(config)#int fa0/3 - 4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access Vlan 3
Switch>en
Switch#conf t
Switch(config)#int vlan 1
Switch(config-if)#ip add 192.168.1.1 255.255.255.0
Switch(config-if)#no shut
VLAN TAGGING ( INTER SWITCH LINK TAGGING )
We use VLAN tagging to transfer multiple vlans traffic within different switches, to perform this
task we use vlan tagging to provide communication between different vlans and different
switches. Single link is used to transfer multiple vlans traffic.
The two most common tagging schemes for Ethernet segments are ISL and 802.1Q:
#int gig0/1
#switchport mode trunk
Now all the pcs from different VLAN can communicate together.
INTERVLAN ROUTING
Router On a Stick :
The Router’s interface is divided into sub-interfaces,
which acts as a default gateway to their respective
VLANs.
10.0.0.2 11.0.0.2 12.0.0.2
Note : Router’s IP address will be used as default 10.0.0.1 11.0.0.1 12.0.0.1
gateway for connected PCs in different VLANs
INTERVLAN CONFIGURATION
SWITCH CONFIGURATION
ROUTER CONFIGURATION S>en
R>en S#conf t
R#conf t S# vlan 2
R# int fa0/0.1 S# name sales
R# encapsulation dot1q 2 S# vlan 3
R# ip address 10.0.0.1 255.0.0.0 S# name account
R# int fa0/0.2 S# vlan 4
R# encapsulation dot1q 3 S# name purchase
R# ip address 11.0.0.1 255.0.0.0 S# int range fa0/1 - 2
R# int fa0/0.3 S# switchport access vlan 2
R# encapsulation dot1q 4 S# int range fa0/3 - 4
R# ip address 12.0.0.1 255.0.0.0 S# switchport access vlan 3
int range fa0/5 - 6
S# switchport access vlan 4
PCs Configuration
S#int fa0/7
Assign ip addresses to all pc's according to
S# switchport mode trunk
default gateways and networks , then check
with the ping command- all pcs will
communicate together
ROOT BRIDGE ELECTION AND CONFIGURATION
ROOT BRIDGE : The root bridge is the bridge with the lowest Bridge ID.It is a switch in a single
VLAN or whole topology (according to the type of STP standard used) which is responsible for
distributing BPDUs and block the least redundant port.
ELECTION PROCEDURE –
All the switches in the network declare themselves root bridges and start exchanging their
own BPDU. The BPDU with the lowest bridge ID is considered as superior. Now the switch
receiving the superior BPDU makes changes in its own BPDU and carries forward to its
neighbors. It changes the value of root Bridge ID with its superior BPDU bridge ID. This
process goes on until all the switches are satisfied with which bridge has the lowest bridge
ID and hence that switch will be declared as the root bridge.
ROOT BRIDGE ELECTION AND CONFIGURATION
SPANNING TREE PROTOCOL : STP is also known as spanning tree protocol is a layer 2 (Data link
layer) protocol, it runs on switches and bridges. The IEEE standard of STP is 802.1D. STP is a
feature used to prevent loops when using redundant switches.
ROOT BRIDGE : is a switch in a single VLAN or whole topology (according to the type of STP
standard used) which is responsible for distributing BPDUs and block the least redundant port.
ROOT BASE :
S1>en
S1#conf t
S1(config)#spanning-tree ?
S1(config)#spanning-tree vlan 1 root primary
S1(config)#ctrl z
S1#copy run start
PRIORITY BASE :
S2>en
S2#conf t
S2(config)#spanning-tree ?
S2(config)#spanning-tree vlan 1 priority 20480
S2(config)#ctrl z
S2#copy run start
#sh spanning-tree (to check port status and root bridge)
Attackers’ task is comparatively very easy when they can enter the network they want to
attack. Ethernet LANs are very much vulnerable to attack as the switch ports are open to use
by default
To take total control over the switch ports, the user can use a feature called port-security.
how to secure a switch port:-
Switch> enable
Switch# conf t
Switch# int fa0/11
Switch# switchport port-security
Switch# switchport mode access
Switch# switchport port-security maximum 1
Switch# switchport port-security mac-address sticky
Switch# switchport port-security violation shutdown
S1(config-if)# switchport port-security mac-address aa.bb.cc.dd.ee
Switch# control z
Switch# copy run start
VTP ( VLAN TRUNKING PROTOCOL )
VTP : VTP is a CISCO proprietary protocol used to maintain consistency throughout the
network or user can say that synchronizing the VLAN information in same VTP domain. VTP
allows you to add, delete and rename VLANs which is then propagated to other switches in
the VTP domain. VTP advertisements can be sent over 802.1Q, and ISL trunks.
VTP modes – There are 3 modes:
•Server – The switches are set to this mode by default. This mode allows you to create, add
and delete VLANs. The changes you want to make should be done in this mode. Any changes
that is done on this mode(on a particular switch) will be advertised to all the switches that
are in same VTP domain. In this mode, the configuration are saved in NVRAM.
•Client – In this mode, the switches receives the updates and can also forward the updates to
other switches(which are in same VTP domain). The updates received here is not saved in
NVRAM so all the configuration will be deleted if the switch is reset or reloaded.
•Transparent – This mode only forwards the VTP summary advertisements through trunk link.
The transparent mode switches can make their own local database which keep secret from
other switches.
How to configure VTP modes
VTP SERVER
Switch>en
Switch#conf t
Switch(config)#int fa0/1 VTP TRANSPARENT
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit Switch>en
Switch(config)#vtp domain upBrain Switch#conf t
Switch(config)#vtp mode server Switch(config)#int fa0/1
Device mode already VTP SERVER. Switch(config-if)#switchport mode trunk
Switch(config)#^Z Switch(config-if)#int fa0/2
Switch#copy run start Switch(config-if)#switchport mode trunk
Switch(config-if)#exit
Switch(config)#vtp domain upBrain
Switch(config)#vtp mode transparent
Switch(config)#^Z
Switch#copy run start VTP client
Switch>en
Switch#conf t
Switch(config)#int fa0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit
Switch(config)#vtp domain upBrain
Switch(config)#vtp mode client
Switch(config)#^Z
Switch#copy run start
ETHER CHANNEL
EtherChannel is a port link aggregation technology in which multiple physical port links are
grouped into one logical link. An EtherChannel combines multiple physical links into a single
logical link It is used to provide high-speed links and redundancy. A maximum of 8 links can be
aggregated to form a single logical link. It can be used by layer 2 and layer 3
Link Aggregation Control Protocol is an IEEE protocol, originally defined in 802.3ad, used to
form an EtherChannel. This protocol is almost similar to Cisco PAgP
HOW TO CONFIGURE PORT AGGREGATION PROTOCOL (PAGP)
Switch2> en
Switch2# conf t
Switch2(config)# int range fa0/1 – 3
Switch2(config)# channel-protocol pagp
Switch2(config)# channel-group 1 mode desirable
Switch2(config)# ^z
Switch2(config)# copy run start
Switch2> en
Switch2# conf t
Switch2(config)# int range fa0/1 – 3
Switch2(config)# channel-protocol lacp
Switch2(config)# channel-group 1 mode active
Switch2(config)# ^z
Switch2(config)# copy run start