CCNA - Switch Port Security

일상 코딩·2022년 4월 22일
0

CCNA

목록 보기
9/17

01.Switch Port Security 기본 개념

스위치의 보안적 문제점

  • 모든 인터페이스는 기본적으로 활성화된다.
  • 사용하지 않는 인터페이스는 shutdown 명령어를 통해 비활성화
  • 특정 포트에 접근할 수 있는 스테이션의 MAC주소를 한정해 인터페이스 사용을 제한 할 수 있다.

1-1.정적 Port Security

  • 관리자가 직접 포트에 허용할 MAC Address를 부여하는 것

정적 Port Security 방법
1.인터페이스를 기본 auto mode에서 access mode 또는 trunk mode로 설정

Switch(config-if)#int fa0/2
Switch(config-if)#switchport mode access 

포트 보안 활성화

Switch(config-if)#switchport port-security 

허용할 MAC주소 직접 입력

#switchport port-security mac-address 0060.2F5B.BE18

MAC 주소 확인 방법
PC> ipconfig /all

  • MAC Address => Physical Address................: 0060.2F5B.BE18

포트 번호에 허용된 MAC주소 PC에서 서버로 Ping Test

포트 번호에서 허용되지 않은 PC에서 서버로 Ping Test

포트 번호에서 허용되지 않은 MAC주소는 Shutdown으로 차단

차단된 포트를 다시 활성화

  • 다시 포트에 설정된 MAC 주소의 PC로 포트를 연결
Switch(config)#int fa0/2
Switch(config-if)#sh
Switch(config-if)#no sh

1-2.동적 Port Security

  • Switch가 학습(Learning)할 수 있는 MAC주소의 갯수를 설정

동적 Port Security 방법
1.인터페이스를 기본 auto mode에서 access mode 또는 trunk mode로 설정

Switch(config-if)#int g0/1
Switch(config-if)#switchport mode trunk

포트 보안 활성화

Switch(config-if)#switchport port-security 

허용할 MAC 주소 갯수 설정

Switch(config-if)#switchport port-security maximum 3(허용할 MAC 주소 개수)

  • g0/1 Port로 최대 3개까지 MAC 주소 학습 가능
Switch(config-if)#do show mac address-table

  • maximum 설정된 해당 g0/1 PortMAC 주소 3개 이상 초과 시 해당 포트를 차단한다.

1-3.동적 포트 보안의 문제점

  • 허가되지 않은 PC MAC 주소가 먼저 학습되는 경우 통신이 허용된다.

해결방안

  • 동적 포트 보안 Sticky 설정
  • 동적 포트보안으로 학습된 MAC주소의 설정내용을 저장하는 running-config 안에 기록하는 기능이다.

Sticky 설정

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

장비에 기록된 설정 사항 확인 방법

Switch#show running-config 

  • 패킷트레이서는 시물레이션 프로그램이라서 제대로 설정 확인 불가
  • 실제 장비에서 running-config에 설정된 sticky 및 허용된 MAC 주소
  • MAC주소 테이블이 초기화되어도 running-config에 기록된 내용이 있어 동적 포트보안 설정을 유지할 수 있다.

1-4.포트보안 위배 발생할 경우

1.Shutdown(기본)

  • 포트를 차단하며 포트 상태를 Err-disabled(비활성화) 상태로 만든다.
  • 이처럼 포트를 차단하면 정상적인 사용자들도 같이 해당 인터페이스를 사용하지 못한다.

2.Protect

  • Shutdown하지 않고 통신만 차단
  • 허용되지 않은 PC만 통신이 차단되기에 허용된 사용자들이 해당 인터페이스를 사용하는데
    아무런 문제가 발생하지 않는다.
  • 하지만 보안 위반 시 Count는 하지 않는다.
Switch(config)#int g0/1
Switch(config-if)#switchport port-security violation protect

3.Restrict

  • Shutdown하지 않고 통신만 차단하며 Security Violation Count를 증가
Security Violation Count => 포트 보안 위배 횟수 
Switch(config)#int g0/1
Switch(config-if)#switchport port-security violation restrict 

1-5.해당 인터페이스에 설정된 보안 정보 확인 명령어 (포트 보안 설정 확인 명령어)

Switch#show port-security interface fa0/3 또는 
Switch(config-if)#do sh por

  • Port Security : Enabled // 포트 활성화 상태
  • Maximum MAC Addresses : 3 // 최대 MAC주소 허용 갯수
  • Security Violation Count : 4 // 포트 보안 위배 횟수

02.Switch Port Security 실습

실습 문제
1.DHCP => 192.168.2.100 왼쪽 허브에 연결된 PC2개만 허용
2.MAC주소를 runing-config 안에 저장
3.스위치로 들어오는 MAC주소 로그 남기고 포트를 차단하지 않고 해당 사용자만 거부
4.보안 위반 횟수 카운트 maximum => 2

Router>

Router(config)#int g0/0
Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#int g0/1
Router(config-if)#ip add 192.168.2.1 255.255.255.0 

왼쪽 Swtich1>

Switch(config)#int fa0/1
Switch(config-if)#switchport mode trunk 
Switch(config-if)#int g0/1
Switch(config-if)#switchport mode trunk 

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 restrict 

Switch#show mac address-table 

profile
일취월장(日就月將) - 「날마다 달마다 성장하고 발전한다.」

0개의 댓글