(+84) 236.3827111 ex. 402

VTP, PVST+, PVRST LAB (Phần 2)


Bước 5: Tạo VLAN trên VTP server ở SW1

- Kiểm tra thông tin VLAN hiện tại trên SW1

SW1#show vlan

- Tiến hành tạo VLAN

SW1(config)#vlan 2

SW1(config-vlan)#name Accounting_Network

SW1(config-vlan)#exit

SW1(config)#vlan 3

SW1(config-vlan)#name Engineering_Network

SW1(config-vlan)#exit

SW1(config)#vlan 4

SW1(config-vlan)#name Markeeting_Network

SW1(config-vlan)#exit

Kiểm tra lai thông tin trên SW1,SW2,SW3 sau khi cấu hình để đảm bảo thông tin VLAN và VTP được đồng bộ.

SW1#show vlan

SW1#show vtp status

SW2#show vlan

SW2#show vtp status

SW3#show vlan

SW3#show vtp status

Bước 6: Gán các port trên từng Switch vào VLAN tương ứng

- SW1:

SW1(config)#interface range fa0/1 - 5

SW1(config-if-range)#switchport access vlan 2

SW1(config-if-range)#exit

SW1(config)#interface range fa0/6 - 10

SW1(config-if-range)#switchport access vlan 3

SW1(config-if-range)#exit

SW1(config)#interface range fa0/11 - 15

SW1(config-if-range)#switchport access vlan 4

SW1(config-if-range)#exit

- Lặp lại bước 6 trên các Switch còn lại

- Kiểm tra lại bằng lệnh show vlan trên cả 3 Switch

SW1#show vlan

Bước 7: Cấu hình địa chỉ IP cho các Switch để có thể quản lý từ xa

SW1:

SW1(config)# interface VLAN1

SW1(config-if)#ip address 192.168.1.11 255.255.255.0

SW1(config-if)#no shutdown

SW1(config-if)#exit

SW1(config)#ip default-gateway 192.168.1.1

SW1#show ip interface brief

SW2:

SW2(config)# interface VLAN1

SW2(config-if)#ip address 192.168.1.12 255.255.255.0

SW2(config-if)#no shutdown

SW2(config-if)#exit

SW2(config)#ip default-gateway 192.168.1.1

SW2#show ip interface brief

SW3:

SW3(config)# interface VLAN1

SW3(config-if)#ip address 192.168.1.13 255.255.255.0

SW3(config-if)#no shutdown

SW3(config-if)#exit

SW3(config)#ip default-gateway 192.168.1.1

SW3#show ip interface brief

- Từ các Switch thử ping đến Router

SW1#ping 192.168.1.1

SW1#ping 192.168.2.1

- Sau đó từ router thử telnet đến các Switch

Router#telnet 192.168.1.11

Bước 8: Cấu hình cho SW1 là RootBrigde

- Tiến hành gắn thêm một đường kết nối giữa SW2 và SW3 như mô hình bên dưới

- Cấu hình đường kết nối giữa hai switch SW2 và SW3 là hoạt động ở chế độ Trunk

- SW2:

SW2(config)#interface fa0/24

SW2(config-if)# switchport trunk encapsulation dot1q

SW2(config-if)#switchport mode trunk

SW2(config-if)#switchport nonegotiate

SW2(config-if)#no shutdown

- SW3:

SW3(config)#interface fa0/24

SW3(config-if)# switchport trunk encapsulation dot1q

SW3(config-if)#switchport mode trunk

SW3(config-if)#switchport nonegotiate

SW3(config-if)#no shutdown

- Kiểm tra SW1 hiện tại có phải là rootbridge chưa bằn lệnh show spanning-tree

SW1#show spanning-tree

VLAN0001

Spanning tree enabled protocol ieee (Giao thức chạy mặc định là PVST+)

Root ID Priority 32769 (Root BrigdeID)

Address 000a.b8f3.ec40

Cost 19

Port 22 (FastEthernet0/22) (Root Port của SW1)

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32769 (priority 32768 sys-id-ext 1, Priority mặc định của SW1)

Address 0018.192e.ddc0

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 300

Interface Role Sts Cost Prio.Nbr Type

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

