반응형

 

 

 

 

 

DHCP Snooping 란?

Snooping 이란  '기웃거리다, 염탐하다, 훔쳐보다' 라는 의미로 DHCP Snooping 으로 합쳐지면 DHCP 패킷의 내용을 중간에 가로채서 훔쳐보거나 염탐하는 사용자가 있을 수 있습니다. 그걸 방지하기 위해 DHCP Snooping을 이용하여 DHCP 응답을 차단시켜주는 기능입니다.

 

 

 

 

 

테스트는 EVE-NG로 시뮬레이션을 진행합니다.

일단 아래와 같이 기본 Vlan 10으로 설정을 했습니다. 

 

 

일반 유저 인터페이스들은 아래와 같이 설정하였습니다.

SW1(config)#ip dhcp snooping
SW1(config)#ip dhcp snooping vlan 10
SW1(config)#no ip dhcp snooping information option 

SW1(config)#interface range ethernet 0/1 - 3
SW1(config-if-range)#ip dhcp snooping limit rate 15

 

 

DHCP Server가 연결된 인터페이스는 아래와 같이 설정하였습니다.

SW1(config)#interface ethernet 0/0
SW1(config-if)#ip dhcp snooping trust 

 

ip dhcp snooping - DHCP Snooping 기능을 활성화 시켜줍니다.

ip dhcp snooping vlan [Vlan ID] - DHCP Snooping 기능을 적용할 Vlan을 입력해 주세요.

ip dhcp snooping limit rate [num] - 신뢰하지 않는 인터페이스에 초당 DHCP 패킷 수를 조절한다. (넘으면 차단)

ip dhcp snooping trust - DHCP Server가 연결되어있거나 신뢰가능한 인터페이스에 설정해 주세요.

no ip dhcp snooping information option - DHCP option82를 꺼주는 설정인데, 대부분의 enterprise server는 이를 지원하지 않습니다. 궁금하신분은 DHCP option82를 검색하여 확인해보세요 !!

 

 

 

 

DHCP Snooping 기능을 설정한 포트를 확인할 수 있습니다.

SW1#sh ip dhcp snooping 
Switch DHCP snooping is enabled
DHCP snooping is configured on following VLANs:
10
DHCP snooping is operational on following VLANs:
10
DHCP snooping is configured on the following L3 Interfaces:

Insertion of option 82 is enabled
   circuit-id default format: vlan-mod-port
   remote-id: aabb.cc00.1000 (MAC)
Option 82 on untrusted port is not allowed
Verification of hwaddr field is enabled
Verification of giaddr field is enabled
DHCP snooping trust/rate is configured on the following Interfaces:

Interface                  Trusted    Allow option    Rate limit (pps)
-----------------------    -------    ------------    ----------------   
Ethernet0/0                no         no              15        
  Custom circuit-ids:
Ethernet0/1                no         no              15        
  Custom circuit-ids:
Ethernet0/2                no         no              15        
  Custom circuit-ids:
Ethernet0/3                no         no              15        
  Custom circuit-ids:

 

 

 

 

DHCP Snooping 패킷을 확인해볼 수 있습니다.

SW1#sh ip dhcp snooping statistics 
  Packets Forwarded = 3
  Packets Dropped = 9
  Packets Dropped From untrusted ports = 0

 

 

 

 

 

테스트로 0/1번 포트의 limit rate를 1로 바꿔서 확인해 보세요.

SW1(config)#interface ethernet 0/1
SW1(config-if-range)#ip dhcp snooping limit rate 1

 

해당 포트가 차단된 로그를 볼 수 있습니다.

*Jun 30 10:57:30.646: %SYS-5-CONFIG_I: Configured from console by console
*Jun 30 10:57:49.485: %DHCP_SNOOPING-4-DHCP_SNOOPING_ERRDISABLE_WARNING: DHCP Snooping received 1 DHCP packets on interface Et0/1 
*Jun 30 10:57:49.485: %DHCP_SNOOPING-4-DHCP_SNOOPING_RATE_LIMIT_EXCEEDED: The interface Et0/1 is receiving more than the threshold set 
*Jun 30 10:57:49.485: %PM-4-ERR_DISABLE: dhcp-rate-limit error detected on Et0/1, putting Et0/1 in err-disable state 
*Jun 30 10:57:50.489: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed state to down
*Jun 30 10:57:51.489: %LINK-3-UPDOWN: Interface Ethernet0/1, changed state to down

 

SW1#sh interfaces status 

Port      Name               Status       Vlan       Duplex  Speed Type
Et0/0                        connected    10           auto   auto unknown
Et0/1                        err-disabled 10           auto   auto unknown
Et0/2                        connected    10           auto   auto unknown
Et0/3                        connected    10           auto   auto unknown

 

 

 

 

 

감사합니다.

 

CISCO - DHCP Snooping에 대한 자세한 내용이 적혀있어요 !!

https://www.cisco.com/c/en/us/td/docs/switches/datacenter/sw/4_1/nx-os/security/configuration/guide/sec_nx-os-cfg/sec_dhcpsnoop.html

반응형

+ Recent posts