Chia Sẽ Kinh Nghiệm Về IT



Tìm Kiếm Với Google
-


7. VLAN VLAN trunking protocol, VLAN Configure, verify, and troubleshoot RSTP operation

 
 
Công Cụ Xếp Bài
Tuổi 11-08-2009, 10:47 PM   #1
adminphuong
Administrator
 
Avatar của adminphuong
 
Gia nhập: Jul 2009
Trả Lời: 152
VLAN Trunking
VLAN Trunking




Mô tả
–VLAN cho phép kết hợp các port trên switch thành các nhóm để giảm lưu lượng broadcast trên mạng. Các lưu lượng này được giới hạn trong phạm vi được xác định bởi VLAN.
–Kết nối trunk là liên kết point-to-point giữa các port trên switch với router hoặc với switch khác. Kết nối trunk sẽ vận chuyển thông tin của nhiều VLAN thông qua 1 liên kết đơn và cho phép mở rộng VLAN trên hệ thống mạng.
–VTP (VLAN Trunking Protocol) là giao thức hoạt động ở Layer 2 trong mô hình OSI. VTP giúp cho việc cấu hình VLAN luôn đồng nhất khi thêm, xoá, sửa thông tin về VLAN trong hệ thống mạng.
–Bài thực hành này mô tả cách thức tạo trunk giữa 2 switch. Trunking được cấu hình trên port F0/1 của hai switch. Ta nên dùng cáp chéo để nối hai port này.

Cấu hình
Switch DL1
!
hostname DL1
!
enable password cisco
!
interface FastEthernet0/1
switchport trunk encapsulation isl
switchport mode trunk
!
interface FastEthernet0/4
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/5
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/6
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/7
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/8
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/9
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/10
switchport access vlan 30
switchport mode access
!
interface FastEthernet0/11
switchport access vlan 30
switchport mode access
!
interface FastEthernet0/12
switchport access vlan 30
switchport mode access
!
interface Vlan1
ip address 192.168.1.2 255.255.255.0
!
interface Vlan10
ip address 192.168.10.2 255.255.255.0
!
interface Vlan20
ip address 192.168.20.2 255.255.255.0
!
interface Vlan30
ip address 192.168.30.2 255.255.255.0
!
line vty 0 4
password cisco
login
line vty 5 15
password cisco
login
!
end


SwitchAL1
!
hostname AL1
!
enable password cisco
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/4
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/5
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/6
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/7
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/8
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/9
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/10
switchport access vlan 30
switchport mode access
!
interface FastEthernet0/11
switchport access vlan 30
switchport mode access
!
interface FastEthernet0/12
switchport access vlan 30
switchport mode access
!
interface VLAN1
ip address 192.168.1.3 255.255.255.0
no ip directed-broadcast
no ip route-cache
!
line vty 0 4
mật khẩu cisco
login
line vty 5 15
mật khẩu cisco
login
!
end

Thực hiện
Cấu hình trên Switch DL1 làm VTP Server
1. Đặt hostname, mật khẩu và cấu hình cổng vlan trên DL1:

Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname DL1
DL1(config)#enable password cisco
DL1(config)#line vty 0 15
DL1(config-line)#password cisco
DL1(config-line)#login
DL1(config-line)#exit
DL1(config)#int vlan 1
DL1(config-if)#ip address 192.168.1.3 255.255.255.0
DL1(config-if)#end
DL1#

2. Thiết lập VTP domain là VNPRO, VTP mode là SERVER, tạo ra các VLAN 10 (SALES), 20 (ACCOUNTING), 30 (ENGINEERING)

DL1#vlan database
DL1(vlan)#vtp server  Thiết lập chế độ VTP server mode
DL1(vlan)#vtp domain VNPRO  đặt switch DL1 vào domain VNPRO
DL1(vlan)#vlan 10 name SALES  Tạo VLAN 10 và đặt tên là SALES
VLAN 10 added:
Name: SALES
DL1(vlan)#vlan 20 name ACCOUNTING
VLAN 20 added:
Name: ACCOUNTING
DL1(vlan)#vlan 30 name ENGINEERING
VLAN 30 added:
Name: ENGINEERING
DL1(vlan)#apply  Lưu cấp hình vào file vlan.dat
APPLY completed.
DL1(vlan)#exit
APPLY completed.
Exiting....
DL1#

+ Một switch chỉ thuộc 1 VTP domain
Mặc định switch ở chế độ VTP server mode

3. Kích hoạt trunking trên cổng Fa0/1 và cho phép tất cả các VLAN qua trunk:

DL1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
DL1(config)#int f0/1
DL1(config-if)#switchport mode trunk
DL1(config-if)#switchport trunk encapsulation isl  đóng gói kiểu isl (hoặc dot1q) để đi qua đường trunk
DL1(config-if)#switchport trunk allowed vlan all  Cho phép tất cả các VLAN qua trunk
DL1(config-if)#exit
DL1(config)#

