cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1419
Views
6
Helpful
20
Replies

How to configure STP in Cisco?

abbas64
Level 1
Level 1

Hi,

I am configuring a small network with one router (also a DHCP server), 5 switches. All switches are connected to each other Gigabitethernet.

I have configured VLANs on the switches and configured DHCP pools on the router. I have also configured one router to act as root switch or root bridge using following command:

Root switch does not have any VLANs configured. Other switches have VLAN configured with IP addresses assigned.

spanning-tree vlan 1 root primary

The problem is I can't ping any computer or a switch from another switch. All switches are directly connected to each other, but I still can't ping.

I have attached an image of my network topology.

I am using 2960 switches.

20 Replies 20

Hello,

when you do a 'show vtp status' on your switches, do all of them have the same amount of VLANs ? What do the trunks look like that connect the switches ?

Can you post the configs of two neighboring switches ?

Result of "show vtp status" from switch where I created ALL vlans and assign addresses to VLANs:

Switch#show vtp status

VTP Version : 2

Configuration Revision : 6

Maximum VLANs supported locally : 255

Number of existing VLANs : 11

VTP Operating Mode : Server

VTP Domain Name :

VTP Pruning Mode : Disabled

VTP V2 Mode : Disabled

VTP Traps Generation : Disabled

MD5 digest : 0x5B 0x1A 0xF3 0x57 0x2D 0x7E 0xA0 0x30

Configuration last modified by 0.0.0.0 at 3-1-93 00:01:45

Local updater ID is 195.165.85.33 on interface Vl5 (lowest numbered VLAN interface found)

Result of "show vtp status" from switch with only VLANs that it needs:

Switch#show vtp status

VTP Version : 2

Configuration Revision : 3

Maximum VLANs supported locally : 255

Number of existing VLANs : 8

VTP Operating Mode : Server

VTP Domain Name :

VTP Pruning Mode : Disabled

VTP V2 Mode : Disabled

VTP Traps Generation : Disabled

MD5 digest : 0x6A 0x5D 0x5F 0xCF 0xAA 0x2E 0x47 0x45

Configuration last modified by 0.0.0.0 at 3-1-93 00:06:22

Local updater ID is 0.0.0.0 (no valid interface found)

Configuration of switch with ALL VLANs:

spanning-tree mode pvst

!

interface FastEthernet0/1

switchport access vlan 10

!

interface FastEthernet0/2

switchport access vlan 15

!

interface FastEthernet0/3

switchport access vlan 20

!

interface FastEthernet0/4

switchport access vlan 25

!

interface FastEthernet0/5

switchport access vlan 30

!

interface FastEthernet0/6

switchport access vlan 5

interface GigabitEthernet0/2

switchport mode trunk

!

interface Vlan1

no ip address

shutdown

!

interface Vlan5

ip address 195.165.85.33 255.255.255.224

!

interface Vlan10

ip address 195.165.85.65 255.255.255.224

!

interface Vlan15

ip address 195.165.85.97 255.255.255.224

!

interface Vlan20

ip address 195.165.85.129 255.255.255.224

!

interface Vlan25

ip address 195.165.85.161 255.255.255.224

!

interface Vlan30

ip address 195.165.85.193 255.255.255.224

-----------------------------------------------------------------------

Configuration of other switch:

spanning-tree mode pvst

!

interface FastEthernet0/1

switchport access vlan 15

!

interface FastEthernet0/2

switchport access vlan 10

!

interface FastEthernet0/3

switchport access vlan 5

!

interface GigabitEthernet0/2

switchport mode trunk

---------------------------------------------

One more thing I changed the root switch using following command:

spanning-tree vlan 1 root primary --> I said vlan 1 because root switch does not have any vlans, but the default vlan 1.

Hello,

it doesn't really matter where the root for VLAN 1 or the other VLANs is, as they can be different for each VLAN.  Anyway, you should see the same amount of VLANs on each switch. Common problems are different VTP versions on the switches. If you issue a 'show vtp status' on the other switches, check if the VTP version is the same on all.

When you do a 'sh cdp neighbor' on the root switch, are all the client switches listed ?

Hello,

Yes, all switches have version 2 or same version running. The output of "show cdp neighbor" is:

