• 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 PRIVATE VLANs

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

  • LAB: CẤU HÌNH PRIVATE VLANs

    Click image for larger version

Name:	hinh1.png
Views:	60
Size:	34.3 KB
ID:	426368

    Yêu cầu:

    1: Xóa toàn bộ cấu hình và VLAN trên SW1.

    2: Cấu hình IP address của các PC như trên mô hình.

    3: Cấu hình Private-VLAN thõa mãn các yêu cầu sau:

    - VLAN 10 là Isolated VLAN.
    - VLAN 20, 30 là Community VLAN.
    - VLAN 100 là Primary VLAN của VLAN 10, 20, 30.
    - Client 1 thuộc VLAN 10.
    - Client 2 thuộc VLAN 20.
    - Client 3 thuộc VLAN 30.
    - Server thuộc VLAN 100.

    4: Kiểm tra như sau:

    - Tất cả Client phải ping thấy Server.

    - Các Client trong VLAN 10 chỉ ping thấy Server

    - Các Client trong VLAN 20, 30 chỉ ping thấy Server và ping thấy các Client khác trong cùng VLAN (ví dụ: các Client trong cùng VLAN 20 thì ping thấy nhau và ping thấy Server, nhưng không ping thấy các Client trong VLAN 30).



    Hướng dẫn:

    1: Xóa cấu hình của SW:

    SW1# erase startup-config

    SW1# delete flash:vlan.dat

    2: Cấu hình IP cho các PC như sau:

    Client1: 192.168.1.1 /24

    Client2: 192.168.1.2 /24

    Client3: 192.168.1.3 /24

    Server: 192.168.1.254 /24

    3: Cấu hình private VLAN trên SW1:

    !Tạo các VLAN

    SW1(config)# vlan 10
    SW1(config-vlan)# private-vlan isolated
    SW1(config-vlan)# exit
    SW1(config)# vlan 20
    SW1(config-vlan)# private-vlan community
    SW1(config-vlan)# exit
    SW1(config)# vlan 30
    SW1(config-vlan)# private-vlan community
    SW1(config-vlan)# exit
    SW1(config)# vlan 100
    SW1(config-vlan)# private-vlan primary
    SW1(config-vlan)# private-vlan association 10,20,30
    SW1(config-vlan)# exit
    !Gán port vào VLAN:

    SW1(config)# interface fastEthernet 0/1
    SW1(config-if)# switchport mode private-vlan host
    SW1(config-if)# switchport private-vlan host-association 100 10
    SW1(config-if)# exit
    SW1(config)# interface fastEthernet 0/2
    SW1(config-if)# switchport mode private-vlan host
    SW1(config-if)# switchport private-vlan host-association 100 20
    SW1(config-if)# exit
    SW1(config)# interface fastEthernet 0/3
    SW1(config-if)# switchport mode private-vlan host
    SW1(config-if)# switchport private-vlan host-association 100 30
    SW1(config-if)# exit
    SW1(config)# interface fastEthernet 0/24
    SW1(config-if)# switchport mode private-vlan promiscuous
    SW1(config-if)# switchport private-vlan mapping 100 10 20 30
    SW1(config-if)# end


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

    configure terminal
    !
    vlan 10
    private-vlan isolated
    !
    vlan 20
    private-vlan community
    !
    vlan 30
    private-vlan community
    !
    vlan 100
    private-vlan primary
    private-vlan association 10,20,30
    !
    interface fastEthernet 0/1
    switchport mode private-vlan host
    switchport private-vlan host-association 100 10
    !
    interface fastEthernet 0/2
    switchport mode private-vlan host
    switchport private-vlan host-association 100 20
    !
    interface fastEthernet 0/3
    switchport mode private-vlan host
    switchport private-vlan host-association 100 30
    !
    interface fastEthernet 0/24
    switchport mode private-vlan promiscuous
    switchport private-vlan mapping 100 10 20 30
    !
    end
    !Kiem tra:

    #show interface status
    #show vlan private-vlan
    #show interface private-vlan mapping
    #show interface switchport
Working...
X