본문 바로가기

Switch

Port-security 실습

Port-Security 실습 설정


   패킷트레이서로 실습한다


실습 기본구성 설정

! R1

(config)# interface f0/0

(config-if)# ip address 10.1.1.1 255.255.255.0

(config-if)# mac-address 0000.0000.0001

(config-if)# no shutdown


! R2

(config)# interface f0/0

(config-if)# ip address 10.1.1.2 255.255.255.0

(config-if)# mac-address 0000.0000.0002

(config-if)# no shutdown


! R3

(config)# interface f0/0

(config-if)# ip address 10.1.1.3 255.255.255.0

(config-if)# no shutdown



1. Mac-address 학습방법 설정 및 Port-security 기능 활성화

ASW2(config-if)# switchport port-security maximum 3

 ⇒ 해당 포트에 학습될 수 있는 Mac-address의 최대 개수를 지정한다.

ASW2(config-if)# switchport port-security mac-address 0000.0000.0002

 ⇒ 수동으로 입력된 값은 시간이 지나도 지워지지 않으며 NVram에 저장할 수도 있다. 

    위에서 최대 개수를 3개로 설정했으니, 수동으로 설정한 하나를 제외한 2개의 주소는 동적으로 학습된다.

ASW2(config-if)# switchport port-security

 ⇒ 설정이 끝났으면 포트시큐리티 기능을 활성화 한다. 



2. 설정된 내용 확인하기

ASW2# show port-security interface fa0/1

Port Security  : Enabled
Port status  : Secure-Up
Violation mode  : Shutdown

Aging Time   : 60 mins

Aging Type  : Inactivity

SecureStatic address aging  : Enabled
Maximum MAC Addresses  : 3
Total MAC Addresses  : 1
Configured MAC Addresses  : 1
Sticky MAC Addresses  : 0

Last Source Address:VLAN  : 001b.d513.2ad2:5

Security Violation count  : 0



3. Violation이 Shutdown 이며, Port-security 보안정책을 위반한 경우

R1에 설정된 Mac-address : 0000.0000.0001

R1(config-if)# mac-address 0000.0000.1111

R1(config-if)# end

R1# ping 10.1.1.3

 ⇒ R1의 Mac주소를 변경하면, Port-security 정책에 의해 ASW2의 인터페이스가 err-disabled 상태가 된다.

    이런 경우에는 원인을 제거한 후, 해당 인터페이스에서 shutdown, no shutdown을 차례로 입력한다.


 ** 에러가 발생된 인터페이스와 원인 확인하기

ASW2# show interface f0/13

FastEhternet0/13 is down, line protocol ids down (err-disabled)

ASW2show errdisable detect

 다양한 원인으로 인해 에러가 발생했을 경우 확인하는 명령어

ASW2# show interface status err-disabled

 에러가 발생한 포트와 상태  원인을   있다.


 ** 에러난 포트 복구하기

1. 인터페이스를 다운시켰다 활성화 시켜서 복구한다

ASW2#(config)# interface f0/13

ASW2#(config-if)# shutdown (and no shutdown)

2. Recovery 시간을 설정하여 자동으로 복구하도록 설정한다

ASW2(config)# errdisable recovery cause port-security

ASW2(config)# errdisable recovery interval 120 (Sec)




4. Violation이 Restrict 이며, Port-security 보안정책을 위반한 경우

ASW2(config)# interface f0/1

ASW2(config-if)# switchport port-security violation restrict


R1에 설정된 Mac-address : 0000.0000.0001

R1(config-if)# mac-address 0000.0000.1111

R1(config-if)# end

R1# ping 10.1.1.3

 ⇒ R1의 Mac주소를 변경하면, Port-security 정책에 의해 R1은 더 이상 R3와 통신이 될 수 없다. 

    하지만 인터페이스가 다운된것이 아니기 때문에 이미 학습되어 있는 다른 주소들은 통신이 된다. 


ASW2# show port-security interface f0/1

Port Security  : Enabled
Port status  : Secure-Up
Violation mode  : Restrict

Aging Time   : 60 mins

Aging Type  : Inactivity

SecureStatic address aging  : Enabled
Maximum MAC Addresses  : 3
Total MAC Addresses  : 1
Configured MAC Addresses  : 1
Sticky MAC Addresses  : 0

Last Source Address:VLAN  : 001b.d513.2ad2:5

Security Violation count  : 3

 ⇒ 인터페이스가 아닌 정책에 위반된 트래픽만 차단하며, 위반된 트래픽이 얼마나 유입되는지 Counting된다.



'Switch' 카테고리의 다른 글

Switchport - Trunk  (0) 2018.06.19
Switchport - Access  (1) 2018.06.17
[Config] STP 네트워크 보호 기술  (1) 2015.01.02
이중화 게이트웨이 프로토콜 (HSRP/VRRP)  (2) 2014.10.05
[Config] Inter VLAN Routing (with L3 Switch)  (0) 2014.09.29