Switch#show cdp neighbors

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge

S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone

Device ID Local Intrfce Holdtme Capability Platform Port ID

Switch Gig 2/1 143 S 2960 Gig 0/1

Switch Gig 5/1 120 S 2960 Gig 0/1

Switch Gig 4/1 165 S 2960 Gig 0/1

Switch Gig 3/1 165 S 2960 Gig 0/1

Switch#

So in brief I have vlans configured on all 4 switches, the switch in the middle (in picture) is the root switch, dhcp is configured on router.

But no connection or no ping. 

When I try to ping one switch from another switch all packets are broadcast.

Stupid question maybe, but do you have 'ip routing' enabled on the root switch ?

I am using Cisco layer 2 switches, so I think I can't enable ip routing.

Just so that I understand: when you do a 'show vtp status' on one of the client switches, it shows the same amount of VLANs, but you cannot ping a device in the same VLAN ? Which VLAN is your management VLAN ?

In addition, all your switches have an IP address in the same VLAN ?

No, not all switches have same amount of VLANs. 

The switch where I configured all VLANs has 11 and other switch have 8.

OK. Can you post the output of 'show int trunk' from the core switch ?

show int trunk:

there is a blank line, no output. Plus why do I need trunking on root switch?

You need trunking on every switch, including the root. The output of 'show cdp neighbor' shows you the local and the remote ports that need to be configured as trunks. The configuration of the trunk ports should look like this:

switchport mode trunk

switchport nonegotiate 

It might be easier if you post the full configuration of the core switch and one of the neighbor switches. That way, I can check if something is missing.

"Show running-config" from core switch:

Switch#show running-config

Building configuration...

Current configuration : 529 bytes

!

version 12.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Switch

!

!

!

spanning-tree mode pvst

spanning-tree vlan 1,5,10,15,20,25,30 priority 24576

!

interface GigabitEthernet0/1

!

interface GigabitEthernet1/1

!

interface GigabitEthernet2/1

!

interface GigabitEthernet3/1

!

interface GigabitEthernet4/1

!

interface GigabitEthernet5/1

!

interface Vlan1

no ip address

shutdown

!

!

!

!

line con 0

!

line vty 0 4

login

line vty 5 15

login

!

!

end

----------------------------------------------------------------------------------

"show running-config" from client switch:

Switch#show running-config

Building configuration...

Current configuration : 1618 bytes

!

version 12.2

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Switch

!

!

!

!

!

spanning-tree mode pvst

!

interface FastEthernet0/1

switchport access vlan 10

!

interface FastEthernet0/2

switchport access vlan 15

!

interface FastEthernet0/3

switchport access vlan 20

!

interface FastEthernet0/4

switchport access vlan 25

!

interface FastEthernet0/5

switchport access vlan 30

!

interface FastEthernet0/6

switchport access vlan 5

!

interface FastEthernet0/7

!

interface FastEthernet0/8

!

interface FastEthernet0/9

!

interface FastEthernet0/10

!

interface FastEthernet0/11

!

interface FastEthernet0/12

!

interface FastEthernet0/13

!

interface FastEthernet0/14

!

interface FastEthernet0/15

!

interface FastEthernet0/16

!

interface FastEthernet0/17

!

interface FastEthernet0/18

!

interface FastEthernet0/19

!

interface FastEthernet0/20

!

interface FastEthernet0/21

!

interface FastEthernet0/22

!

interface FastEthernet0/23

!

interface FastEthernet0/24

switchport mode trunk

!

interface GigabitEthernet0/1

!

interface GigabitEthernet0/2

switchport mode trunk

!

interface Vlan1

no ip address

shutdown

!

interface Vlan5

ip address 195.165.85.33 255.255.255.224

!

interface Vlan10

ip address 195.165.85.65 255.255.255.224

!

interface Vlan15

ip address 195.165.85.97 255.255.255.224

!

interface Vlan20

ip address 195.165.85.129 255.255.255.224

!

interface Vlan25

ip address 195.165.85.161 255.255.255.224

!

interface Vlan30

ip address 195.165.85.193 255.255.255.224

!

!

!

!

line con 0

!

line vty 0 4

login

line vty 5 15

login

!

!

end

Review Cisco Networking products for a $25 gift card