• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Xin chào ! Nếu đây là lần đầu tiên bạn đến với diễn đàn, xin vui lòng danh ra một phút bấm vào đây để đăng kí và tham gia thảo luận cùng VnPro.

Announcement

Collapse
No announcement yet.

CCNP Encor Lab 5 - Implement VTP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CCNP Encor Lab 5 - Implement VTP

    Lab - Implement VTP

    SƠ ĐỒ
    MỤC TIÊU
    Phần 1: Cấu hình cơ bản thiết bị
    Phần 2: Triển khai và quan sát VTPv2
    Phần 3: Triển khai và quan sát VTPv3


    NGỮ CẢNH
    - VTP là công nghệ cho phép quản lý việc thêm, xóa, sửa VLAN trên toàn hệ thống mạng từ 1 switch. Tất cả switch được định nghĩa trong cùng 1 domain quản lý (VLAN management domain). 1 switch chỉ được phép trong 1 domain duy nhất và VLAN database sẽ được đồng bộ giữa các switch. Các switch này phải được kết nối với nhau bằng các đường trunk.
    - Có 3 loại version của VTP: version 1, 2 và 3. Version 1 sẽ mặc định trên tất cả các switch. Version 1, 2 có thể support cho các VLAN thông thường (Normal VLAN).
    Version 3 có thể support cả VLAN thông thường và VLAN mở rộng (Extended VLAN).
    - VTP có 4 mode chính:
VTP mode Mô tả
VTP mode server Bạn có thể thêm, sửa và xóa VLAN trên switch mode server. Và cho phép cấu hình các thông số: VTP version, VTP prunning. VTP mode server sẽ quảng bá cho các switch khác thông qua đường trunk. Đây là mode mặc định của switch. Cấu hình VLAN sẽ được lưu trong: flash:vlan.dat. Dữ liệu sẽ không được lưu vào file running-config.
VTP mode client Vận chuyển và nhận VTP update trên đường trunk nhưng không thể thêm, xóa, sửa các VLAN. Ở mode này switch chỉ học từ VTP server switch và lưu vào flash: vlan.dat của nó. Và sẽ không xuất hiện trong file cấu hình runnning-config.
VTP mode transparent Ở mode này switch không tham gia vào VTP. Switch sẽ không quảng bá, không đồng bộ khi nó nhận được thông tin quảng bá. Nó sẽ nhận và vận chuyển thông tin VTP khi VTP domain trống hoặc trùng với domain của switch quảng bá.
Ở mode transparent, Normal VLAN sẽ được lưu cả trong flash: vlan.dat và file running-config. Với VTPv3, nếu sử dụng extended VLAN, switch chỉ lưu trong flash: vlan.dat. Với VTPv1, VTPv2, extended VLAN được lưu trong running-config.
VTP mode off Giống mode transparent nhưng switch sẽ không forward thông tin quảng bá VTP trên đường trunk.

HƯỚNG DẪN THỰC HIỆN

PHẦN 1: CẤU HÌNH CƠ BẢN THIẾT BỊ
Bước 1:
Kết nối dây như sơ đồ
Bước 2: Cấu hình cơ bản mỗi switch
Switch D1
Code:
[SIZE=14px]SW(config)#hostname D1
D1(config)#banner motd # D1, Implement VTP #
D1(config)#spanning-tree mode rapid-pvst
D1(config)#line con 0
D1(config-line)# exec-timeout 0 0
D1(config-line)# logging synchronous
D1(config-line)# exit
D1(config)#interface range e0/0-2
D1(config-if-range)# shutdown
D1(config-if-range)# switchport trunk encapsulation dot1q
D1(config-if-range)# switchport mode trunk
D1(config-if-range)# no shutdown
D1(config-if-range)# exit[B][COLOR=#2980b9][/COLOR][/B][/SIZE]

Switch D2

Code:
Switch(config)#hostname D2
D2(config)#banner motd # D2, Implement VTP #
D2(config)#spanning-tree mode rapid-pvst
D2(config)#line con 0
D2(config-line)# exec-timeout 0 0
D2(config-line)# logging synchronous
D2(config-line)# exit
D2(config)#interface range e0/0-2
D2(config-if-range)# shutdown
D2(config-if-range)# switchport trunk encapsulation dot1q
D2(config-if-range)# switchport mode trunk
D2(config-if-range)# no shutdown
D2(config-if-range)# exit
Switch A1
Code:
SW(config)#hostname A1
A1(config)#banner motd # A1, Implement VTP #
A1(config)#spanning-tree mode rapid-pvst
A1(config)#line con 0
A1(config-line)# exec-timeout 0 0
A1(config-line)# logging synchronous
A1(config-line)# exit
A1(config)#interface range e0/0-3
A1(config-if-range)# shutdown
A1(config-if-range)# switchport trunk encapsulation dot1q
A1(config-if-range)# switchport mode trunk
A1(config-if-range)# no shutdown
A1(config-if-range)# exit


