• 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: Cấu hình switch port, vlans, trunk, vtp, intervlan routing

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

  • Lab: Cấu hình switch port, vlans, trunk, vtp, intervlan routing

    Click image for larger version

Name:	ôn tập LAB.png
Views:	25
Size:	42.7 KB
ID:	426830
    Yêu cầu:
    1. Mô hình trên dùng cho 3 nhóm, mỗi nhóm từ 2->3 học viên, thiết bị của mỗi nhóm là 1 router + 3 switch.
    2. Cấu hình trung kế:
      1. Cấu hình trung kế Dot1q kết nối giữa Switch – Switch.
      2. Cấu hình trung kế Dot1q kết nối giữa Switch – Router.
    3. Cấu hình VTP:
      1. Mỗi nhóm cấu hình VTP theo các yêu cầu sau:
      2. VTP domain: BCMSNx (x là số thứ tự của nhóm, x = 1,2,3).
      3. VTP pass: CISCO (lưu ý chữ hoa chữ thường).
      4. SWx1 là VTP server.
      5. SWx2, SWx3 là VTP client.
    4. Cấu hình VLANs:
      1. Mỗi nhóm tạo 3 VLANs tương ứng với mô hình trên
      2. Ví dụ: nhóm 1 tạo VLAN11, VLAN12, VLAN13.
      3. Gán port vào VLAN như sau:
        1. Port 1->7 thuộc VLANx1.
        2. Port 10->16 thuộc VLANx2
        3. Port 17->23 thuộc VLANx3
        4. x là số thứ tự của nhóm (x = 1,2,3).
    5. Cấu hình định tuyến giữa các VLAN:
      1. Mỗi nhóm cấu hình để 3 VLAN trong mỗi nhóm có thể ping thấy nhau.
      2. Mỗi nhóm cấu hình giao thức định tuyến OSPF để tất cả VLAN và Interface Loopback có thể ping thấy nhau.

    Gợi ý:

    2a: Dùng lệnh sau trên switch trong mode interface:

    Switch(config-if)# switchport trunk encapsulation dot1q

    Switch(config-if)# switchport mode trunk

    !Lưu ý: phải gõ lệnh “switchport trunk encapsulation dot1q” trước lệnh “switchport mode trunk”, nếu gõ theo thứ tự ngược lại sẽ không thể tạo kết nối trung kế thành công

    2b: Dùng lệnh sau trên router để cấu hình trung kế dot1q:

    Router(config)# interface fastethernet 0/0.11

    Router(config-if)# encapsulation dot1q 10

    Router(config-if)# ip address 192.168.1.1 255.255.255.0

    !lưu ý: câu lệnh trên tạo subinterface f0/0.11, chỉ định encapsulation là dot1q, thuộc VLAN 10 và có IP 192.168.1.1.

    3: Dùng lệnh sau để cấu hình VTP:

    Switch(config)# vtp domain BCMSN

    Switch(config)# vtp mode { client | server | transparent }

    Switch(config)# vtp password CISCO

    4: Dùng các lệnh sau để cấu hình VLAN:

    Switch(config)# vlan 10

    Switch(config-vlan)# name VLAN10 !ßđặt tên là VLAN10

    Switch(config)# interface range fastethernet 0/1 – 6

    Switch(config-if-range)# switchport mode access

    Switch(config-if-range)# switchport access vlan 10

    Cấu hình đầy đủ:

    !Nhóm 1:

    !SW11:

    !

    configure terminal

    !

    interface fastEthernet0/8

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    interface fastEthernet0/9

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    interface fastEthernet0/24

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    vtp domain BCMSN1

    vtp pass CISCO

    !

    vlan 11

    name VLAN11

    !

    vlan 12

    name VLAN12

    !

    vlan 13

    name VLAN13

    !

    interface range fastEthernet0/1 - 7

    switchport mode access

    switchport access vlan 11

    !

    interface range fastEthernet0/10 - 16

    switchport mode access

    switchport access vlan 12

    !

    int range fastEthernet0/17 - 23

    switchport mode access

    switchport access vlan 13

    !

    end


    !SW12:

    !

    configure terminal

    !

    interface fastEthernet0/8

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    vtp mode client

    vtp domain BCMSN1

    vtp pass CISCO

    !

    interface range fastEthernet0/1 - 7

    switchport mode access

    switchport access vlan 11

    !

    interface range fastEthernet0/9 - 16

    switchport mode access

    switchport access vlan 12

    !

    interface range fastEthernet0/17 - 24

    switchport mode access

    switchport access vlan 13

    !

    end


    SW13:

    configure terminal

    !

    interface fastEthernet0/8

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    vtp mode client

    vtp domain BCMSN1

    vtp pass CISCO

    !

    interface range fastEthernet0/1 - 7

    switchport mode access

    switchport access vlan 11

    !

    interface range fastEthernet0/10 - 16

    switchport mode access

    switchport access vlan 12

    !

    interface range fastEthernet0/17 - 24

    switchport mode access

    switchport access vlan 13

    !

    end



    !R11:

    configure terminal

    !

    interface loopback0

    ip address 1.1.1.1 255.255.255.0

    !

    interface serial0/0

    clock rate 64000

    ip address 192.168.1.1 255.255.255.0

    no shutdown

    !

    interface fastEthernet0/0

    no shutdown

    !

    interface fastEthernet0/0.11

    encapsulation dot1q 11

    ip address 172.16.1.1 255.255.255.0

    !

    interface fastEthernet0/0.12

    encapsulation dot1q 12

    ip address 172.16.2.1 255.255.255.0

    !

    interface fastEthernet0/0.13

    encapsulation dot1q 13

    ip address 172.16.3.1 255.255.255.0

    !

    router ospf 1

    network 0.0.0.0 255.255.255.255 are 0

    !

    end



    !Nhóm 2:

    SW21:

    !

    configure terminal

    !

    interface fastEthernet0/8

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    interface fastEthernet0/9

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    interface fastEthernet0/24

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    vtp domain BCMSN2

    vtp pass CISCO

    !

    vlan 21

    name VLAN21

    !

    vlan 22

    name VLAN22

    !

    vlan 23

    name VLAN23

    !

    interface range fastEthernet0/1 - 7

    switchport mode access

    switchport access vlan 21

    !

    interface range fastEthernet0/10 - 16

    switchport mode access

    switchport access vlan 22

    !

    interface range fastEthernet0/17 - 23

    switchport mode access

    switchport access vlan 23

    !

    end


    SW22:

    !

    configure terminal

    !

    interface fastEthernet0/8

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    vtp domain BCMSN2

    vtp mode client

    vtp pass CISCO

    !

    interface range fastEthernet0/1 - 7

    switchport mode access

    switchport access vlan 21

    !

    interface range fastEthernet0/9 - 16

    switchport mode access

    switchport access vlan 22

    !

    interface range fastEthernet0/17 - 24

    switchport mode access

    switchport access vlan 23

    !

    end


    SW23:

    !

    configure terminal

    !

    interface fastEthernet0/8

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    vtp domain BCMSN2

    vtp mode client

    vtp pass CISCO

    !

    interface range fastEthernet0/1 - 7

    switchport mode access

    switchport access vlan 21

    !

    interface range fastEthernet0/9 - 16

    switchport mode access

    switchport access vlan 22

    !

    interface range fastEthernet0/17 - 24

    switchport mode access

    switchport access vlan 23

    !

    end



    R21:

    !

    configure terminal

    !

    interface loopback0

    ip address 2.2.2.2 255.255.255.0

    !

    interface serial0/0

    clock rate 64000

    ip address 192.168.1.2 255.255.255.0

    no shutdown

    !

    interface serial0/1

    clock rate 64000

    ip address 192.168.2.2 255.255.255.0

    no shutdown

    !

    interface fastEthernet0/0

    no shutdown

    !

    interface fastEthernet0/0.21

    encapsulation dot1q 21

    ip address 172.17.1.1 255.255.255.0

    !

    interface fastEthernet0/0.22

    encapsulation dot1q 22

    ip address 172.17.2.1 255.255.255.0

    !

    interface fastEthernet0/0.23

    encapsulation dot1q 23

    ip address 172.17.3.1 255.255.255.0

    !

    router ospf 1

    network 0.0.0.0 255.255.255.255 are 0

    !

    end


    !Nhóm 3:

    SW31:

    !

    configure terminal

    !

    interface fastEthernet0/8

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    interface fastEthernet0/9

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    interface fastEthernet0/24

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    vtp domain BCMSN3

    vtp pass CISCO

    !

    vlan 31

    name VLAN31

    !

    vlan 32

    name VLAN32

    !

    vlan 33

    name VLAN33

    !

    interface range fastEthernet0/1 - 7

    switchport mode access

    switchport access vlan 31

    !

    interface range fastEthernet0/10 - 16

    switchport mode access

    switchport access vlan 32

    !

    interface range fastEthernet0/17 - 23

    switchport mode access

    switchport access vlan 33

    !

    end


    SW32:

    !

    configure terminal

    !

    interface fastEthernet0/8

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    vtp mode client

    vtp domain BCMSN3

    vtp pass CISCO

    !

    interface range fastEthernet0/1 - 7

    switchport mode access

    switchport access vlan 31

    !

    interface range fastEthernet0/9 - 16

    switchport mode access

    switchport access vlan 32

    !

    interface range fastEthernet0/17 - 24

    switchport mode access

    switchport access vlan 33

    !

    end


    SW33:

    !

    configure terminal

    !

    interface fastEthernet0/8

    switchport trunk encapsulation dot1q

    switchport mode trunk

    !

    vtp mode client

    vtp domain BCMSN3

    vtp pass CISCO

    !

    interface range fastEthernet0/1 - 7

    switchport mode access

    switchport access vlan 31

    !

    interface range fastEthernet0/9 - 16

    switchport mode access

    switchport access vlan 32

    !

    interface range fastEthernet0/17 - 24

    switchport mode access

    switchport access vlan 33

    !

    end


    R31:

    configure terminal

    !

    interface loop 0

    ip address 3.3.3.3 255.255.255.0

    !

    interface s0/0

    clock rate 64000

    ip address 192.168.2.3 255.255.255.0

    no shutdown

    !

    interface fastEthernet0/0

    no shutdown

    !

    interface fastEthernet0/0.31

    encapsulation dot1q 31

    ip address 172.18.1.1 255.255.255.0

    !

    interface fastEthernet0/0.32

    encapsulation dot1q 32

    ip address 172.18.2.1 255.255.255.0

    !

    interface fastEthernet0/0.33

    encapsulation dot1q 33

    ip address 172.18.3.1 255.255.255.0

    !

    router ospf 1

    network 0.0.0.0 255.255.255.255 are 0

    !

    end


    !kiem tra trunk

    #show int trunk


    !kiem tra vtp

    #show vtp status


    !kiem tra routing table

    #show ip route
    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
Working...
X