• 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.

Lab 2-3: Định tuyến giữa các VLAN

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lab 2-3: Định tuyến giữa các VLAN

    Lab 2-3: Đị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
    Last edited by lamkhuongtruongson; 16-10-2014, 05:51 PM.
    Email : vnpro@vnpro.org
    ---------------------------------------------------------------------------------------------------------------
Trung Tâm Tin Học VnPro
149/1D Ung Văn Khiêm P25 Q.Bình thạnh TPHCM
Tel : (08) 35124257 (5 lines)
Fax: (08) 35124314

Home page: http://www.vnpro.vn
Support Forum: http://www.vnpro.org
- Chuyên đào tạo quản trị mạng và hạ tầng Internet
- Phát hành sách chuyên môn
- Tư vấn và tuyển dụng nhân sự IT
- Tư vấn thiết kế và hỗ trợ kỹ thuật hệ thống mạng

Network channel: http://www.dancisco.com
Blog: http://www.vnpro.org/blog

  • #2
    Admin cho em hoi tí, em cũng đang dùng Router cisco c2600 nhưng vào không thấy lệnh ecapsulation trong sub-interface và cũng không thấy lênh show vlan đâu hết. Em cảm ơn nhiều.

    Comment


    • #3
      hi

      router 2600 của bạn phải có cổng Fast Ethernet thì mới cấu hình trunking được. Thêm vào đó, bạn cần có hệ điều hành IPPLUS (trong filename của hệ điều hành có ký tự "s").
      Đặng Quang Minh, CCIEx2#11897 (Enterprise Infrastructure, Wireless), DEVNET, CCSI#31417

      Email : dangquangminh@vnpro.org
      https://www.facebook.com/groups/vietprofessional/

      Comment


      • #4
        Hi Anh Minh,

        như vậy mình có the update IOS đựoc ko? Cách update như thế nào, thx anh.

        KhoaTran
        Quyet khong yeu de tien ma tieu
        Song co don cho gai no them

        Comment


        • #5
          Upload thì dùng TFTP-server. Bạn xem một qui trình ở đây:

          Dành cho các thảo luận lab scenario trong tập sách CCNA LabPro do Nhà Xuất Bản Trẻ phát hành
          Đặng Quang Minh, CCIEx2#11897 (Enterprise Infrastructure, Wireless), DEVNET, CCSI#31417

          Email : dangquangminh@vnpro.org
          https://www.facebook.com/groups/vietprofessional/

          Comment


          • #6
            no ip directed-broadcast
            no ip route-cache
            cho em hoi 2 cái lệnh này có ý nghĩa gì đc ko ?

            Comment


            • #7
              Bài này có ích quá đi, thank mọi người. Từ bài này em đã phát sinh ra trường hợp
              Nếu em thay 2 PC bởi 2 ROUTER thì cấu hình như vậy ko được
              Vậy anh em pro giúp đỡ giùm mình với
              Thanks

              Comment


              • #8
                có cái topo mạng thì hay quá !

                Comment


                • #9
                  Cái hình vẽ sơ đồ mạng không thấy đâu hết, admin up hình sơ đồ cho mọi người thấy đi. Bài viết hay

                  Comment


                  • #10
                    Originally posted by phatnt00 View Post
                    Cái hình vẽ sơ đồ mạng không thấy đâu hết, admin up hình sơ đồ cho mọi người thấy đi. Bài viết hay
                    Mình đã up lại sơ đồ mạng, cám ơn bạn đã góp ý
                    Cuộc sống có bao lâu mà hững hờ

                    Comment


                    • #11
                      Originally posted by dangquangminh View Post
                      hi

                      router 2600 của bạn phải có cổng Fast Ethernet thì mới cấu hình trunking được. Thêm vào đó, bạn cần có hệ điều hành IPPLUS (trong filename của hệ điều hành có ký tự "s").
                      Router nào cũn có cổng FE mà???

                      Comment


                      • #12
                        bài viết trên từ năm 2003. Lúc đó các router chỉ có các cổng tốc độ 10Mbps.

                        ngày nay thì các router có cổng 1Gbps hoặc 10Gbps. Cổng FastEthernet (100Mbps) thì gần như tối thiểu router nào cũng có.

                        Chúc em vui vẻ, mong em tiếp tục ủng hộ diễn đàn.
                        Đặng Quang Minh, CCIEx2#11897 (Enterprise Infrastructure, Wireless), DEVNET, CCSI#31417

                        Email : dangquangminh@vnpro.org
                        https://www.facebook.com/groups/vietprofessional/

                        Comment

                        • Working...
                          X