You should connect switches with trunk links and limit the VLANs allowed on each trunk to only those used on the switch with the switchport trunk allowed vlan <vlan list>
command.
Use the global spanning-tree portfast default
and spanning-tree portfast bpduguard default
commands. That will enable those on all access interfaces, but not trunk interfaces. If someone then mistakenly connects the access interfaces of two switches, the interface will errdisable when it sees BPDUs, preventing a loop.
Some more best practices we got from Cisco are See this answer:
Do not use a native VLAN.
Disable the VLAN 1 SVI on all switches and do not include VLAN 1 in the switchport trunk allowed vlan <vlan list>
.
Only connect access switches to the distribution switches; never connect an access switch to an access switch (no daisychaining). Use "V" shaped connections (connect the access switch only to both distribution switches), not "U" shaped connections.
Do this:
------------------ ------------------
| Distribution 1 |----| Distribution 2 |
------------------ ------------------
\ \ / /
\ \/ /
\ /\ /
\ / \ /
------------ -----------
| Access 1 | | Access 2|
------------ -----------
Not this:
------------------ ------------------
| Distribution 1 |----| Distribution 2 |
------------------ ------------------
\ /
\ /
\ /
\ /
------------ -----------
| Access 1 |----| Access 2|
------------ -----------
Use different VLANs on each access switch. One access switch per VLAN (not one VLAN per switch as some people think). You can have as many VLANs on an access switch as you like, but those VLANs should not be extended to any other access switch.
Disable VTP by using the vtp mode transparent
command. You will need to manually create the VLANs used on each switch.
Specifically use the switchport mode trunk
command on the trunk interfaces and the switchport mode access
command on the access interfaces and use the switchport nonegotiate
command on all the switch interfaces to prevent DTP autodetection.