Fa0/20 Desg FWD 19 128.20 P2p

Fa0/22 Root FWD 19 128.22 P2p

Fa0/23 Desg FWD 19 128.23 P2p

VLAN0002

Spanning tree enabled protocol ieee

Root ID Priority 32770

Address 000a.b8f3.ec40

Cost 19

Port 22 (FastEthernet0/22)

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32770 (priority 32768 sys-id-ext 2)

Address 0018.192e.ddc0

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 300

Interface Role Sts Cost Prio.Nbr Type

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

Fa0/20 Desg FWD 19 128.20 P2p

Fa0/22 Root FWD 19 128.22 P2p

Fa0/23 Desg FWD 19 128.23 P2p

VLAN0003

Spanning tree enabled protocol ieee

Root ID Priority 32771

Address 000a.b8f3.ec40

Cost 19

Port 22 (FastEthernet0/22)

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32771 (priority 32768 sys-id-ext 3)

Address 0018.192e.ddc0

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 300

Interface Role Sts Cost Prio.Nbr Type

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

Fa0/20 Desg FWD 19 128.20 P2p

Fa0/22 Root FWD 19 128.22 P2p

Fa0/23 Desg FWD 19 128.23 P2p

VLAN0004

Spanning tree enabled protocol ieee

Root ID Priority 32772

Address 000a.b8f3.ec40

Cost 19

Port 22 (FastEthernet0/22)

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32772 (priority 32768 sys-id-ext 4)

Address 0018.192e.ddc0

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 300

Interface Role Sts Cost Prio.Nbr Type

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

Fa0/20 Desg FWD 19 128.20 P2p

Fa0/22 Root FWD 19 128.22 P2p

Fa0/23 Desg FWD 19 128.23 P2p

- Để cấu hình cho SW1 là Root Bridge cho tất cả VLAN ta tiến hành thay đổi Priority của SW1 thành giá trị thấp hơn giá trị mặc định 32768 của các switch khác

Chú ý: Giá trị của Priority phải là bội số của 4096

SW1(config)#spanning-tree vlan 1-4 priority 4096

- Kiểm tra lại thông tin STP sau khi đổi Priority

SW1#show spanning-tree

VLAN0001

Spanning tree enabled protocol ieee

Root ID Priority 4097

Address 0018.192e.ddc0

This bridge is the root

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 4097 (priority 4096 sys-id-ext 1)

Address 0018.192e.ddc0

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 300

Interface Role Sts Cost Prio.Nbr Type

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

Fa0/20 Desg FWD 19 128.20 P2p

Fa0/22 Desg FWD 19 128.22 P2p

Fa0/23 Desg FWD 19 128.23 P2p

VLAN0002

Spanning tree enabled protocol ieee

Root ID Priority 4098

Address 0018.192e.ddc0

This bridge is the root

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 4098 (priority 4096 sys-id-ext 2)

Address 0018.192e.ddc0

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 300

Interface Role Sts Cost Prio.Nbr Type

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

Fa0/20 Desg FWD 19 128.20 P2p

Fa0/22 Desg FWD 19 128.22 P2p

Fa0/23 Desg FWD 19 128.23 P2p

VLAN0003

Spanning tree enabled protocol ieee

Root ID Priority 4099

Address 0018.192e.ddc0

This bridge is the root

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 4099 (priority 4096 sys-id-ext 3)

Address 0018.192e.ddc0

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 300

Interface Role Sts Cost Prio.Nbr Type

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

Fa0/20 Desg FWD 19 128.20 P2p

Fa0/22 Desg FWD 19 128.22 P2p

Fa0/23 Desg FWD 19 128.23 P2p

VLAN0004

Spanning tree enabled protocol ieee

Root ID Priority 4100

Address 0018.192e.ddc0

This bridge is the root

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 4100 (priority 4096 sys-id-ext 4)

Address 0018.192e.ddc0

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 300

Interface Role Sts Cost Prio.Nbr Type

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

Fa0/20 Desg FWD 19 128.20 P2p

Fa0/22 Desg FWD 19 128.22 P2p

Fa0/23 Desg FWD 19 128.23 P2p


- Như chúng ta thấy hiện tại SW1 đã là Root Bridge cho cả 4 VLAN