CCNA Lab 17: Cấu Hình VTP Cơ Bản
Bài trước bạn có tìm hiểu về cấu hình VLAN. Để cấu hình cho VLAN, bạn phải thực hiện tạo VLAN trên từng Switch. Ví dụ,bạn tạo VLAN 10 có 2 port trên Switch1 và 2 port trên Switch2, vậy thì trên cả hai Switch này đều phải có VLAN 10. Đều đó thật bất tiện khi 2 switch này nằm ở hai vị trí khác nhau. Giao thức VTP sẽ giúp chúng ta khắc phục nhược điểm đó. VTP có 3 chế độ: Server (được phép cấu hình), Client (nhận và cập nhật cấu hình), Transparent (chuyển tiếp cấu hình). Bài lab này sẽ hướng dẫn các bạn thực hiện cấu hình cho VTP.
Sơ đồ mạng
Bảng IP
Bảng phân bố VLAN
Chuẩn bị
- Nếu bạn nào có xem bài Lab số 15, thì có thể sử dụng mô hình bài đó để thực hành lại. Nhưng trước tiên, bạn hãy xóa bỏ cấu hình cũ.
- Bạn cần disable hết tất cả các port trên các switch, và sau đó enable lại những port nào cần thiết mà thôi.
- Cấu hình địa chỉ IP cho các PC theo mô hình và bảng IP ở trên. Sau đó hãy kiểm tra giao tiếp giữa các PC này là không thành công.
Cấu hình VTP
1. Đầu tiên, hãy kiểm tra trạng thái VTP của các Switch bây giờ đang là Server
S1#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 255
Number of existing VLANs : 5
VTP Operating Mode : Server
VTP Domain Name :
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0×57 0xCD 0×40 0×65 0×63 0×59 0×47 0xBD
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 0.0.0.0 (no valid interface found)
S2#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 255
Number of existing VLANs : 5
VTP Operating Mode : Server
VTP Domain Name :
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0×57 0xCD 0×40 0×65 0×63 0×59 0×47 0xBD
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 0.0.0.0 (no valid interface found)
S3#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 255
Number of existing VLANs : 5
VTP Operating Mode : Server
VTP Domain Name :
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0×57 0xCD 0×40 0×65 0×63 0×59 0×47 0xBD
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
2. Cấu hình VTP với domain name là Lab4 và có VTP password là cisco trên cả 3 switch. Thiết lập S1 là server, S2 là client, và S3 là transparent.
S1(config)#vtp mode server
Device mode already VTP SERVER.
S1(config)#vtp domain Lab4
Changing VTP domain name from NULL to Lab4
S1(config)#vtp password cisco
Setting device VLAN database password to cisco
S1(config)#end
S2(config)#vtp mode client
Setting device to VTP CLIENT mode
S2(config)#vtp domain Lab4
Changing VTP domain name from NULL to Lab4
S2(config)#vtp password cisco
Setting device VLAN database password to cisco
S2(config)#end
S3(config)#vtp mode transparent
Setting device to VTP TRANSPARENT mode.
S3(config)#vtp domain Lab4
Changing VTP domain name from NULL to Lab4
S3(config)#vtp password cisco
Setting device VLAN database password to cisco
S3(config)#end
3. Cấu hình trunking và native VLAN cho cả ba switch.
S1(config)#interface range fa0/1-5
S1(config-if-range)#switchport mode trunk
S1(config-if-range)#switchport trunk native vlan 99
S1(config-if-range)#no shutdown
S1(config-if-range)#end
S2(config)# interface range fa0/1-5
S2(config-if-range)#switchport mode trunk
S2(config-if-range)#switchport trunk native vlan 99
S2(config-if-range)#no shutdown
S2(config-if-range)#end
S3(config)# interface range fa0/1-5
S3(config-if-range)#switchport mode trunk
S3(config-if-range)#switchport trunk native vlan 99
S3(config-if-range)#no shutdown
S3(config-if-range)#end
4. Cấu hình port security trên S2 and S3 ở tần Access. Cấu hình ports fa0/6, fa0/11, và fa0/18 chấp nhận học địa chỉ MAC tự động, và sau đó đặt nó ở chế độ cố định (sticky)
S2(config)#interface fa0/6
S2(config-if)#switchport port-security
S2(config-if)#switchport port-security maximum 1
S2(config-if)#switchport port-security mac-address sticky
S2(config-if)#interface fa0/11
S2(config-if)#switchport port-security
S2(config-if)#switchport port-security maximum 1
S2(config-if)#switchport port-security mac-address sticky
S2(config-if)#interface fa0/18
S2(config-if)#switchport port-security
S2(config-if)#switchport port-security maximum 1
S2(config-if)#switchport port-security mac-address sticky
S2(config-if)#end
S3(config)#interface fa0/6
S3(config-if)#switchport port-security
S3(config-if)#switchport port-security maximum 1
S3(config-if)#switchport port-security mac-address sticky
S3(config-if)#interface fa0/11
S3(config-if)#switchport port-security
S3(config-if)#switchport port-security maximum 1
S3(config-if)#switchport port-security mac-address sticky
S3(config-if)#interface fa0/18
S3(config-if)#switchport port-security
S3(config-if)#switchport port-security maximum 1
S3(config-if)#switchport port-security mac-address sticky
S3(config-if)#end
5. Cấu hình VLANs trên VTP server.
Dưới đây là những VLAN chúng ta cần cấu hình.
• VLAN 99 (management)
• VLAN 10 (faculty/staff)
• VLAN 20 (students)
• VLAN 30 (guest)
S1(config)#vlan 99
S1(config-vlan)#name management
S1(config-vlan)#exit
S1(config)#vlan 10
S1(config-vlan)#name faculty/staff
S1(config-vlan)#exit
S1(config)#vlan 20
S1(config-vlan)#name students
S1(config-vlan)#exit
S1(config)#vlan 30
S1(config-vlan)#name guest
S1(config-vlan)#exit
6. Kiểm tra các VLAN đã được tạo như thế nào.
Trên Switch2, chúng ta thấy xuất hiện các VLAN tương ứng đã cấu hình trên server.
S2#show vlan brief
VLAN Name Status Ports
—————————– ——— ——————————– —-
1 default active Fa0/1, Fa0/2, Fa0/4, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12,Fa0/13
Fa0/14, Fa0/15, Fa0/16,Fa0/17
Fa0/18, Fa0/19, Fa0/20,Fa0/21
Fa0/22, Fa0/23, Fa0/24, Gi0/1
Gi0/2
10 faculty/staff active
20 students active
30 guest active
99 management active
Trên Switch3 thì không xuất hiện VLAN này hết.
S3#show vlan brief
VLAN Name Status Ports——————————————————————————————
1 default active Fa0/1, Fa0/2, Fa0/4, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12,Fa0/13
Fa0/14, Fa0/15, Fa0/16,Fa0/17
Fa0/18, Fa0/19, Fa0/20,Fa0/21
Fa0/22, Fa0/23, Fa0/24, Gi0/1
Gi0/2
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
7. Test thử kết quả:
Thực hiện PING qua lại giữa các máy tính. Kết quả là có thể ping thành công
8. Tạo VLAN trên Switch 2. Kết quả, bạn không thể tạo, vì đây là Client.
S2(config)#vlan 88
%VTP VLAN configuration not allowed when device is in CLIENT mode.
Đến đây thì việc cấu hình VTP cơ bản hoàn thành. Đã có 1 switch làm server, client…
9. Chúng ta phải cấu hình VLAN bằng thủ công cho Switch 3
S3(config)#vlan 99
S3(config-vlan)#name management
S3(config-vlan)#exit
S3(config)#vlan 10
S3(config-vlan)#name faculty/staff
S3(config-vlan)#exit
S3(config)#vlan 20
S3(config-vlan)#name students
S3(config-vlan)#exit
S3(config)#vlan 30
S3(config-vlan)#name guest
S3(config-vlan)#exit
10. Đặt IP cho VLAN 99 – đây là VLAN VTP.
S1(config)#interface vlan 99
S1(config-if)#ip address 172.17.99.11 255.255.255.0
S1(config-if)#no shutdown
S2(config)#interface vlan 99
S2(config-if)#ip address 172.17.99.12 255.255.255.0
S2(config-if)#no shutdown
S3(config)#interface vlan 99
S3(config-if)#ip address 172.17.99.13 255.255.255.0
S3(config-if)#no shutdown
11. Kiểm tra quá trình ping qua lại giữa các VLAN 99 trên các switch.
Từ Switch1 chúng ta có thể ping qua S2 nhưng không ping qua được siwtch 3
S1#ping 172.17.99.12
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.17.99.12, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/4/10 msS1#ping 172.17.99.13
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.17.99.13, timeout is 2 seconds:
…..
Success rate is 0 percent (0/5)
Từ Switch2, có thể ping qua switch 3, nhưng không ping qua được switch 1.
S2#ping 172.17.99.11
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.17.99.11, timeout is 2 seconds:
…..
Success rate is 0 percent (0/5)S2#ping 172.17.99.13
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.17.99.13, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 30/38/40 ms
Từ Switch 3, bạn có thể ping qua Switch 2, nhưng không ping được qua switch 1.
S3#ping 172.17.99.11
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.17.99.11, timeout is 2 seconds:
…..
Success rate is 0 percent (0/5)S3#ping 172.17.99.12
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.17.99.12, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/36/40 ms
-
chauthanhnhon
-
ha
-
Đinh Chí Thành
-
-
ha
-
Đinh Chí Thành
-
ha
-
Đinh Chí Thành
-
-
-
Đinh Chí Thành
-
ha
-
-
Đinh Chí Thành
-
-
phuc vu hong
-
info Bean
-
dctuit
-
-
http://www.facebook.com/bap.tiencoi Bap Tien Coi