PHẦN 2: TRIỂN KHAI VÀ QUAN SÁT VTPv2
Bước 1:
Kiểm tra VTP status

Bước 2: Cấu hình và quan sát VTPv2
Code:
D1(config)#vtp domain forum.vnpro.org
Domain name already set to forum.vnpro.org.
D1(config)#vtp version 2
VTP version is already in V2.
D1(config)#vtp password vnpro
Setting device VTP password to vnpro

Bước 3: Tạo VLAN 2 và access port e0/3 và VLAN 2
Code:
D1(config)#vlan 2
D1(config-vlan)#name VLAN2
D1(config-vlan)#exit
D1(config)#int e0/3
D1(config-if)#switchport mode access
D1(config-if)#switchport access vlan 2
D1(config-if)#no shut
D1(config-if)#end[SIZE=14px][/SIZE]

Lúc này kiểm tra số revision đã tăng lên:


Bước 4: Kiểm tra trên switch D2 và A1 ta sẽ thấy VLAN chưa được đồng bộ xuống vì password chưa được cấu hình trên 2 switch này.

Bước 5: Cấu hình switch D2 và A1 cùng domain, version và password với switch D1.
Code:
D2(config)#vtp domain forum.vnpro.org
Domain name already set to forum.vnpro.org.
D2(config)#vtp version 2
VTP version is already in V2.
D2(config)#vtp password vnpro
Setting device VTP password to vnpro

A1(config)#vtp domain forum.vnpro.org
Domain name already set to forum.vnpro.org.
A1(config)#vtp version 2
VTP version is already in V2.
A1(config)#vtp password vnpro
Setting device VTP password to vnpro
[SIZE=14px][/SIZE]


Lúc này Trên D2 và A1 đã đồng bộ xuống VLAN 2, còn VLAN 2048 sẽ không đồng bộ vì chúng ta đang sử dụng Version 2

Bước 6: Trên A1, ta thực hiện xóa VLAN 2
Code:
[FONT=Courier New]A1# [B]config t[/B][/FONT]
[FONT=Courier New]Enter configuration commands, one per line. End with CNTL/Z.[/FONT]
[FONT=Courier New]A1(config)# [B]no vlan 2[/B][/FONT]
[FONT=Courier New]A1(config)# [B]end[/B][/FONT]
Sau đó kiểm tra trên D1 thì thấy VLAN 2 đã bị xóa, do trên A1 đã đồng bộ ngược lại D1

Bước 7: Trên D1, thực hiện tạo lại VLAN 2 sau đó show lại status trên D1, lúc này số revision trên D1 đã thay đổi.

Bước 8: Trên A1, Chuyển sang mode client; Trên D2 chuyển sang mode transparent.
Code:
[FONT=Courier New]A1# [B]config t[/B][/FONT]
[FONT=Courier New]Enter configuration commands, one per line. End with CNTL/Z.[/FONT]
[FONT=Courier New]A1(config)# [B]vtp mode client[/B][/FONT]
[FONT=Courier New]Setting device to VTP Client mode for VLANS.[/FONT]
[FONT=Courier New]A1(config)# [B]vlan 3[/B][/FONT]
[FONT=Courier New]VTP VLAN configuration not allowed when device is in CLIENT mode.[/FONT]
   
 [SIZE=14px][/SIZE]


Code:
[FONT=Courier New]D2# [B]config t[/B][/FONT]
[FONT=Courier New]Enter configuration commands, one per line. End with CNTL/Z.[/FONT]
[FONT=Courier New]D2(config)# [B]vtp mode transparent[/B][/FONT]
[FONT=Courier New]Setting device to VTP Transparent mode for VLANS.[/FONT]
Lúc này trên D2, revision sẽ được set về 0.