+ Giả sử ta chỉ muốn cho phép các VLAN 10, 20, 30 ta dùng lệnh:
DL1(config-if)#switchport trunk allowed vlan 10
DL1(config-if)#switchport trunk allowed vlan 20
DL1(config-if)#switchport trunk allowed vlan 30
4. Gán các port vào VLAN tương ứng

DL1(config)#int f0/4
DL1(config-if)#switchport mode access  Cấu hình cổng ở access mode
DL1(config-if)#switchport access vlan 10  cấu hình cổng vào vlan 10
!–– Mỗi access port chỉ phục vụ cho một VLAN
DL1(config-if)#int f0/5
DL1(config-if)#switchport mode access
DL1(config-if)#switchport access vlan 10
DL1(config-if)#int f0/6
DL1(config-if)#switchport mode access
DL1(config-if)#switchport access vlan 10

DL1(config)#int f0/7
DL1(config-if)#switchport mode access
DL1(config-if)#switchport access vlan 20
DL1(config-if)#int f0/8
DL1(config-if)#switchport mode access
DL1(config-if)#switchport access vlan 20
DL1(config-if)#int f0/9
DL1(config-if)#switchport mode access
DL1(config-if)#switchport access vlan 20

DL1(config)#int f0/10
DL1(config-if)#switchport mode access
DL1(config-if)#switchport access vlan 30
DL1(config-if)#int f0/11
DL1(config-if)#switchport mode access
DL1(config-if)#switchport access vlan 30
DL1(config-if)#int f0/12
DL1(config-if)#switchport mode access
DL1(config-if)#switchport access vlan 30

5. Xem cấu hình vừa thực hiện

DL1#sh vlan brief

VLAN Name Status Ports
---- -------------------------------- --------- ------------------------------
1 default active Fa0/2, Fa0/3, 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 SALES active Fa0/4, Fa0/5, Fa0/6
20 ACCOUNTING active Fa0/7, Fa0/8, Fa0/9
30 ENGINEERING active Fa0/10, Fa0/11, Fa0/12
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
DL1#

Cấu hình trên Switch AL1 làm VTP Client

1. Đặt hostname, mật khẩu và cấu hình management vlan trên DL1:

Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname AL1
AL1(config)#enable mật khẩu cisco
AL1(config)#line vty 0 15
AL1(config-line)#mật khẩu cisco
AL1(config-line)#login
AL1(config-line)#exit
AL1(config)#int vlan 1
AL1(config-if)#ip address 192.168.1.2 255.255.255.0
AL1(config-if)#end
AL1#

2. Thiết lập VTP domain là VNPRO, VTP mode là CLIENT

