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

Gởi Ðề Tài Mới  Gửi trả lời
 
Công Cụ Xếp Bài
Tuổi 11-08-2009, 10:46 PM   #1
adminphuong
Administrator
 
Avatar của adminphuong
 
Gia nhập: Jul 2009
Trả Lời: 152
Cấu hình định tuyến giữa các VLAN
Định tuyến giữa các VLAN



Cấu hình đầy đủ
2900XL switch
!
hostname 2900xl
!
interface FastEthernet0/1
switchport mode trunk
!
!-- Nếu bạn cấu hình trunking theo chuẩn 802.1q thì phải cấu hình trên cổng giao tiếp Fa0/1 là:
!-- interface FastEthernet0/1
!-- switchport trunk encapsulation dot1q
!-- switchport mode trunk

!
interface FastEthernet0/2
switchport access vlan 2
!
interface VLAN1
ip address 10.10.10.2 255.255.255.0
no ip directed-broadcast
no ip route-cache
!
ip default-gateway 10.10.10.1
!
end


Router 2600 Series:

!
hostname c2600
!
no logging console
enable password mysecret
!
ip subnet-zero
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation isl 1
ip address 10.10.10.1 255.255.255.0

!-- Nếu cấu hình theo chuẩn 802.1Q thì sẽ cấu hình trên cổng giao tiếp F0/0.1 là:
!-- interface FastEthernet0/0.1
!-- encapsulation dot1Q 1 native
!-- ip address 10.10.10.1 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation isl 2
ip address 10.10.11.1 255.255.255.0
!
! Nếu cấu hình theo chuẩn 802.1Q thì sẽ cấu hình trên cổng giao tiếp F0/0.2 là:
!-- interface FastEthernet0/0.2
!-- encapsulation dot1Q 2
!-- ip address 10.10.11.1 255.255.255.0
!
end

Các bước thực hiện
Switch2900
1. Vào chế độ privileged mode, cấu hình mật khẩu telnet cho switch

switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)#hostname 2900xl
2900xl(config)#enable password mysecret
2900xl(config)#line vty 0 4
2900xl(config-line)#login
2900xl(config-line)#password mysecret
2900xl(config-line)#exit
2900xl(config)#no logging console
2900xl(config)#^Z

2. Gán địa chỉ IP và default gateway cho VLAN1 cho tiện việc quản trị

2900xl#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
2900xl(config)#int vlan 1
2900xl(config-if)#ip address 10.10.10.2 255.255.255.0
2900xl(config-if)#exit
2900xl(config)#ip default-gateway 10.10.10.1
2900xl(config)#end

3. Thiết lập vtp transparent mode

2900xl#vlan database
2900xl(vlan)#vtp transparent
Setting device to VTP TRANSPARENT mode.

4. Tạo mới VLAN2 trong cơ sở dữ liệu VLAN của switch. VLAN1 mặc định đã có sẵn

2900xl(vlan)#vlan 2
VLAN 2 added:
Name: VLAN0002
2900xl(vlan)#exit
APPLY completed.
Exiting....

5. Kích hoạt trunking trên cổng giao tiếp Fa0/1

2900xl#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
2900xl(config)#int fastEthernet 0/1
2900xl(config-if)#switchport mode trunk

6. Encapsulation trunking bằng sử dụng isl hay dot1q

