• 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 Port Security, Port-base authentication (802.1x) và DHCP Snooping

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

  • LAB: Cấu hình Port Security, Port-base authentication (802.1x) và DHCP Snooping

    LAB: Cấu hình tính năng Port Security
    Click image for larger version

Name:	PsecuLAB.png
Views:	77
Size:	7.9 KB
ID:	426444


    Yêu cầu :
    1. Cấu hình tính năng Port Security trên SW1
    2. Client trong mô hình trên có MAC là: 00-90-4B-F1-40-62 đảm bảo SW1 cho phép client kết nối vào port F0/1
    3. Cho phép tối đa 3 pc kết nối vào port F0/1 trên SW1, nếu vượt quá 3 pc sẽ shutdown port.
    4. Nếu không vi phạm (số PC <= 3) port sẽ tự động phục hồi khỏi trạng thái lỗi sau mỗi 30’
    5. Đảm bảo SW1 chỉ cho phép 2 PC đầu tiên kết nối vào SW trên F0/1.



    Hướng dẫn:

    1: Enable port security:

    SW1(config)# interface f0/1

    SW1(config-if)# switchport mode access

    SW1(config-if)# switchport port-security

    2: Cho phép pc có MAC: 0090.4BF1.4062 truy cập vào f0/1:

    SW1(config)# interface f0/1

    SW1(config-if)# switchport port-security mac-address 0090.4BF1.4062

    3: Cho phép tối đa 3 pc kết nối vào port f0/1, vượt quá 3 pc sẽ shutdown port:

    SW1(config)# interface f0/1

    SW1(config-if)# switchport port-security violation shutdown

    4: Tự động phục hồi lại port nếu không còn lỗi:

    SW1(config)# errdisable recovery cause all

    SW1(config)# errdisable recovery interval 30

    5: Cấu hình sticky MAC trên F0/1:

    SW1(config)# interface fastEthernet 0/1

    SW1(config-if)# switchport port-security mac-address sticky



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

    !SW1:

    !

    configure terminal

    !

    interface fastEthernet0/1

    switchport mode access

    switchport port-security

    switchport port-security mac-address 0090.4bf1.4062

    switchport port-security violation shutdown

    switchport port-security mac-addresss sticky

    !

    errdisable recovery cause all

    errdisable recovery interval 30

    !

    end



    !Kiem tra:

    #show interface switchport

    #show port-security interface

    #show port-security interface fastEthernet0/0 address

    #show port-security interface fastEthernet0/0 vlan

    LAB: Cấu hình tính năng Port-base authentication (802.1x)
    Click image for larger version

Name:	Pbase-authenLAB.png
Views:	72
Size:	11.9 KB
ID:	426445


    Yêu cầu:

    1: Đảm bảo xóa toàn bộ cấu hình và VLAN của SW1

    2: Client và Radius Server thuộc VLAN 10.

    3: Cấu hình IP cho các thiết bị như mô hình trên, đảm bảo Client, SW1, Radius Server ping thấy nhau.

    4: Cấu hình dot1x để Client có thể truy cập vào Port F0/1 trên SW1 với username: VNPRO, pass: CISCO. Password truy cập vào radius server là RCISCO.



    Hướng dẫn:

    1: xóa toàn bộ cấu hình và VLAN database:

    SW1(config)# erase startup-config

    SW1(config)# delete flash:vlan.dat

    2: gán port fastEthernet 0/1 và fastEthernet 0/24 vào vlan 10:

    SW1(config)# interface range f0/1 , f0/24

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

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

    3: đặt IP cho client, server, cấu hình IP trên interface vlan 10 cho switch:

    SW1(config)# interface vlan 10

    SW1(config-if)# ip add 192.168.1.1 255.255.255.0

    4: cấu hình radius server trên Server, key là: RCISCO, tạo account với username: VNPRO, password: CISCO. Cấu hình dot1x trên SW1:

    !Cấu hình AAA và radius server

    SW1(config)# aaa new-model

    SW1(config)# radius-server host 192.168.1.254

    SW1(config)# radius-server key RCISCO

    !Cấu hình chứng thực cho dot1x

    SW1(config)# aaa authentication dot1x default

    SW1(config)# dot1x system-auth-control

    SW1(config)# interface fastEthernet 0/1

    SW1(config-if)# switchport mode access

    SW1(config-if)# dot1x port-control auto



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

    !SW1:

    !

    configure terminal

    !

    interface range fastEthernet0/1 , fastEthernet0/24

    switchport mode access

    switchport access vlan 10

    !

    interface vlan 10

    ip address 192.168.1.1 255.255.255.0

    !

    aaa new-model

    !

    radius-server host 192.168.1.254

    radius-server key RCISCO

    !

    aaa authentication dot1x default group radius

    !

    dot1x system-auth-control

    !

    int f0/1

    switchport mode access

    dot1x port-control auto

    !

    end



    !Kiem tra:

    #show dot1x all statistics

    #show dot1x statictisc interface f0/0

  • #2
    LAB: Cấu hình tính năng DHCP Snooping
    Click image for larger version