AL1#vlan database
AL1(vlan)#vtp client
AL1(vlan)#vtp domain VNPRO
AL1(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
AL1#

3. Kích hoạt trunking trên cổng Fa0/1 và cho phép tất cả các VLAN qua trunk:

AL1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
AL1(config)#int f0/1
AL1(config-if)#switchport mode trunk
AL1(config-if)#switchport trunk encapsulation isl  đóng gói kiểu isl (hoặc dot1q) để đi qua đường trunk
AL1(config-if)#switchport trunk allowed vlan all  Cho phép tất cả các VLAN qua trunk
AL1(config-if)#exit
AL1(config)#

4. Áp đặt các port chỉ định vào VLAN tương ứng

AL1(config)#int f0/4
AL1(config-if)#switchport mode access
AL1(config-if)#switchport access vlan 10
AL1(config-if)#int f0/5
AL1(config-if)#switchport mode access
AL1(config-if)#switchport access vlan 10
AL1(config-if)#int f0/6
AL1(config-if)#switchport mode access
AL1(config-if)#switchport access vlan 10

AL1(config)#int f0/7
AL1(config-if)#switchport mode access
AL1(config-if)#switchport access vlan 20
AL1(config-if)#int f0/8
AL1(config-if)#switchport mode access
AL1(config-if)#switchport access vlan 20
AL1(config-if)#int f0/9
AL1(config-if)#switchport mode access
AL1(config-if)#switchport access vlan 20

AL1(config)#int f0/10
AL1(config-if)#switchport mode access
AL1(config-if)#switchport access vlan 30
AL1(config-if)#int f0/11
AL1(config-if)#switchport mode access
AL1(config-if)#switchport access vlan 30
AL1(config-if)#int f0/12
AL1(config-if)#switchport mode access
AL1(config-if)#switchport access vlan 30

5. Xem cấu hình vừa thực hiện

AL1#sh vlan
VLAN Name Status Ports
---- -------------------------------- --------- ---------------------------
1 default active Fa0/2, Fa0/3
10 SALES active Fa0/4, Fa0/5, Fa0/6
20 ACCOUNTING active Fa0/7, Fa0/8, Fa0/9
30 ENGINEERING active Fa0/10, Fa0/11, Fa0/12
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
30 enet 100030 1500 - - - - - 0 0
1002 fddi 101002 1500 - 0 - - - 0 0
1003 tr 101003 1500 - 0 - - srb 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
AL1#

Kiểm tra
1. Kiểm tra cổng Fa0/1 đã hoạt động chưa

AL1#show int f0/1
FastEthernet0/1 is up, line protocol is up  Cổng đã hoạt động
Hardware is Fast Ethernet, address is 00b0.64c9.cd41 (bia 00b0.64c9.cd41)
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive not set
Auto-duplex (Full), Auto Speed (100), 100BaseTX/FX
ARP type: ARPA, ARP Timeout 04:00:00
...

2. Kiểm tra cổng Fa0/1 đã kích hoạt trunking và đúng kiểu encapsulation chưa

AL1#sh int f0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative mode: trunk
Operational Mode: trunk  Cổng F0/1 hoạt động ở chế độ trunk mode
Administrative Trunking Encapsulation: isl
Operational Trunking Encapsulation: isl  Kiểu đóng gói là isl
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL  Cho phép tất cả các VLAN qua kết nối trunk
Trunking VLANs Active: 1,10,20,30  Các VLAN hiện hành đang hoạt động
Pruning VLANs Enabled: 2-1001

Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none
Appliance trust: none
AL1#

3. Kiểm tra revision number trên client có đồng bộ với server chưa

AL1#sh vtp status
VTP Version : 2
Configuration Revision : 2  số revision number
Maximum VLANs supported locally : 68
Number of existing VLANs : 8
VTP Operating Mode : Client  Switch hoạt động ở chế độ client
VTP Domain Name : VNPRO  Switch thuộc domain VNPRO
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xDC 0x45 0xB2 0xD9 0x5B 0x7A 0x50 0x19
Configuration last modified by 192.168.1.2 at 3-1-93 01:54:06
AL1#

DL1#sh vtp status
VTP Version : 2
Configuration Revision : 2
Maximum VLANs supported locally : 1005
Number of existing VLANs : 8
VTP Operating Mode : Server
VTP Domain Name : VNPRO
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xDC 0x45 0xB2 0xD9 0x5B 0x7A 0x50 0x19
Configuration last modified by 192.168.1.2 at 3-1-93 01:54:06
Local updater ID is 192.168.1.2 on interface Vl1 (lowest numbered VLAN interface
found)
DL1#

+ Revision number là một trong những thông số quan trọng của VTP. Mỗi khi VTP server thay đổi VLAN database thì sẽ tăng giá trị revision lên 1 và thực hiện quảng cáo VLAN database này. Các thiết bị có số revision nhỏ hơn phải chấp nhận VLAN database có số revision lớn hơn.

Nếu VTP server xoá bỏ tất cả các VLAN & có số revision cao nhất thì các thiết bị khác cũng sẽ bị xoá VLAN.

4. Kiểm tra số lần gửi và nhận thông tin trunking

DL1#sh vtp counters
VTP statistics:
Summary advertisements received : 18
Subset advertisements received : 5
Request advertisements received : 1
Summary advertisements transmitted : 12
Subset advertisements transmitted : 2
Request advertisements transmitted : 0
Number of config revision errors : 0
Number of config digest errors : 0
Number of V1 summary errors : 0
VTP pruning statistics:

Trunk Join Transmitted Join Received Summary advts received from
non-pruning-capable device
---------------- ---------------- ---------------- ---------------------------
Fa0/1 0 0 0
DL1#

AL1#sh vtp counters
VTP statistics:
Summary advertisements received : 13
Subset advertisements received : 2
Request advertisements received : 0
Summary advertisements transmitted : 20
Subset advertisements transmitted : 6
Request advertisements transmitted : 1
Number of config revision errors : 0
Number of config digest errors : 0
Number of V1 summary errors : 0

VTP pruning statistics:

Trunk Join Transmitted Join Received Summary advts received from
non-pruning-capable device
---------------- ---------------- ---------------- ---------------------------
Fa0/1 1 0 0
AL1#
__________________
Theo: Viet Professionals Co. Ltd. VnPro ®

adminphuong vắng mặt   Trả lời ngay kèm theo trích dẫn này
 


Công Cụ
Xếp Bài

Quyền Hạn Của Bạn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Hình Cảm xúc đang Mở
[IMG] đang Mở
Mã HTML đang Tắt




Bây giờ là 10:43 PM. Giờ GMT +7



Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.