Hướng dẫn cấu hình tính năng Port Security và Port-base authentication (802.1x)

Hướng dẫn cấu hình tính năng Port Security và Port-base authentication (802.1x)

Cấu hình tính năng Port Security

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

Cấu hình tính năng Port-base authentication (802.1x)

 

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

Chúc các bạn thực hiện thành công! Nếu bạn có bất kỳ câu hỏi hoặc gặp khó khăn, đừng ngần ngại liên hệ với chúng tôi theo thông tin dưới đây để được hỗ trợ thêm.

Hẹn gặp lại các bạn trong các bài viết tiếp theo!

CÔNG TY CỔ PHẦN DỊCH VỤ CÔNG NGHỆ DATECH

• Địa chỉ: Số 23E4 KĐT Cầu Diễn, Tổ 7, Phú Diễn, Bắc Từ Liêm, Hà Nội

• Điện thoại: 02432012368

• Hotline: 098 115 6699

 Email: info@datech.vn

• Website: https://datech.vn