VTP, PVST+, PVRST LAB (Phần 1) - Bài Viết Sưu Tầm

I. Mô hình bài Lab

- Cấu hình tất cả các loại password cho router & switch là dtu

- Từ Router phải Telnet được đến tất cả các Switch

- Sử dụng PVST+

- VTP Version 2:

+ Domain name: dtu.vn

+ VTP Password: dtu

- VLAN 1: Default_Network, 192.168.1.0/24

- VLAN 2: Accounting_Network, 192.168.2.0/24, f0/1 => f0/5

- VLAN 3: Engineering_Network, 192.168.3.0/24, f0/6 => f0/10

- VLAN 4: Maketing_Network, 192.168.4.0/24, f0/11 => f0/15

- IP cho các Interface VLAN 1 trên các Switch là:

+ SW1: 192.168.1.11/24

+ SW2: 192.168.1.12/24

+ SW3: 192.168.1.13/24

 

II. Các bước cấu hình bài Bab

Bước 1: Xóa thông tin VLAN và VTP trên các Switch

Bước 2:Cấu hình các loại mật khẩu cho cổng console,vty,mode priviliege

Bước 3: Cấu hình VTP trên 3 Switch

Bước 4: Cấu hình Trunking

Bước 5: Tạo thông tin VLAN theo yêu cầu của bài lab trên VTP server (SW1)

Bước 6: Gán các cổng trên SW2,SW3 vào các VLAN tương ứng theo yêu cầu

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

Bước 8: SW1 là RootBridge

Bước 9: Kiểm tra lại sự định tuyến giữa các VLAN  

Bước 10: Cấu hình PVRST+

III. Các bước thực hiện

Bước 1: Xóa thông tin VLAN và VTP trên các Switch

- Kiểm tra switch đã có cấu hình hay chưa bằng các lệnh:

show startup-config

show vlan brief

=> nếu có thì tiến hành xóa thông tin VLAN và cấu hình cũ.

Switch#delete vlan.dat

 

- Do thông tin VTP và VLAN nằm ở tập tin vlan.dat ở bộ nhớ Flash: nên lệnh này có tác dụng xóa thông tin VLAN và VTP trên switch

SW1#erase startup-config

Switch#reload

Bước 2: Cấu hình mật khẩu cho cổng Console,line vty ,mode privilege

SW1>enable

SW1#config terminal

SW1(config)#enable secret dtu

 

SW1(config)#line console 0

SW1(config-line)#password dtu

SW1(config-line)#login

 

SW1(config)#line vty 0 15

SW1(config-line)#password dtu

SW1(config-line)#login

- Lặp lại bước 2 cho các switch còn lại và router

 

Bước 3: Cấu hình VTP trên 3 Switch

- Mặc định các Switch Cisco có cấu hình VTP như sau:

– VTP domain name: None

– VTP mode: Server mode

– VTP pruning: Enabled or disabled (model specific)

– VTP password: Null

– VTP version: Version 1

- Để đồng bộ được thông tin VTP thì đòi hỏi các switch phải giống nhau về  VTP Domain và VTP Password .

 

SW1:

Switch>enable

Switch#config terminal

Switch(config)#hostname SW1

SW1(config)#exit

 

- Xem thông tin VTP trên SW1 trước khi cấu hình bằng lệnh show vtp status

SW1#show vtp status

 

SW1(config)#vtp version 2

SW1(config)#vtp domain dtu.vn

SW1(config)#vtp password dtu

SW1(config)#vtp mode server

 

- Thông tin VTP trên SW1 sau khi cấu hình

SW1#show vtp status

SW1#show vtp password

 

SW2:

Switch>enable

Switch#config terminal

Switch(config)#hostname SW2

SW2(config)#vtp version 2

SW2(config)#vtp domain dtu.vn

SW2(config)#vtp password dtu

SW2(config)#vtp mode client

 

- Kiểm tra lại thông tin VTP trên SW2

SW2#show vtp status

SW2#show vtp password

 

SW3:

Switch>enable

Switch#config terminal

Switch(config)#hostname SW3

SW3(config)#vtp version 2

SW3(config)#vtp domain dtu.vn

SW3(config)#vtp password dtu

SW3(config)#vtp mode client

 

- Kiểm tra lại thông tin VTP trên SW3

SW3#show vtp status

SW3#show vtp password

 

Bước 4: Cấu hình Trunking cho 3 switch SW1,SW2,SW3 và Router

Chú ý: Đối với Switch layer 3 do hỗ trợ cả 2 chuẩn 802.1Q và ISL nên trước khi cấu hình Trunking cần thêm lệnh switchport trunk encapsulation dot1q ở mode interface, còn đối với Switch layer 2 thì chỉ hỗ trợ 802.1Q nên không cần nhập lệnh trên.

- SW1:

SW1(config)#interface fa0/20

SW1(config-if)#switchport trunk encapsulation dot1q  //chỉ dùng cho layer3 Switch

SW1(config-if)#switchport mode trunk

SW1(config-if)#switchport nonegotiate    // vô hiệu hóa chức năng DTP  

SW1(config-if)#no shutdown

SW1(config-if)#exit

 

SW1(config)#interface fa0/22

SW1(config-if)#switchport trunk encapsulation dot1q

SW1(config-if)#switchport mode trunk

SW1(config-if)#switchport nonegotiate

SW1(config-if)#no shutdown

SW1(config-if)#exit

 

SW1(config)#interface fa0/23

SW1(config-if)#switchport trunk encapsulation dot1q

SW1(config-if)#switchport mode trunk

SW1(config-if)#switchport nonegotiate

SW1(config-if)#no shutdown

 

- SW2:

SW2(config)#interface fa0/22

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/23

SW3(config-if)# switchport trunk encapsulation dot1q  

SW3(config-if)#switchport mode trunk

SW3(config-if)#switchport nonegotiate

SW3(config-if)#no shutdown

 

- Sử dụng lệnh show interfaces trunk để kiểm tra lại cấu hình Trunking

SW1#show interfaces trunk

 

Router:

Router#config terminal

Enter configuration commands, one per line.  End with C

Router(config)#interface fa0/0

Router(config-if)#description Gateway cho VLAN1

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#exit

Router(config)#interface fa0/0.2

Router(config-subif)#description Gateway cho VLAN2

Router(config-subif)#encapsulation dot1Q 2

Router(config-subif)#ip address 192.168.2.1 255.255.255.0

Router(config-if)#exit

Router(config)#interface fa0/0.3

Router(config-subif)#description Gateway cho VLAN3

Router(config-subif)#encapsulation dot1Q 3

Router(config-subif)#ip address 192.168.3.1 255.255.255.0

Router(config-if)#exit

Router(config)#interface fa0/0.4

Router(config-subif)#description Gateway cho VLAN4

Router(config-subif)#encapsulation dot1Q 4

Router(config-subif)#ip address 192.168.4.1 255.255.255.0

Router#show ip interface brief

 

Từ khóa » Cấu Hình Pvst+