Cisco Switching Network: Part-1

Configure Ip address in Switch


Switch# configure terminal
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#no switchport 
Switch(config-if)#ip address 10.10.10.2 255.255.255.252
Switch(config-if)#no shutdown

Switch# show ip interface brief 


Configure Ip address on Default VLAN

Switch# configure t
Switch(config)#interface vlan 1
Switch(config-if)#ip address 10.0.0.2 255.255.255.252
Switch(config-if)#no shutdown
Switch(config-if)#exit

Switch# show vlan


Configuring VLAN and INTERFACE VLAN 

Switch(config)#interface vlan 100
Switch(config-if)#ip address 172.16.100.1 255.255.255.0 

Switch# conf t
Switch(config)#vlan 100      <any id>
Switch(config-vlan)#name SERVER-VLAN     <any name>

Switch(config)#ip default-gateway 172.16.200.1


##c3745 switch vlan configuration

Switch#vlan database
Switch(vlan)#vlan 10 name IT
Switch#show vlan-switch brief


Configure Trunk Port 

Switch>en
Switch#configure terminal 
Switch(config)#interface gigabitEthernet 0/0     <outer interface>
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan add 100
Switch(config-if)#no shutdown 
Switch(config-if)#exit

Switch# show interfaces trunk 



Configure Access Port 

switch>en
switch# configure terminal
switch(config)#spanning-tree mode rapid-pvst 

switch(config)#interface range fastEthernet 0/2-3
switch(config-if-range)#switchport mode access 
switch(config-if-range)#switchport access vlan 100


Configuring IP helper-address

Multilayer Switch0   

switch(config)#interface vlan 10
switch(config-if)#ip helper-address 10.10.10.1



Configure Spanning Tree Protocol


In networks with redundancy STP helps prevent:
Switching loops
Layer 2 Broadcast Storms

STP can't understand the vlan
IEEE Standard:802.1d
PVST+ = Per Vlan spanning tree protocol (used by cisco)

Switchport States
1. Blocking-stable state
2. Listening-intermediator/transitory state
3. Learning-intermediator/temporary state
4. Forwarding-stable state

Port Designations:
Root Switch are always in forwarding state
Root Port = Closest/connected to the root bridge
Designated Port = Forwarding state
Non-Designated Port = Blocking state


Port Costs:
10 Gig = 2
1 Gig = 4
100 Mb = 19
10 Mb = 100 

Process
BID(Bridge ID) = Used to determine the Root Bridge

Root Bridge ID --- Sender Bridge ID --- Cost to Reach Root --- Timer Value(hello timer=2 second, max age timer=20 second, forward delay timer=30 seconds)

Convergence Time=20 seconds

Ways of Election


1. Root Switch
    Hello BPDU(Bridge Protocol Data Unit)=8 bytes 
    > Bridge Priority Number(2 bytes and range=0-65535) =32768 (default) Lowest
    > System ID (6 bytes and MAC Address) = Lowest MAC Address
    > Extended System ID = ID for VLANs

2. Root Port
    > Cost to reach port
    > Interface with lower number

3. Designation Switch
    > Cost to reach port
    > Switch with lower bridge id
    > Port with lower number

After selection of Root Switch, only it can send BPDU.


switch(config)#spanning-tree mode pvst
switch(config)#spanning-tree vlan 1 priority  <num>
switch(config)#spanning-tree vlan 1 root primary
switch(config)#spanning-tree vlan 2 root secondary

switch(config)#interface fa0/1
switch(config-if)#spanning-tree cost    <number>
switch(config-if)#spanning-tree port-priority     <num, 128 default>


switch# show spanning-tree 
switch# show run | i span
switch# sh spanning-tree vlan 1



Configure Rapid Spanning Tree Protocol (RSTP)


Convergence Time=6 seconds
IEEE Standard:802.1w

Switchport States
1. Discarding-stable state
2. Listening-intermediator/transitory state
3. Learning-intermediator/temporary state
4. Forwarding-stable state

Port Designations:
Root Switch are always in forwarding state
Root Port = Closest/connected to the root bridge
Alternate Port=Backup of Root Port 
Designated Port = Forwarding state
Backup Port=Backup of Designated Port


(RPVST) Rapid Per Vlan Spanning Tree Protocol /PVRSTP

Switch(config)#spanning-tree mode rapid-pvst
spanning-tree link-type point-to-point
clear spanning-tree detected-protocols


Configuring VTP

switch#show vtp status
vtp mode <Name>
vtp domain <cisco.com>
vtp version 2


switch(config)#enable secret cisco
switch(config)#line vty 0 4
switch(config-line)#password ccna
switch(config-line)#login
switch>en


check From Switch

Switch# show mac address-table interfaces fastEthernet 0/3



Configuring PORT FAST

Only work in access mode, not working in trunk mode

switch(config)#interface fa 0/5
switch(config-if)#switchport mode access 
switch(config-if)#switchport access vlan 10
switch(config-if)#spanning-tree portfast



For Security at switch

Configuring BPDU Guard

switch(config)#interface fa 0/5
switch(config-if)#switchport mode access 
switch(config-if)#switchport access vlan 10
switch(config-if)#spanning-tree portfast
switch(config-if)#spanning-tree bpduguard enable



Configuring ROOT Guard

switch#configure terminal
switch(config)#interface giga 0/0
switch(config-if)#spanning-tree guard root
switch(config-if)#exit
switch(config)#exit
switch
 

To disable Root Guard, use following commands.

switch#configure terminal
switch(config)#interface giga 0/0
switch(config-if)#no spanning-tree guard root
switch(config-if)#exit
switch(config)#exit
switch



MIST=Multiple Instance Spanning Tree
IEEE Standard:802.1s
 































***

0 Comments