'static'에 해당되는 글 1건

  1. 2015.04.15 Port-security

Port-security

Cisco R&S 2015. 4. 15. 12:10 |

1. 통신을 허용할 MAC주소를 관리자가 지정해줄 때


Switch(config-if)#switchport mode [access | trunk]


port-security를 적용하려면 dynamic이 아니라 access나 trunk가 설정되어있어야 한다.

아무런 설정을 하지 않았다면 default인 dynamic이 적용되어 있다.




Switch(config)#int range f 0/1 - 24

Switch(config-if-range)#spanning-tree portfast


빠른 Convergence를 위해 Port-fast를 적용한다.




Switch(config-if)#switchport port-security mac-address [MAC address]


통신을 허용할 MAC어드레스 지정하고..




Switch(config-if)#switchport port-security


port-security를 활성화 시키는 명령인데, 가장 마지막에 입력한다.

설정이 덜된 상황에서 활성화시키면 잠시나마 통신이 안될수 있기 때문..



Switch(config)#int f 0/1

Switch(config-if)#switchport port-security

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

Switch(config)#int f 0/2

Switch(config-if)#switchport port-security

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


설정을 적용하고 PC1의 MAC어드레스를 0000.0000.0003으로 바꾸면 Switch의 f0/2포트가 down된다.




다시 포트를 살리려면 포트를 죽였다가 다시 살려야 한다.


Switch(config)#int f 0/2

Switch(config-if)#shutdown

Switch(config-if)#no shutdown




2. 통신을 허용할 MAC주소를 장비가 동적으로 학습할 때


Switch(config-if)#switchport port-security


port-security를 활성화 시켜주면 끝.




Switch(config-if)#switchport port-security maximum [value]


허용할 MAC어드레스의 최대 개수를 지정할 수도 있다.




3. 동적으로 학습한 MAC주소를 장비 재부팅 후에도 유지해야 할 때 - Sticky


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


동적으로 학습한 MAC어드레스를 running-config에 저장하므로 NVRAM에 write시키면 장비를 reload한 뒤에도 같은 MAC어드레스로 보안을 적용할 수 있다.




Switch(config-if)#switchport port-security maximum [value]


허용할 MAC어드레스의 최대 개수를 지정할 수도 있다.




Port-security 침해 대응 방법


- Protect : rule위반시 포트 접근 차단, 등록된 호스트는 허가

- Restrict : Protect와 동일하게 동작 +rule위반한 호스트에 대한 log를 남긴다. (권장)

- Shutdown : rule위반시 해당 포트를 닫아버린다. 모든 호스트의 포트 접근 차단. (기본값)


Switch(config-if)#switchport port-security violation [protect | restrict | shutdown]

Posted by 비형랑#
: