목적: Access 포트에서 허용된 단말(MAC)만 통신하도록 제한해 무단 접속/허브 연결/단말 변경으로 인한 보안 리스크를 줄인다.
주 사용처: PC/프린터/키오스크/회의실 포트 등 (uplink/trunk에는 일반적으로 비권장)
| 모드 | 동작 | 트래픽 | 로그/SNMP | 포트 상태 |
|---|---|---|---|---|
protect |
위반 MAC만 드롭 | 차단(조용히) | 거의 없음 | Up 유지 |
restrict |
위반 MAC 드롭 + 카운터 증가 | 차단 | 로그/SNMP 가능 | Up 유지 |
shutdown (기본) |
위반 시 포트를 err-disabled로 내림 | 전체 차단 | 로그/SNMP | Down(err-disabled) |
운영 추천
restrict 또는 정책상 강력하면 shutdownrestrict 선호conf t
interface gi1/0/5
description USER-PC-05
switchport mode access
switchport access vlan 10
switchport port-security
switchport port-security maximum 1
switchport port-security mac-address sticky
switchport port-security violation restrict
spanning-tree portfast
spanning-tree bpduguard enable
end
switchport mode access)maximum 값이 현실적으로 맞는지(전화기+PC면 2 이상 고려)sticky 사용 시 저장(copy run start) 을 해야 재부팅 후 유지conf t
interface gi1/0/6
description PRINTER
switchport mode access
switchport access vlan 10
switchport port-security
switchport port-security maximum 1
switchport port-security mac-address 0011.2233.4455
switchport port-security violation shutdown
end
장점: 가장 확실함(단말 변경 방지)
단점: 운영/교체 작업이 번거로움
IP Phone + PC(데이지체인) 환경은 MAC이 2개 이상일 수 있음
interface gi1/0/10
description IP-PHONE+PC
switchport mode access
switchport access vlan 10
switchport voice vlan 30
switchport port-security
switchport port-security maximum 2
switchport port-security mac-address sticky
switchport port-security violation restrict
체크포인트
maximum 현실화 또는 포트별 예외 정책 필요show port-security
체크포인트
show port-security interface gi1/0/5
출력에서 반드시 볼 것
Port Security : Enabled/DisabledPort Status : Secure-up / Secure-shutdown(또는 err-disabled)Violation Mode : protect/restrict/shutdownMaximum MAC AddressesCurrent MAC Addresses / Sticky MAC AddressesSecurity Violation Countshow port-security address
show mac address-table interface gi1/0/5
show running-config interface gi1/0/5
show logging | include PORT_SECURITY|ERRDISABLE|PSECURE
show interfaces status | include err-disabled
포트 상태 확인
show interfaces statusPort-Security 상태 확인
show port-security interface <IF>위반 카운트/모드 확인
MAC 테이블 확인
show mac address-table interface <IF>원인 후보
원인 확인
show logging | include ERRDISABLE|PORT_SECURITY원인 제거(허브 제거/단말 확인/maximum 조정)
포트 복구
conf t
interface <IF>
shutdown
no shutdown
end
운영 팁: 자동 복구를 쓰는 경우도 있으나, 원인 제거 없이 자동 복구는 반복 장애를 만들 수 있음.
conf t
interface <IF>
no switchport port-security mac-address sticky
switchport port-security mac-address sticky
end
copy running-config startup-config 저장Port Security는 Access 포트에만 적용(트렁크/업링크 비권장)
사용자 PC 포트: maximum 1, sticky, restrict (업무 영향/정책에 맞춰 조정)
전화기+PC: maximum 2 이상으로 설계
Sticky 사용 시:
copy run start를 통해 기준선 저장장애 분석을 위해:
show port-security interface <IF> 와 show logging 캡처를 표준 절차에 포함show port-security
show port-security interface <IF>
show port-security address
show mac address-table interface <IF>
show interfaces status | include err-disabled
show logging | include PORT_SECURITY|ERRDISABLE|PSECURE