2900xl(config-if)#switchport trunk encapsulation isl
(2900xl(config-if)#switchport trunk encapsulation dot1q)

+ Trong trường hợp switch 2950 chỉ hỗ trợ 802.1q encapsulation và tự động kích hoạt khi thiết lập trunking cho cổng giao tiếp này bằng cách sử dụng lệnh switchport mode trunk.
+ Trên switch 2900xl, mặc định native VLAN là 1, bạn có thể thay đổi native VLAN bằng lệnh: 2900xl(config-if)#switchport trunk native vlan <vlan ID>

7. Cho phép tất cả các VLAN được chuyển qua kết nối trunk:

2900xl(config-if)#switchport trunk allowed vlan all
2900xl(config-if)#exit

8. Gán cổng Fa0/2 và VLAN 2.

2900xl(config)#int fastEthernet 0/2
2900xl(config-if)#switchport access vlan 2
2900xl(config-if)#spanning-tree portfast
2900xl(config-if)#exit

+ Cổng fa0/3 mặc định đã thuộc VLAN1 nên không cần thực hiện apply vào VLAN 1

9. Lưu cấu hình

2900xl#write memory
Building configuration...
2900xl#

Router 2600 Series
1. Vào privileged mode cấu hình mật khẩu telnet cho router

Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname c2600

c2600(config)#enable password mysecret
c2600(config)#line vty 0 4
c2600(config-line)#login
c2600(config-line)#password mysecret
c2600(config-line)#exit
c2600(config)#no logging console
c2600(config)#^Z

c2600#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.

2. Chọn cổng fa0/0 để cấu hình trunk,

c2600(config)#int fastEthernet 0/0
c2600(config-if)#no shut
c2600(config-if)#exit

3. Kích hoạt trunking trên sub-interface Fa0/0.1 và encapsulation bằng isl

c2600(config)#int fastEthernet 0/0.1
c2600(config-subif)#encapsulation isl 1

+ Trong trường hợp dùng giao thức dot1q, bạn cần đảm bảo native VLAN ở hai đầu kết nối trunk là giống nhau (mặc định trên switch 2900XL là VLAN 1).
c2600(config-subif)#encapsulation dot1Q 1 ?
native Make this is native vlan
<cr>
c2600(config-subif)#encapsulation dot1Q 1 native

4. Cấu hình thông tin lớp 3 cho sub-interface Fa0/0.1

c2600(config-subif)#ip address 10.10.10.1 255.255.255.0
c2600(config-subif)#exit

5. Kích hoạt trunking trên sub-interface Fa0/0.2 và encapsulation bằng isl

c2600(config)#int fastEthernet 0/0.2
c2600(config-subif)#encapsulation isl 2
(hay bằng dot1q: c2600(config-subif)#encapsulation dot1Q 2)

6. Cấu hình thông tin Layer 3 cho sub-interface Fa0/0.2

c2600(config-subif)#ip address 10.10.11.1 255.255.255.0
c2600(config-subif)#exit
c2600(config)#^Z

7. Lưu cấu hình

c2600#write memory
Building configuration...
[OK]
c2600#

Kiểm tra

Catalyst 2900xl Switch
1. Dùng lệnh show int FastEthernet <module/port> switchport để kiểm tra trạng thái port và đảm bảo native VLAN ở cả 2 đầu kết nối trunk là giống nhau:

2900xl#show int fastEthernet 0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: isl
Operational Trunking Encapsulation: isl
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1,2
Pruning VLANs Enabled: 2-1001

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

Trong trường hợp 802.1q trunking, output sẽ như sau

2900xl#show int fastEthernet 0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1,2
Pruning VLANs Enabled: 2-1001

Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none

2. Dùng lệnh show vlan để kiểm tra các cổng của switch (ports) xem có thuộc về đúng VLAN. Trong bài này, ta chú ý chỉ có cổng Fa0/2 là thuộc về VLAN 2, các cổng còn lại của switch thuộc về VLAN 1

2900xl#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/3, Fa0/4, Fa0/5, Fa0/6,
Fa0/7, Fa0/8, Fa0/9, Fa0/10,
Fa0/11, Fa0/12, Gi0/1, Gi0/2
2 VLAN0002 active Fa0/2
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
...

3. Lệnh show vtp status dùng để kiểm tra VLAN trunking protocol (VTP) trên switch. Trong bài lab này, ta dùng transparent mode.

2900xl#show vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 254
Number of existing VLANs : 6
VTP Operating Mode : Transparent
VTP Domain Name :
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xC3 0x71 0xF9 0x77 0x2B 0xAC 0x5C 0x97
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00

Cisco 2600 Router

1. Lệnh show vlan cho biết thông tin Layer2/Layer3 được cấu hình cho mỗi VLAN:

c2600#show vlan

Virtual LAN ID: 1 (Inter Switch Link Encapsulation)

vLAN Trunk Interface: FastEthernet0/0.1
Protocols Configured: Address: Received: Transmitted:
IP 10.10.10.1 40 38

Virtual LAN ID: 2 (Inter Switch Link Encapsulation)

vLAN Trunk Interface: FastEthernet0/0.2
Protocols Configured: Address: Received: Transmitted:
IP 10.10.11.1 9 9

Đối với 802.1Q trunking, output có dạng sau:

c2600#show vlan
Virtual LAN ID: 1 (IEEE 802.1Q Encapsulation)
vLAN Trunk Interface: FastEthernet0/0.1
This is configured as native Vlan for the following interface(s): FastEthernet0/0
Protocols Configured: Address: Received: Transmitted:
IP 10.10.10.1 0 2
Virtual LAN ID: 2 (IEEE 802.1Q Encapsulation)
vLAN Trunk Interface: FastEthernet0/0.2
Protocols Configured: Address: Received: Transmitted:
IP 10.10.11.1 42 19

Đối với Cisco IOS version trước 12.1(3)T, output có dạng sau:

c2600#show vlan
Virtual LAN ID: 2 (IEEE 802.1Q Encapsulation)
vLAN Trunk Interface: FastEthernet0/0.2
Protocols Configured: Address: Received: Transmitted:
IP 10.10.11.1 6 4

2. Kiểm tra trạng thái các cổng bằng lệnh show interface:

c2600#show interfaces fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
Hardware is AmdFE, address is 0003.e36f.41e0 (bia 0003.e36f.41e0)
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s, 100BaseTX/FX
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:07, output hang never
Last clearing of "show interface" counters never
Queueing strategy: fifo
...

c2600#show interfaces fastEthernet 0/0.1
FastEthernet0/0.1 is up, line protocol is up
Hardware is AmdFE, address is 0003.e36f.41e0 (bia 0003.e36f.41e0)
Internet address is 10.10.10.1/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ISL Virtual LAN, Color 1.
ARP type: ARPA, ARP Timeout 04:00:00
c2600#show interfaces fastEthernet 0/0.2
FastEthernet0/0.2 is up, line protocol is up
Hardware is AmdFE, address is 0003.e36f.41e0 (bia 0003.e36f.41e0)
Internet address is 10.10.11.1/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ISL Virtual LAN, Color 2.
ARP type: ARPA, ARP Timeout 04:00:00

Đối với 802.1Q trunking, output có dạng:

c2600#show interfaces fastEthernet 0/0.1

FastEthernet0/0.1 is up, line protocol is up
Hardware is AmdFE, address is 0003.e36f.41e0 (bia 0003.e36f.41e0)
Internet address is 10.10.10.1/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation 802.1Q Virtual LAN, Vlan ID 1.
ARP type: ARPA, ARP Timeout 04:00:00
c2600#show interfaces fastEthernet 0/0.2
FastEthernet0/0.2 is up, line protocol is up
Hardware is AmdFE, address is 0003.e36f.41e0 (bia 0003.e36f.41e0)
Internet address is 10.10.11.1/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation 802.1Q Virtual LAN, Vlan ID 2.
ARP type: ARPA, ARP Timeout 04:00:00
__________________
Theo: Viet Professionals Co. Ltd. VnPro ®

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


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à 03:26 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.