Command:

set spantree portvlancost

Mode:

Switch> (enable)


Syntax:

set spantree portvlancost mod_num/port_num [cost cost_value] [preferred_vlans]


Syntax Description:

mod_num

Variable that specifies the number of the module.

port_num

Variable that specifies the number of the port.

cost cost_value

(Optional) Keyword that indicates the path cost. The port VLAN cost applies only to trunk ports; valid values are from 1 to 65535.

preferred_vlans

(Optional) Variable that specifies the preferred VLANs. If you do not list a specific VLAN, the VLANs that were listed in prior use of this command are affected. If you do not list a specific cost, and previous cost values are specified in prior use of the command, then the port VLAN cost is set to one less than the current port cost for a port. However, this might not ensure load balancing in all cases; valid values are from 1 to 1005.

 


Command Description:

Use the set spantree portvlancost command to assign a lower path cost to a set of VLANs on a port.


Example:

These examples show various ways to use the set spantree portvlancost command:

Console> (enable) set spantree portvlancost 2/10 cost 25 1-20

Cannot set portvlancost to a higher value than the port cost, 10, for port 2/10.
Console> (enable)

Console> (enable) set spantree portvlancost 2/10 1-20

Port 2/10 VLANs 1-20 have a path cost of 9.
Console> (enable)

Console> (enable) set spantree portvlancost 2/10 cost 4 1-20
Port 2/10 VLANs 1-20 have path cost 4.
Port 2/10 VLANs 21-1000 have path cost 10.
Console> (enable)
Console> (enable) set spantree portvlancost 2/10 cost 6 21

Port 2/10 VLANs 1-21 have path cost 6.
Port 2/10 VLANs 22-1000 have path cost 10.
Console> (enable)
 

These examples show how to use the set spantree portvlancost command without explicitly

specifying cost:

Console> (enable) set spantree portvlancost 1/2

Port 1/2 VLANs 1-1005 have path cost 3100.
Console> (enable)

Console> (enable) set spantree portvlancost 1/2 21

Port 1/2 VLANs 1-20,22-1005 have path cost 3100.
Port 1/2 VLANs 21 have path cost 3099.
Console> (enable) 

 


Misconceptions:
None

Related Commands:
show spantree

� Cisco Systems, Inc. 2001, 2002, 2003
World Wide Education

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)