Name:	DHCP Snooping.png
Views:	72
Size:	22.5 KB
ID:	426447



    Yêu cầu:

    1: Đảm bảo xóa toàn bộ cấu hình và VLAN của SW1

    2: R1, R2, Client1, Client2 đều thuộc VLAN 10.

    3: Cấu hình R1, R2 là DHCP Server. Dãy địa chỉ IP mỗi Router sẽ cấp như sau:

    R1:

    IP: 192.168.1.0/24

    Gateway: 192.168.1.253

    R2:

    192.168.1.0/24

    Gateway: 192.168.1.254

    4: Cấu hình Client 1 và Client 2 là DHCP Client

    5: Cấu hình DHCP Snooping trên SW1, đảm bảo các Client sẽ chỉ xin địa chỉ IP từ R2 qua DHCP (kiểm tra default-gateway trên mỗi client phải là IP của R2 192.168.1.254)



    Hướng dẫn:

    1: xóa toàn bộ cấu hình:

    SW1# erase startup-config

    SW1# delete flash:vlan.dat

    2: Cấu hình SW1:

    SW1(config)# interface range f0/1 - 2 , f0/23 - 24

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

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

    3: Đặt địa chỉ IP cho 2 client và 2 router:

    R1(config)# interface fastEthernet 0/0

    R1(config-if)# ip address 192.168.1.253 255.255.255.0

    R2(config)# interface fastEthernet 0/0

    R2(config-if)# ip address 192.168.1.254 255.255.255.0

    4: Bật DHCP Client trên Client1 và Client2.

    5: Cấu hình DHCP Snooping trên SW1. R1 và R2 là 2 DHCP Server, để đảm bảo client chỉ xin địa chỉ IP từ R2, cấu hình f0/24 (SW1) trust dhcp:

    !Cấu hình DHCP Server cho R1 và R2:

    R1(config)# ip dhcp pool VLAN10

    R1(dhcp-config)# network 192.168.1.0 /24

    R1(dhcp-config)# default-router 192.168.1.253

    R2(config)# ip dhcp pool VLAN10

    R2(dhcp-config)# network 192.168.1.0 /24

    R2(dhcp-config)# default-router 192.168.1.254

    !Cấu hình DHCP Snooping trên SW1:

    SW1(config)# ip dhcp snooping

    SW1(config)# ip dhcp snooping vlan 10

    SW1(config)# no ip dhcp information option

    SW1(config)# interface f0/24

    SW1(config-if)# ip dhcp snooping trust

    SW1(config)# interface f0/23

    SW1(config-if)# no ip dhcp snooping trust



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

    !R1:

    !

    configure terminal

    !

    interface fastEthernet0/0

    ip address 192.168.1.253 255.255.255.0

    no shutdown

    !

    ip dhcp pool VLAN10

    network 192.168.1.0 /24

    default-router 192.168.1.253

    !

    end





    !R2:

    !

    configure terminal

    !

    interface fastEthernet0/0

    ip address 192.168.1.254 255.255.255.0

    no shutdown

    !

    ip dhcp pool VLAN10

    network 192.168.1.0 /24

    default-router 192.168.1.254

    !

    end





    !SW1:

    !

    configure terminal

    !

    interface range fastEthernet0/1 - 2 , fastEthernet0/23 - 24

    switchport mode access

    switchport access vlan 10

    !

    ip dhcp snooping

    !

    ip dhcp snooping vlan 10

    !

    no ip dhcp information option

    !

    interface fastEthernet0/24

    ip dhcp snooping trust

    !

    interface fastEthernet0/23

    no ip dhcp snooping trust

    !

    end







    !Kiem tra:

    #show ip dhcp snooping



    !display only dynamic configured binding

    #show ip dhcp snooping binding



    !display the dhcp snooping binding database status and statistics

    #show ip dhcp snooping database



    !display the dynamic and static configured binding

    #show ip source binding

    Comment

    Working...
    X