Bước 9: Kiểm tra và thấy trên A1, giờ không thể thêm, xóa, sửa VLAN
Trên D2, thực hiện tạo VLAN 3 và VLAN 1111. Khi đó các VLAN này chỉ có ý nghĩa local trên D2.
Code:
[FONT=Courier New]D2(config)# [B]vlan 3[/B][/FONT]
[FONT=Courier New]D2(config-vlan)# [B]name VLAN3[/B][/FONT]
[FONT=Courier New]D2(config-vlan)# [B]exit[/B]
D2(config)# [B]vlan 1111[/B][/FONT]
[FONT=Courier New]D2(config-vlan)# [B]name VLAN1111[/B][/FONT]
[FONT=Courier New]D2(config-vlan)# [B]end[/B][/FONT]
Bước 10: Trên D1, thực hiện tạo VLAN 4, lúc này kiểm tra trên A1 sẽ thấy VLAN 4 được đồng bộ từ D1. Trên D2 sẽ không thấy VLAN4.
Code:
[FONT=Courier New]D1(config)#[/FONT]
[FONT=Courier New]D1(config)# [B]vlan 4[/B][/FONT]
[FONT=Courier New]D1(config-vlan)# [B]name VLAN4[/B][/FONT]
[FONT=Courier New]D1(config-vlan)# [B]end[/B][/FONT]
PHẦN 3: TRIỂN KHAI VÀ QUAN SÁT VTPv3
Bước 1:
Trên switch D1, chuyển sang VTP version 3.

Code:
[FONT=Courier New]D1# [B]config t[/B][/FONT]
[FONT=Courier New]Enter configuration commands, one per line. End with CNTL/Z.[/FONT]
[FONT=Courier New]D1(config)# [B]vtp version 3[/B][/FONT]
*Jul 16 15:17:17.215: %SW_VLAN-6-OLD_CONFIG_FILE_READ: Old version 2 VLAN configuration file detected and read OK. Version 3
files will be written in the future.
sau đó show lại status:

Bước 2: Thực hiện tạo các VLAN 5, 6, D1 sẽ không cho phép tạo vì primary server đang trống:
Primary ID : 0000.0000.0000
Code:
D1(config)#vlan 5
VTP VLAN configuration not allowed when device is not the primary server for vlan database.
D1(config)#vlan 6
VTP VLAN configuration not allowed when device is not the primary server for vlan database.
Bước 3: trong mode privileged EXEC, thực hiện lệnh: vtp primary vlan
Code:
D1#vtp primary vlan
Code:
This system is becoming primary server for feature vlan
No conflicting VTP3 devices found.
Do you want to continue? [confirm]
D1#
*Jul 16 15:25:14.378: %SW_VLAN-4-VTP_PRIMARY_SERVER_CHG: aabb.cc00.1000 has become the primary server for the VLAN VTP feature
Lúc này show vtp status ta sẽ thấy dòng: Primary ID : aabb.cc00.1000
D1 đã trở thành primary server cho VLAN VTP.

Bước 4: Tạo các VLAN 6, 7, 8, 9 và VLAN 2600 tên HACKED
Code:
D1#sh vlan brief

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active
2 VLAN2 active Et0/3
4 VLAN4 active
6 VLAN6 active
7 VLAN7 active
8 VLAN8 active
9 VLAN9 active
1002 fddi-default act/unsup
1003 trcrf-default act/unsup
1004 fddinet-default act/unsup
1005 trbrf-default act/unsup
2048 VLAN2048 active
2600 HACKED active
Bước 5: Trên A1, kiểm tra VLAN, các VLAN 6, 7, 8, 9 vừa tạo sẽ được thấy trên A1 ngoại trừ VLAN 2600. Do A1 đang chạy VTPv2

Bước 6: Trên D2 và A1 chuyển sang VTPv3
Code:
[B]D2(config)#vtp version 3[/B]
D2(config)#
*Jul 16 15:40:13.044: %SW_VLAN-6-OLD_CONFIG_FILE_READ: Old version 2 VLAN configuration file detected and read OK. Version 3
files will be written in the future.
[B]A1(config)#vtp version 3[/B]
A1(config)#
*Jul 16 15:40:30.601: %SW_VLAN-6-OLD_CONFIG_FILE_READ: Old version 2 VLAN configuration file detected and read OK. Version 3
files will be written in the future.
Bước 7: Kiểm tra trên A1, lúc này Extended VLAN 2600 HACKED đã xuất hiện do đổi sang VTPv3

Trên D2, do chạy VTP mode transparent nên không đồng bộ VLAN nào từ A1.

Tác giả,

Võ Văn Kết
VnPro's Instructor.
Working...
X