< All Cisco CCNA Notes

sushmi.J | Cisco CCNA | Module 3 - Layer 2 Data Link

By: sushmi.J | Related Course: Cisco CCNA | Published: June 15, 2016 | Modified: June 20, 2016
Join Cybrary

Notepad4 stages in STP

what happend to root port and designated ports and ports that have nothing .

blocking-all ports are blocked at initial point .it lasts at 20 sec.BPDU are send

listening- root beidge and root port election happens .15 sec

learning-15 sec. also called for delay.

forwarding -designated and root ports are put in forwaarding.non designated ports are been blocked.

Notepadabout MAC functions.

where is mac used:In PDU (protocol data unit) which is called as frame in Layer 2.

FRAME: dest add,source add, data, frame check sequence CRC(algorithm)

devices at layer 2

1 .switch

Switch function:

indide sswitch there is MAC add. cable

(ie) listing of all ports on cable


NotepadBroadcast and collison

a broadcast domain is the area of a network where a broascast will spread out if send by one device.

aread of netowrk if two or more  devices transmits at same time and they are running half duplex ethernet and both devices transmits at same time then frames collides.

ehernet is layer2  protocol .speed 10megabits per second.half duplex .with CSMA/CD

hlaf duplex-one direction at a time.eg.walkie talkie

full duples-eg.phone.

CSMA/CD -if collisions happens its sends out jamming signal and ask devices to stop transmitting for certain time.For each devices certain time is given by CSMA to stop transmitting and after that it does make a clear path and hence thats collision dectection.

in Full duples CSMA is no needed.



Notepadchanging port to new vlam

add vlan 150 to port 24

sw1#configure terminal

sw1(config)#vlan 150

sw1(config-vlan)name ccna


sw1(config) do show vlan brief

sw1#show interfaces fast ethernet?

<0-9) Fast ethernet interface nu,ber

sw1# show interfaces fastethernet 0/24 (slot number/portid)

MTU for ethernet is 1500 bytes

apply 150vlan to port

firat go into the port

sw1(config)#interface fast ethernet 0/24

sw1(config-if)#switch port mode access(tells unconditionally an access port)

sw1(config-if)#awitch port acess vlan 150(that u r going to the part to vlan 150,changes to access port)


back to priv mode

sw1# show vlan brief

(shows port 24 has moves to vlan 150)










Notepadconfiguring trunk

loging to switch 1

sw1#confgure terminal


to make changes in the port first go into the port so that is fastethernet 0/1

sw1(config)#interface fastethernet 0/1

sw1(config-if)#switchport mode ?

sw1(config-if)#switchport mode dynamic?

sw1(config-if)#switchport mode dynamic desirable

go to switch 2

sw2(config-if)#do show interface trunk

go to switch 1

modify VLAN allowed list

sw1(config-if)# switchport trunk allowed vlan 1,150,200-220

sw1(config-if)#do show interface trunk

vlan allowed on trunk list has been modified

change the native vlan

sw1(config-if)#switchport trunk native vlan 150

sw1(config-if)#do show interface trunk

native vlan will be changed to 150

switch complaines about natice vlan mismatch

sw2(config)#switch port trunk allow vlan 150



Notepaddata link MAC add.

Layer 2- controls communication on immediate link bt two devices

data has been put into set structure .its called PDU(protocol data unit)

In layer 2 data is called PDU is frame

Layer 2 needs MAC add ..its looks like 48 bit in length (hexadecimal) eg: 002A.ABCD.1234 (each digit represents 4 bits) each bits has specific value.the first 24 bit in MAC add(eg till B) its called OUI field (vendor specific) .,7 th bit of MAC add. is ULB.IF thats OFF then this MAC is universally unique. If ON then its locally assigned


Notepadhow to set a password for router enable mode

router#configure terminal

(it takes to global config mode, any change made by this mode will affect the device as whole)

router(config)#hostname r1

promt changes to

How to set a passoword:

r1(config)#enable password cisco(pswd)



back to priv mode

r1#disable(took back to user mode)





as its not saved nothing will retain and will come back to blank router

r1# show running config

changes will be showm which is made to router and also password been shown

to encrypt paswd

r1# configure terminal

r1(config)# enable secret bob(pswd)

