In the following example, the two interfaces participate in MST instance 0, the default instance to which all VLANs are mapped:
Router# enable
Router# configure terminal
Router(config)# interface gigabitethernet 4/0/0
Router(config-if)# service instance 1 ethernet
Router(config-if-srv)# encapsulation dot1q 2
Router(config-if-srv)# bridge-domain 100
Router(config-if-srv)# interface gigabitethernet 4/0/3
Router(config-if)# service instance 1 ethernet
Router(config-if-srv)# encapsulation dot1q 2
Router(config-if-srv)# bridge-domain 100
Router(config-if-srv)# end
Issue the following command to verify:
Router# show spanning-tree vlan 2
MST0
Spanning tree enabled protocol mstp
Root ID Priority 32768
Address 0009.e91a.bc40
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768 (priority 32768 sys-id-ext 0)
Address 0009.e91a.bc40
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi4/0/0 Desg FWD 20000 128.1537 P2p
Gi4/0/3 Back BLK 20000 128.1540 P2p
In the following example, interface gigabitethernet 4/0/0 and interface gigabitethernet 4/0/3 are connected back to back. Each has a service instance attached to it. The service instance on both interfaces has an encapsulation VLAN ID of 2. Changing the VLAN ID from 2 to 8 in the encapsulation directive for the service instance on interface gi4/0/0 stops the MSTP from running in the MST instance to which the old VLAN is mapped and starts the MSTP in the MST instance to which the new VLAN is mapped:
Router(config-if)# interface gigabitethernet 4/0/0
Router(config-if)# service instance 1 ethernet
Router(config-if-srv)# encapsulation dot1q 8
Router(config-if-srv)# end
Issue the following command to verify:
Router# show spanning-tree vlan 2
MST1
Spanning tree enabled protocol mstp
Root ID Priority 32769
Address 0009.e91a.bc40
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0009.e91a.bc40
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi4/0/3 Desg FWD 20000 128.1540 P2p
Router# show spanning-tree vlan 8
MST2
Spanning tree enabled protocol mstp
Root ID Priority 32770
Address 0009.e91a.bc40
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32770 (priority 32768 sys-id-ext 2)
Address 0009.e91a.bc40
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi4/0/0 Desg FWD 20000 128.1537 P2p
In the following example, interface gigabitethernet 4/0/3 with a service instance that has an outer encapsulation VLAN ID of 2 and a bridge domain of 100 receives a new service:
Router# enable
Router# configure terminal
Router(config)# interface gigabitethernet 4/0/3
Router((config-if)# service instance 2 ethernet
Router((config-if-srv)# encap dot1q 2 second-dot1q 100
Router((config-if-srv)# bridge-domain 200
Now there are two service instances configured on interface gigabitethernet 4/0/3 and both of them have the same outer VLAN 2.
interface GigabitEthernet4/0/3
no ip address
service instance 1 ethernet
encapsulation dot1q 2
bridge-domain 100
!
service instance 2 ethernet
encapsulation dot1q 2 second-dot1q 100
bridge-domain 200
The preceding configuration does not affect the MSTP operation on the interface; there is no state change for interface gi4/0/3 in the MST instance it belongs to.
Router# show spanning-tree mst 1
##### MST1 vlans mapped: 2
Bridge address 0009.e91a.bc40 priority 32769 (32768 sysid 1)
Root this switch for MST1
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi4/0/3 Desg FWD 20000 128.1540 P2p