본문 바로가기

IT 엔지니어/네트워크

port-security

 

📌 1. Port Security란?

포트 보안(Port Security)은 스위치의 포트에 연결할 수 있는 MAC 주소를 제한하여 네트워크 보안을 강화하는 기능입니다.
허용된 MAC 주소만 포트에 접속 가능하도록 설정하여 불법 장비 접속을 차단할 수 있습니다.


📌 2. Port Security의 주요 기능

MAC 주소 학습 및 제한: 특정 MAC 주소만 허용하여 불법 장비 접속 방지
자동 또는 수동 MAC 주소 등록: 동적으로 학습하거나 수동으로 지정 가능
보안 위반 발생 시 포트 동작 설정: 위반 시 차단(Shutdown), 경고(Alert), 제한(Restrict) 모드 선택 가능


📌 3. Port Security 설정 방식

Port Security는 스위치의 개별 포트(interface) 에 적용할 수 있으며, 주요 설정 방법은 다음과 같습니다.

1️⃣ Static Secure MAC (정적 MAC 주소 할당)

  • 특정 MAC 주소만 등록하여 허용
 
Switch(config)# interface FastEthernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security mac-address 00A1.B2C3.D4E5
Switch(config-if)# switchport port-security maximum 2
Switch(config-if)# switchport port-security violation shutdown

 

2️⃣ Dynamic Secure MAC (동적 MAC 주소 학습)

  • 포트에 처음 연결된 장비의 MAC 주소를 자동 등록하여 허용
 
Switch(config)# interface FastEthernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum 2
Switch(config-if)# switchport port-security violation restrict
 

 


3️⃣ Sticky Secure MAC (Sticky MAC 주소)

  • 자동 학습된 MAC 주소를 저장하여 재부팅 후에도 유지 가능
 
Switch(config)# interface FastEthernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security mac-address sticky
Switch(config-if)# switchport port-security maximum 2
Switch(config-if)# switchport port-security violation protect
 

📌 4. Port Security 위반(보안 침해) 시 동작 모드

Protect 허용되지 않은 MAC 주소의 패킷을 차단 (로그 X)
Restrict 허용되지 않은 MAC 주소의 패킷을 차단 + 로그 기록
Shutdown 포트를 비활성화(Shutdown) 후 수동 복구 필요

📌 5. Port Security 확인 및 관리 명령어

✅ 현재 Port Security 상태 확인

 
Switch# show port-security interface FastEthernet 0/1

✅ 학습된 MAC 주소 확인

 
Switch# show port-security address

✅ 포트 보안 위반 로그 확인

 
Switch# show port-security violation

✅ 포트 보안 해제

 
Switch(config)# interface FastEthernet 0/1 Switch(config-if)# no switchport port-security

 

 

 

 

 

switchport mode access

sw port-security sw port-security max 2 ///// address 개수 2로 제한

sw port-security violation shutdown/

 

shut down -> No shut down / 활성화 가능

 

 

 

switchport port-security mac-address 0090.0C74.6E4D

switchport port-security mac-address sticky

'IT 엔지니어 > 네트워크' 카테고리의 다른 글

Switch  (0) 2025.04.27
Network  (0) 2025.04.26
FIREWALL  (0) 2025.03.20
IPSEC  (0) 2025.03.19
Inter-vlan  (0) 2025.01.31