r1(config)# exit

r1# show running config

the password wont be shown(shown as jibberish)



r1> enable




Notepadlab to test trunking protocol

vtp mode?

to switch 1





vtp mode server

vtp domain ccna

vtp password cisco

do show vtp status

to see the password

do show vtp password

GO TO SWITCH 2 and make it transparent

vtp mode transparent

vtp domain ccna

vtp password cisco

do show vtp status

GO TO SWITCH 3 make it transparent

vtp mode trnasparent

vtp passowrd cisco

vtp domain ccna

SWITCH 4 make as client

vtp domain ccna

vtp password cisco

vtp mode client

create vlan 777 at sitch 1 and name as test

the transparent mode should not show creaated vlan 777

client switch should show vlan 777.

try to create vlan 55 in client mode

it cant create

try on transaerent mode too

it will create

delete it.

on switch 1

diff between vtp version 1 ans 2

version 2 supports token ring vlan..

save it.do wr.





Notepadlink of switch- trunk port.

types of links in switch

access port

trunk port

Trunk link can carry more than one VLAN at a time

Frame tagging:

used to identify VLAN when comes to diff switches

1)Inter switching link(ISL)(26 byte header)

2)IEEE 802 Iq.(dor 1q)it inserts a 4 byte field into a frame.it has less overhead.

Dynamic trunking protocol

can run in one of three modes

1)dynamic desiracle-it will send and response DTP frames.

NOTE:switch model end with no. 50 (eg 3550 ) will have all its ports by default dynamic desirable mode

2)dynamic auto mode (the port will respond to dtp frame from other side.it will not send dtp frame.Port will not initiatte trunking. Ends will number 60 will have their ports in dynamic auto mode.

3) ON mode.



Notepadper vlan SSTP

cisco switches not just run spanning tree. if i have 5 vlan i have 5 spanning tree in a network..

why 5 vlan spanning tree?

for load balancing

bridge id field will be modified

bridge ID=4bit+12bit+48bbit(mac)



Notepadport fast enabling lab on switches

Commands for STP enhancements:

where to use this feature? on switch port

go to port f0/24

spanning tree port fast

enable port fast on switch 2 at port 24 too and as well as switch 3

and in switch 4 go to router 4

now enable  for switc 4 too



Notepadrouter console line configuration

Router login method:

ports that we use to login to the router and its called console port which connects the console port of router to

rj45 used to connect console port of router to computer


r1(config0#line console 0

r1(config-line)#exec-timeout 2 20(controllos your automatic log out)

Now log in back till line console again

by saying exec-timeout 00(automatic log out feature off)

r1(config-line)#logging synchronous( it prevent from interrupting my typing)

console level password:

r1(config-line)password ccna

r1(config-line)# login




log back in

hit enter




r1#configure termial

r1(config)#line vty(virtual tele type)?

<0-15> First line number

r1(config)#line vty 0 15


r1(config-line)#exec timeput 10 0

r1(config-line)#password ccna


r1(config-line)#do show running config

(changes made are shown)

service passwords encryption( command encrypts all future passwd.)









Notepadspanning tree

it prevents frame from looping around a nete when redundent link are present between switches

Broadcast dom:

Crashing the MAC table:

inorder to avoid those spanning tree is used

works in three steps:

elect 1 root bridge per layer domain

2 elect 1 root port per non root designated

3 elect 1 designated port per segment

each one the steps show follow the 4 steps they are

lowest brigde ID

lowest port path cost

lowest sender bridge ID

lowest sender port ID



NotepadSTP lab


show spanning-tree vlan 100(name)

for chaning prioroty

spanning tree vlan 150 priority ?

and slect the valus



VLAN trunking protocol

1.VTP server mode(can modify vlan.dat file such as adding,deleting,naming,changing a vlan MTU)

2.VTP client mode(will lisiten to the modification.it cannot modify anything)

3.VTP transparent mode(it will forward advertisments to others.it wont modify anything although it can modify it)


< All Cisco CCNA Notes
Join Cybrary

Our Revolution

We believe Cyber Security training should accessible for everyone, everywhere. Everyone deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is the world's largest community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

We recommend always using caution when following any link

Are you sure you want to continue?