Wednesday, April 28, 2010

STP - Spanning Tree Protocol


switch(config)#spanning-tree mode pvst
switch(config)#spanning-tree mode rapid-pvst
switch(config)#spanning-tree vlan 10 root primary
switch(config)#spanning-tree vlan 20 root secondary
switch(config)#spanning-tree vlan 10 priority 4096
switch(config)#spanning-tree vlan 99 root primary diameter 5
switch(config)#interface fastethernet 0/18
switch(config-if)#spanning-tree cost 25
switch(config-if)#spanning-tree portfast
-> for access port. Also designates RSTP edge port.
switch(config-if)#spanning-tree port-priority 112 (default 128)
switch(config-if)#spanning-tree link-type point-to-point
switch#clear spanning-tree detected-protocols
-> clear all detected STP
switch#show spanning-tree vlan 10

Friday, April 16, 2010

VLAN & VTP

VLAN tag control: 3 bit of priority (used by 802.1p standard), 1 bit of Canonical Format Identifier (enables Token Ring frames), 12 bit of VLAN ID.
S1#delete flash:vlan.dat
S1(config)#vlan 10
S1(config-vlan)#name student
S1#vlan database (for old switches)
S1(vlan)#vlan 10 name xxx (for old switches)
S1(vlan)#vtp client (for old switches)
S1(config)#no vlan 10
S1(config)#vlan 100,105-110
S1#show vlan brief
S1#show vlan id 10
S1#show vlan name student
S1#show interface vlan 10 switchport
S1#show vlan summary
-> display count of all configured VLANs

S1(config)#interface range gi0/1-2
S1(config-if-range)#shutdown
S1(config)#interface range fa0/1-24
S1(config-if-range)#shutdown
S1(config)#interface range fa0/6, fa0/11
S1(config-if-range)#switchport mode access
S1(config-if-range)#no shutdown
S1(config)#interface range fa0/6-10
S1(config-if-range)#switchport access vlan 10
S1(config-if)#mls qos trust cos
-> ensure that voice traffic as priority traffic (if the network is setup to prioritize voice traffic)

S1(config)#interface fa0/18
S1(config-if)#switchport voice vlan 150
S1(config-if)#switchport mode access
S1(config-if)#no switchport access vlan
S1(config-if)#switchport access vlan 105
S1(config-if)#switchport port-security maximum 2
S1(config-if)#switchport port-security mac-address sticky
S1(config-if)#duplex auto // can be full, or half
S1(config-if)#speed auto
S1(config)#[no] mac-address-table static vlan {1-4096, ALL} interface interface-id
-> create a static mapping in the MAC address table

S1(config)#interface F0/1
S1(config-if)#switchport trunk encapsulation dot1q
S1(config-if)#switchport mode trunk ... or
S1(config-if)#switchport mode dynamic auto ... or
S1(config-if)#switchport mode dynamic desirable ... or
S1(config-if)#switchport nonegotiate
-> turn off DTP

S1(config-if)#switchport trunk native vlan 99
S1#show interface trunk


switch(config)#ip default-gateway 172.17.99.1
switch(config)#interface vlan 99
switch(config-if)#ip address 172.17.99.11 255.255.255.0
switch(config-if)#no shutdown

Router(config)#interface fa0/0.10
-> for vlan 10
Router(config-subif)#encapsulate dot1q 10
Router(config-subif)#ip address 172.16.10.11 255.255.255.0
Router(config)#interface fa0/0.99
Router(config-subif)#encapulate dot1q native 99
Router(config-subif)#ip address 172.16.99.1 255.255.255.0
Router(config-subif)#interface fa0/0
Router(config-if)#no shutdown

S1#show vtp status
S1(config)#vtp domain mydomain
S1(config)#vtp version 1
S1(config)#vtp password mypassword
S1(config)#vtp mode [server | client]