반응형

 

 

 

 

 

 

 

FHRP (First Hop Redundancy Protocol)

두개 이상의 라우터나 L3 스위치를 논리적으로 하나의 라우터나 L3스위치로 보이게 구성하는 프로토콜입니다.

Gateway 이중화 Protocol 이라고도 합니다.

FHRP 설정은 Gateway 장비에서 실제로 IP 주소가 할당된 L3 interface에 명령어를 입력하여야 합니다.

FHRP에는 HSRP, VRRP, GLBP라는 3가지 종류가 있습니다.

 

 

 

VRRP (Virtual Router Redundancy Protocol)

IEEE RFC에 표준 이중화 프로토콜입니다. HSRP는 시스코 전용으로 주로 VLAN에 설정하지만, VRRP는 벤더 공용으로 VLAN이 조금씩 다르므로 인터페이스에 설정하여 사용합니다. 가상 라우터 IP를 게이트웨이 주소로 주로 사용하며 HSRP와는 다르게 실제 인터페이스의 IP주소를 사용할 수도 있다.

  • 주 라우터 : Master / 백업 라우터 : Backup
  • 우선순위(Priority)가 높은 라우터가 Master라우터가 된다. (기본 100)
  • 인터페이스에 설정하기 때문에 Virtual group을 하나밖에 만들지 못합니다. (VLAN에 설정하면 여러개 가능)
  • 가상 MAC : 0000.5e00.01XX[Group Num]
  • Multicast 224.0.0.18
  • Priority가 같으면 높은 IP를 가진 인터페이스가 Master 라우터가 된다.

 

 

 

VRRP 설정

가상 인터페이스에 설정하였습니다.

 

R1(config)#track 1 interface ethernet 0/1 line-protocol
# 인터페이스 Tracking을 위한 설정 - eth0/1이 죽으면 Backup라우터로 게이트웨이가 넘어감

R1(config)#interface ethernet 0/0.10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip address 10.10.10.2 255.255.255.0
R1(config-subif)#vrrp 1 ip 10.10.10.1 - VRRP Group 번호 설정과 IP를 설정해주세요.
R1(config-subif)#vrrp 1 priority 150 - 우선순위를 설정해주세요.
R1(config-subif)#vrrp 1 timers advertise 3 - VRRP 광고주기를 설정한다.
R1(config-subif)#vrrp 1 timers learn - Master라우터에 VRRP 광고 주기값을 배우도록 설정한다.(모든 장비 같은 설정)
R1(config-subif)#vrrp 1 preempt delay minimum 10 - 장애가 복구되면 Master를 이어받는 대기시간
R1(config-subif)#vrrp 1 authentication md5 key-string vrrp1 - VRRP 인증
R1(config-subif)#vrrp 1 track 1 decrement 30 - track 1에 설정한 eth0/1이 장애 발생시 우선순위를 30 감소
R1(config-subif)#no shutdown

 

# R2 설정

R2(config)#interface ethernet 0/0.10
R2(config-subif)#encapsulation dot1Q 10
R2(config-subif)#ip address 10.10.10.3 255.255.255.0
R2(config-subif)#vrrp 1 ip 10.10.10.1
R2(config-subif)#vrrp 1 priority 140 
R2(config-subif)#vrrp 1 timers advertise 3
R2(config-subif)#vrrp 1 timers learn
R2(config-subif)#vrrp 1 authentication md5 key-string vrrp1
R2(config-subif)#no shutdown

 

 

테스트로 R1의 eth0/1 포트를 Down 시켜 보겠습니다.

 

전

R1#show vrrp brief
Interface     Grp     Pri     Time     Own     Pre     State     Master addr     Group addr
Et0/0.10       1       150     9414                Y      Master      10.10.10.2      10.10.10.1

R2#show vrrp brief
Interface     Grp     Pri     Time     Own     Pre     State     Master addr     Group addr
Et0/0.10       1       140    9453                 Y      Backup      10.10.10.2      10.10.10.1


후

R1#show vrrp brief
Interface     Grp     Pri     Time     Own     Pre     State     Master addr     Group addr 
Et0/0.10       1      120     9414                Y      Backup      10.10.10.3        10.10.10.1

R2#show vrrp brief
Interface     Grp     Pri     Time     Own     Pre     State     Master addr     Group addr 
Et0/0.10       1      140     9453                Y      Master       10.10.10.3        10.10.10.1

 

 

# 장애로그

R1
*Jul 16 10:40:31.421: %TRACK-6-STATE: 1 interface Et0/1 line-protocol Up -> Down
*Jul 16 10:40:39.999: %VRRP-6-STATECHANGE: Et0/0.10 Grp 1 state Master -> Backup

R2
*Jul 16 10:40:39.997: %VRRP-6-STATECHANGE: Et0/0.10 Grp 1 state Backup -> Master

 

 

 

 

 

HSRP (Hot Standby Redundancy Protocol)

Cisco 전용 게이트웨이 이중화 프로토콜로 하나의 네트워크에 여러개의 Gateway를 사용할 때 HSRP가 설정된 Active 라우터가 장애 발생시 Standby 라우터가 Active 라우터로 동작하도록 구성하는 프로토콜입니다.

주게이트웨이와 백업게이트웨이 양쪽에 똑같은 가상 IP, 가상 MAC(0000.0c[vender ID]07.ac01[Group Num])을 사용하여 Standby 게이트웨이를 논리적으로 block 시켜 Active 라우터로만 트래픽이 발생한다.

  • 주 라우터 : Active / 백업 라우터 : Standby
  • 부하분산(Load Balancing)은 제공되지 않습니다.
  • 라우터나 L3 이상의 스위치에서 구성 가능합니다.
  • UDP Port 1985 사용합니다.
  • Hello message를 통하여 우선순위 선정 (Hello 주기 3초, Hold-time 10초)
  • Multicast 224.0.0.2
  • Priority가 같으면 높은 IP를 가진 인터페이스가 Active 라우터가 된다.
  • 가상 MAC(0000.0c[vender ID]07.ac01[Group Num])

 

 

HSRP 동작 시 인터페이스의 상태 변화

  • Initial - HSRP가 동작하지 않음
  • Learn - Hello 패킷 교환 진행중
  • Listen - Hello 패킷 완료 및 주기적 교환.
  • Speak - Hello 패킷 주기적으로 교환, Active 라우터와 Standby 라우터 비교중
  • Standby - Hello 패킷 주기적으로 교환, Standby 라우터 선출
  • Active - Hello 패킷 주기적으로 교환,  Active 라우터 선출

 

 

HSRP 설정

# R1 설정

R1(config)#track 1 interface ethernet 0/1 line-protocol
인터페이스 Tracking을 위한 설정 - eth0/1이 죽으면 Backup라우터로 게이트웨이가 넘어감


R1(config)#interface ethernet 0/0.20
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip address 20.20.20.2 255.255.255.0
R1(config-subif)#standby 1 ip 20.20.20.1 - HSRP Group 번호와 IP 설정
R1(config-subif)#standby 1 priority 250 - 우선순위 설정 
R1(config-subif)#standby 1 timers 1 3 - Hello / hold time 설정 (가장 많이 사용하는 1 / 3 초)
R1(config-subif)#standby 1 preempt delay minimum 5 - 장애 처리 후 우선순위 복구 후 Active라우터 변경시간
R1(config-subif)#standby 1 authentication md5 key-string cisco - HSRP 인증
R1(config-subif)#standby 1 track 1 decrement 100 - track 1에 설정된 eth0/1이 장애시 우선순위 100 감소
R1(config-subif)#no shutdown 



# R2 설정

R2(config)#interface ethernet 0/0.20
R2(config-subif)#encapsulation dot1Q 20 
R2(config-subif)#ip address 20.20.20.3 255.255.255.0
R2(config-subif)#standby 1 ip 20.20.20.1
R2(config-subif)#standby 1 priority 200
R2(config-subif)#standby 1 timers 1 3
R2(config-subif)#standby 1 preempt
R2(config-subif)#standby 1 authentication md5 key-string cisco
R2(config-subif)#no shutdown

 

 

테스트로 R1의 eth0/1 포트를 Down 시켜 보겠습니다.

전
R1#show standby brief
Interface     Grp     Pri     P     State     Active     Standby     Virtual IP
Et0/0.20       1      250     P     Active    local     20.20.20.3    20.20.20.1

R2#show standby brief
Interface     Grp     Pri     P     State     Active     Standby     Virtual IP 
Et0/0.20       1      200     P   Standby  20.20.20.2    local      20.20.20.1

후
R1#show standby brief
Interface     Grp     Pri     P     State     Active     Standby     Virtual IP 
Et0/0.20       1      150     P   Standby  20.20.20.3    local      20.20.20.1

R2#show standby brief
Interface     Grp     Pri     P     State     Active     Standby     Virtual IP 
Et0/0.20       1      200     P    Active     local    20.20.20.2     20.20.20.1

 

 

# 장애로그

R1
*Jul 16 11:26:56.883: %TRACK-6-STATE: 1 interface Et0/1 line-protocol Up -> Down
*Jul 16 11:26:56.926: %HSRP-5-STATECHANGE: Ethernet0/0.20 Grp 1 state Active -> Speak
*Jul 16 11:27:00.443: %HSRP-5-STATECHANGE: Ethernet0/0.20 Grp 1 state Speak -> Standby
*Jul 16 11:27:06.285: %VRRP-6-STATECHANGE: Et0/0.10 Grp 1 state Master -> Backup

R2
*Jul 16 11:26:56.921: %HSRP-5-STATECHANGE: Ethernet0/0.20 Grp 1 state Standby -> Active
*Jul 16 11:27:06.282: %VRRP-6-STATECHANGE: Et0/0.10 Grp 1 state Backup -> Master

 

 

저는 이렇게 사용합니다.

R1

R1(config-subif)#standby 1 ip 20.20.20.1
R1(config-subif)#standby 1 priority 250
R1(config-subif)#standby 1 preempt delay minimum 60
R1(config-subif)#standby 1 track 1 decrement 2


R2

R2(config-subif)#standby 1 ip 20.20.20.1
R2(config-subif)#standby 1 priority 254
R2(config-subif)#standby 1 preempt

 

 

 

 

 

 

감사합니다.

반응형
반응형

 

 

 

 

 

 

Err-disable의 기능이란?

Switch에서 포트에 대해 장애 및 에러유무를 주기적으로 모니터링하며 에러가 발생하면 자동으로 포트가 Errdisabled 상태로 변경되며 Shutdown 상태가 됩니다. 이후 관리자가 조치를 취할 수 있도록 Event Log를 발생시켜줍니다.

Errdisabled 포트를 복구하려면 해당 포트에서 no shutdown 명령어를 입력해주어야 합니다.

 

 

 

 

Errdisable Detect 설정

장비마다 다르지만 아래와 같이 설정 가능한 옵션들이 많이 있습니다.
여기서 자주 사용하는 옵션만 설명 드리겠습니다.

Switch(config)#errdisable detect cause ?
  all                  Enable error detection on all cases
  arp-inspection       Enable error detection for arp inspection
  dhcp-rate-limit      Enable error detection on dhcp-rate-limit
  dtp-flap             Enable error detection on dtp-flapping
  gbic-invalid         Enable error detection on gbic-invalid
  inline-power         Enable error detection for inline-power
  l2ptguard            Enable error detection on l2protocol-tunnel
  link-flap            Enable error detection on linkstate-flapping
  loopback             Enable error detection on loopback
  pagp-flap            Enable error detection on pagp-flapping
  pppoe-ia-rate-limit  Enable error detection on PPPoE IA rate-limit
  psp                  Enable error detection on PSP
  security-violation   Enable error detection on 802.1x-guard
  sfp-config-mismatch  Enable error detection on SFP config mismatch

 

Switch(config)#errdisable detect cause all
모든 옵션을 포함합니다.

Switch(config)#errdisable detect cause dtp-flap
스위치를 Trunk로 연결했을 경우 trunk는 access 와 다르게 모든 VLAN 트래픽을 실어나르기 때문에 어떤 VLAN에 속하는지 표시해주는 헤더가 필요한데 두 스위치가 사용하는 encapsulation 설정이 다를 경우 발생합니다.

Switch(config)#errdisable detect cause link-flap
짧은 시간동안 스위치 포트가 Up/Down을 반복할 떄 발생합니다.

Switch(config)#errdisable detect cause pagp-flap
스위치간 Etherchannel 구성을 통해 여러개의 포트를 하나로 묶었을 때 묶음 조건이 다를 경우(ex=duplex)

Switch(config)#errdisable detect cause udld
STP프로토콜이 동작하기 위해 양방향 BPDU 프레임 교환이 필요한 스위치 연결에서 단방향 연결만 가능하여 STP프로토콜이 제대로 동작할 수 없을 경우에 발생합니다.

Switch(config)#errdisable detect cause rootguard
STP프로토콜의 root 역활을 하는 스위치에 root 스위치로부터 BPDU 프레임이 도착한 경우에 발생합니다.

 

 

 

 

자동으로 Errdisable 포트를 복구하는 명령어에 대해서 알아볼게요.

 

errdisable recovery 설정

Switch(config)#errdisable recovery cause ?
  all                      Enable timer to recover from all error causes
  arp-inspection           Enable timer to recover from arp inspection error disable state
  bpduguard                Enable timer to recover from BPDU Guard error
  channel-misconfig (STP)  Enable timer to recover from channel misconfig error
  dhcp-rate-limit          Enable timer to recover from dhcp-rate-limit error
  dtp-flap                 Enable timer to recover from dtp-flap error
  gbic-invalid             Enable timer to recover from invalid GBIC error
  inline-power             Enable timer to recover from inline-power error
  l2ptguard                Enable timer to recover from l2protocol-tunnel error
  link-flap                Enable timer to recover from link-flap error
  link-monitor-failure     Enable timer to recover from link monitoring failure
  loopback                 Enable timer to recover from loopback error
  mac-limit                Enable timer to recover from mac limit disable state
  oam-remote-failure       Enable timer to recover from OAM detected remote failure
  pagp-flap                Enable timer to recover from pagp-flap error
  port-mode-failure        Enable timer to recover from port mode change failure
  pppoe-ia-rate-limit      Enable timer to recover from PPPoE IA rate-limit error
  psecure-violation        Enable timer to recover from psecure violation error
  psp                      Enable timer to recover from psp
  security-violation       Enable timer to recover from 802.1x violation error
  sfp-config-mismatch      Enable timer to recover from SFP config mismatch error
  storm-control            Enable timer to recover from storm-control error
  udld                     Enable timer to recover from udld error
  unicast-flood            Enable timer to recover from unicast flood error
  vmps                     Enable timer to recover from vmps shutdown error

 

Switch(config)#errdisable recovery cause all (all대신에 하나씩 사용 가능합니다.)
Switch(config)#errdisable recovery interval 30 (기본 복구시간은 300초이고 30~86400초까지 설정가능합니다.)

 

 

 

테스트로 포트를 Errdisable 상태로 만들고 자동 복구가 되는지 확인해봤습니다.

*Jul  9 15:39:44.822: %PM-4-ERR_DISABLE: psecure-violation error detected on Et0/0, putting Et0/0 in err-disable state
*Jul  9 15:39:44.822: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address 0050.7966.6802 on port Ethernet0/0.
*Jul  9 15:39:45.822: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to down
*Jul  9 15:39:46.823: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to down

 

Switch#show errdisable recovery 
ErrDisable Reason            Timer Status
-----------------            --------------
arp-inspection               Enabled
bpduguard                    Enabled
channel-misconfig (STP)      Enabled
dhcp-rate-limit              Enabled
dtp-flap                     Enabled
gbic-invalid                 Enabled
inline-power                 Enabled
l2ptguard                    Enabled
link-flap                    Enabled
mac-limit                    Enabled
link-monitor-failure         Enabled
loopback                     Enabled
oam-remote-failure           Enabled
pagp-flap                    Enabled
port-mode-failure            Enabled
pppoe-ia-rate-limit          Enabled
psecure-violation            Enabled
security-violation           Enabled
sfp-config-mismatch          Enabled
storm-control                Enabled
udld                         Enabled
unicast-flood                Enabled
vmps                         Enabled
psp                          Enabled
dual-active-recovery         Disabled

Timer interval: 30 seconds

Interfaces that will be enabled at the next timeout:

Interface       Errdisable reason       Time left(sec)
---------       -----------------       --------------
Et0/0          psecure-violation           19

 

*Jul  9 15:40:14.813: %PM-4-ERR_RECOVER: Attempting to recover from psecure-violation err-disable state on Et0/0
*Jul  9 15:40:16.813: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Jul  9 15:40:17.813: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up

 

 

 

 

 

 

감사합니다.

반응형
반응형

 

 

 

 

 

 

 

Storm-Control

스위치 포트로 트래픽이 과다하게 수신될 경우 Storm-control 기능을 사용하여 수신하는 트래픽 처리양을 제어 및 관리할 수 있다.  스위치 포트로 유니캐스트, 멀티캐스트, 브로드캐스트 트래픽이 1초 동안 일정 수준 이상으로 수신되면 해당 트래픽을 일시적으로 차단하거나 조절해준다.

 

 

 

 

 

 

테스트는 Cisco Packet Tracer로 시뮬레이션을 진행합니다.

아래와 같이 만들어서 테스트 진행했습니다.

 

Storm-control 설정

장비에 따라 조금 다를 수 있습니다.

 

Storm-control 기능을 사용할 포트를 정해주세요.
Switch(config)#interface range fastEthernet 0/2-4

 

 

Storm-control 기능을 이용하여 제어되는 프레임 유형을 선택할 수 있습니다.
Switch(config-if-range)#storm-control broadcast level
Switch(config-if-range)#storm-control multicast level
Switch(config-if-range)#storm-control unicast level

 

 

Storm-control 기능을 이용해서 포트를 제어할 방법을 설정할 수 있습니다.
Switch(config-if-range)#
storm-control action ?
shutdown 
Shutdown this interface if a storm occurs (설정값보다 초과되면 해당 포트를 Shutdown 한다.)
trap 
Send SNMP trap if a storm occurs (설정값보다 초과되면 SNMP로 메시지를 전송한다.)

 

 

Switch(config-if-range)#storm-control broadcast level ?
<0.00 - 100.00> Enter rising threshold
bps Enter suppression level in bits per second (bps 단위를 사용하여 초당 입력되는 트래픽 용량을 제어한다.)
pps Enter suppression level in packets per second (pps 단위를 사용하여 초당 입력되는 패킷 개수를 제어한다.)

 

 

Switch(config-if-range)#storm-control broadcast level 50 20
해당 포트에서 broadcast 프레임 처리양이 50이 되면 broadcast 프레임을 차단한다.
storm-control action shutdown 설정이 되어있으면 포트를 Shutdown 한다.
해당 포트에서 broadcast 프레임 처리양이 20이 될때까지 broadcast 프레임을 제어한다.

 

 

아래 명령어를 이용해 현재 설정값이랑 사용량을 볼 수 있습니다.
Switch#show storm-control broadcast
Interface Filter State Upper Lower Current
--------- ------------- ----------- ----------- ----------
Fa0/2 Link Up 20.00% 20.00% 0.00%
Fa0/3 Link Up 20.00% 20.00% 0.64%
Fa0/4 Link Up 20.00% 20.00% 0.64%

 

 

 

 

 

 

 

감사합니다.

 

 

 

반응형
반응형

 

 

 

DAI (Dynamic ARP Inspection)

DAI는 스위치 보안 기능으로 네트워크 내에 ARP 패킷의 정당성을 확인하여 통신하게 해주는 설정입니다.

MITM (Man in the Middle) 공격과 같이 MAC, IP의 ARP 패킷을 가로채 훔쳐보거나, 위조하여 공격하는

ARP Poisoning 등을 막기 위하여 사용하는 기능입니다.

 

DAI는 Untrust로 설정된 인터페이스에서 통신되는 패킷을 가로채 확인하여 옳지 않은 MAC-IP 패킷을 로그로 남기고 버린다. Trust된 인터페이스로 패킷이 들어오면 통과시킨다.

 

정확한 MAC-IP의 정당성을 확인하기 위해 DHCP Snooping에 의해 미리 생성된 데이터베이스를 활용한다. 

ACL을 설정하면 DHCP Snooping 보다 우선시 한다. ACL에 거부된 패킷은 DHCP Snooping 데이터베이스를 보지도 않고 거부한다.

 

 

 

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

저번 DHCP Snooping 테스트와 같이 설정을 했습니다. 

 

 

 

 

 

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

SW1(config)#ip arp inspection vlan 10
SW1(config)#interface range ethernet 0/1 - 3 
SW1(config-if-range)#ip arp inspection limit rate 50

 

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

SW1(config)#interface ethernet 0/0
SW1(config-if)#ip arp inspection trust 

 

ip arp inspection vlan [Vlan ID] - DAI를 적용할 Vlan을 입력해주세요.

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

ip arp inspection trust - 스위치가 연결되어있거나 신뢰가능한 인터페이스에 설정해 주세요.

 

 

 

 

 

 

 

테스트로 Untrust 인터페이스에서 ARP 패킷을 전송해 보겠습니다.

*Jun 30 11:51:48.183: %SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Req) on Et0/2, vlan 10.([0050.7966.6804/192.168.10.200/ffff.ffff.ffff/192.168.10.200/13:51:47 EET Tue Jun 30 2020])

*Jun 30 11:51:49.186: %SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Req) on Et0/2, vlan 10.([0050.7966.6804/192.168.10.200/ffff.ffff.ffff/192.168.10.200/13:51:48 EET Tue Jun 30 2020])

*Jun 30 11:51:50.187: %SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Req) on Et0/2, vlan 10.([0050.7966.6804/192.168.10.200/ffff.ffff.ffff/192.168.10.200/13:51:49 EET Tue Jun 30 2020])

이와같이 패킷이 DENY 됩니다.

 

 

 

 

 

 

 

 

DAI 설정된 포트를 확인할 수 있습니다.

SW1#show ip arp inspection interfaces 

 Interface        Trust State     Rate (pps)    Burst Interval
 ---------------  -----------     ----------    --------------
 Et0/0            Trusted                 50                 1
 Et0/1            Untrusted                1                 1
 Et0/2            Untrusted               50                 1
 Et0/3            Untrusted               50                 1

 

 

 

 

DAI 설정된 정보를 볼 수 있습니다.

SW1#show ip arp inspection statistics 

 Vlan      Forwarded        Dropped     DHCP Drops      ACL Drops
 ----      ---------        -------     ----------      ---------
   10              5             21             21              0

 Vlan   DHCP Permits    ACL Permits  Probe Permits   Source MAC Failures
 ----   ------------    -----------  -------------   -------------------
   10              0              0              0                     0

 Vlan   Dest MAC Failures   IP Validation Failures   Invalid Protocol Data
 ----   -----------------   ----------------------   ---------------------
   10                   0                        0                       0

 

 

 

 

 

 

 

 

 

 

감사합니다.

반응형
반응형

 

 

 

 

 

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

반응형
반응형

 

 

 

 

 

DHCP란 ?

사용하는 전자기기가 많아지거나 PC 자체의 변동사항으로 IP 설정이 필요할 경우 매번 관리가 어려워 자동으로 IP를 할당해주는 프로토콜 입니다.

 

 

 

 

DHCP 프로토콜의 원리

DHCP 프로토콜을 통한 IP주소 할당은 임대라는 개념을 가지고 있는데 이는 DHCP 서버가 IP주소를 영구적으로 단말에 할당하는 것이 아니고 임대기간을 설정하여 설정 기간동안만 단말이 IP주소를 사용하도록 하는 것입니다. 임대기간이 끝나면 단말은 임대받은 IP주소를 반납하는 절차를 수행하게 됩니다.

 

 

  • 1 - DHCP Discover (Brodcast)

클라이언트는 DHCP 서버를 찾기 위하여 같은 네트워크상에 Discover 메시지를 브로드캐스트 합니다. 

 

  • 2 - DHCP Offer (Unicast)

클라이언트로부터 Discover 메시지를 받아 DHCP Server는 IP 정보들을 클라이언트에게 제공합니다.

  • 3 - DHCP Request (Brodcast)

클라이언트는 서버로부터 받은 IP 정보들을 할당받겠다고 모든 서버들에게 request 메시지를 보냅니다.

 

  • 4 - DHCP ACK (Unicast)

클라이언트에게 IP 정보를 할당해준 서버로부터 ACK 메시지를 이용해 IP 정보 할당을 승인하겠다는 메시지를 클라이언트에게 보냅니다.

 

 

 

이제 EVE-NG를 이용하여 라우터를 DHCP Server로 만들어 보겠습니다.

아래 그림과 같이 인터페이스 설정 및 Port 설정 Static route 설정이 된 다음에 시뮬레이션을 진행하였습니다.

 

현재 구성은 이렇게 해놨습니다.

 

일단 DHCP Service가 Enable이 기본값이지만 Disabled 상태라면 Enabled 상태로 만들어준다.

R1(config)#service dhcp 
SW1(config)#service dhcp 

 

 

 

 

그리고 DHCP Server로 설정할 라우터에 입력해주시면 됩니다.

 

R1(config)#ip dhcp pool Data10
R1(dhcp-config)#network 192.168.10.0 255.255.255.0
R1(dhcp-config)#default-router 192.168.10.1
R1(dhcp-config)#domain-name cisco.com
R1(dhcp-config)#dns-server 192.168.10.2
R1(config)#ip dhcp pool Data20
R1(dhcp-config)#network 192.168.20.0 255.255.255.0
R1(dhcp-config)#default-router 192.168.10.1
R1(dhcp-config)#domain-name cisco.com
R1(dhcp-config)#dns-server 192.168.10.2

 

pool name은 본인이 마음대로 설정가능합니다.

network는 DHCP로 자동할당하고 싶은 네트워크 대역을 적어주시면 됩니다.

default-router는 네트워크 대역의 게이트웨이를 설정해 주는 것입니다.

따로 DHCP server의 domain-name이 있으면 IP와 적어주시면 됩니다.

 

 

 

그리고 제외하고 싶은 범위를 선택하여 입력해줍니다.

R1(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.10
R1(config)#ip dhcp excluded-address 192.168.20.1 192.168.20.10

 

그리고 VPC에서 확인해봅시다.

VPCS> dhcp 
DDORA IP 192.168.10.11/24 GW 192.168.10.1

VPCS> sh

NAME   IP/MASK              GATEWAY                             GATEWAY
VPCS1  192.168.10.11/24     192.168.10.1
       fe80::250:79ff:fe66:6805/64

같은 네트워크에 있는 VPC는 DHCP를 통하여 문제없이 할당 받았습니다.

 

하지만 다른 대역에 있는 VPC는 할당받지 못하였습니다.

VPCS> dhcp
DDD
Can't find dhcp server

 

이럴때는 R2에서 DHCP 브로드 캐스트 패킷을 받아야하는 포트에 설정해 주세요.

이 작업은 DHCP Relay 설정입니다. 

R2(config)#int ethernet 0/1.20
R2(config-subif)#ip helper-address 192.168.10.1

ip helper-address에 DHCP server 의 게이트웨이를 적어주게 되면 받아올 수 있습니다.

 

 

 

그리고 나서 VPC에서 다시 확인해보면 아래와 같이 나오게 됩니다.

VPCS> dhcp
DORA IP 192.168.20.11/24 GW 192.168.20.1

VPCS> sh

NAME   IP/MASK              GATEWAY                             GATEWAY
VPCS1  192.168.20.11/24     192.168.20.1
       fe80::250:79ff:fe66:6806/64

 

 

 

 

 

 

해당 명령어로 할당한 IP 정보를 볼 수 있습니다.

R1#show ip dhcp binding 

 

 

 

해당 명령어로 DHCP pool 이름과 정보를 볼 수있습니다.

R1#show ip dhcp pool

 

 

 

 

 

 

 

 

감사합니다. 

반응형
반응형

 

 

 

 

 

 

 

 

VTP (VLAN Trunking Protocol)
  • CISCO 전용 프로토콜로 연결된 스위치끼리 VLAN 정보를 자동으로 주고 받아 동기화 하는 프로토콜입니다.

 

VTP 특징
  • VLAN 설정 정보는 받아오지만 스위치 Port 정보들은 받아오지 않는다.
  • 스위치의 기본 설정으로는 Server로 되어 있고 Domain은 설정되어 있지 않다.
  • 확장 VLAN (1006~4094)은 Transparent 모드에서만 사용이 가능하다.
  • VTP 설정하다 문제가 발생할 수 있기에 (패스워드 설정 -> 도메인 설정 -> 모드 설정) 순으로 해야 안전하다.
  • 스위치 순서에도 중요하기에 (VTP 모드 설정 -> Trunk port 설정 -> VLAN 설정 -> Port에 VLAN 설정) 순으로 해줘야 안전하다.
  • 보안상의 문제로 VTP Transparent mode를 권장합니다.

 

VTP 설정 조건
  • 스위치에서는 VTP가 기본적으로 동작되며 끌 수 없는 프로토콜입니다.
  • VTP를 사용하려면 스위치들의 VLAN domain name을 같도록 설정해야지만 VLAN 정보를 동기화 할 수 있습니다.
  • VTP 동기화 메시지를 주고 받으려면 스위치간에 연결된 포트를 Trunk Port로 설정을 해줘야 합니다.
  • VLAN 정보가 무분별하게 동기화 될 수 있기에 VTP password를 설정해주세요. 스위치간에 VTP password가 맞지않으면 동기화 되지 않습니다.

 

 

VTP message 

Summary Advertisement

VTP server가 자신과 연결된 스위치에게 5분 주기로 전달하는 메시지입니다. 

관리하는 VTP domain에 Revision number를 전송한다. 다른 스위치들은 Rivision number를 받아서 자신의 VLAN 정보가 최신인지 아닌지를 구분하고 VLAN 구성에 변화가 생겼을 때에는 즉시 전송합니다.

 

Subset Adverisement

VLAN 구성이 변경 되었을 때나 VTP client로부터 Advertisement Request를 수신했을 때 전송하고 VLAN 정보를 가지고 있는 메시지입니다.

 

Advertisement Request

VTP client가 server에게 메시지를 요청하거나 자신이 가지고 있는 Revision number보다 높은 number를 가지고 있거나 VTP domain 변경 등 여러가지 VLAN에 변화가 생겼을 경우 VTP server에게 전송하는 메시지입니다.

 

 

 

 

 

 

 VTP mode

VTP server mode

VLAN 정보를 직접 생성, 전송할 수 있고 (VLAN 1 ~ 1005)까지만 관리가 가능하다.

 

VTP client mode
같은 domain에 password가 설정된 VTP server로부터 VLAN 정보를 받아 저장한다.

직접 VLAN 정보를 설정할 수 없다.

 

VTP transparent mode

자신만의 VLAN 정보를 설정할 수 있고, 다른 스위치에게 자신의 VLAN 정보를 전송하지 않으며, VTP server로부터 받은 정보로 동기화하지 않지만 받은 정보는 다른 스위치에게 전송한다.

VLAN(1~4094) 생성 및 관리 가능하고 Revision number 값은 항상 0 입니다.

 

 

 

 

 

 

 

 

 

 

먼저 EVE-NG로 Switch를 만들었습니다.

 

기본을 확인해보면 아래와 같습니다.

 

SW1#sh vtp status 
VTP Version capable             : 1 to 3
VTP version running             : 1
VTP Domain Name                 : 
VTP Pruning Mode                : Disabled
VTP Traps Generation            : Disabled
Device ID                       : aabb.cc00.1000
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 0.0.0.0 (no valid interface found)

Feature VLAN:
--------------
VTP Operating Mode                : Server
Maximum VLANs supported locally   : 1005
Number of existing VLANs          : 5
Configuration Revision            : 0
MD5 digest                        : 0x57 0xCD 0x40 0x65 0x63 0x59 0x47 0xBD 
                                    0x56 0x9D 0x4A 0x3E 0xA5 0x69 0x35 0xBC 

 

 

 

SW1(config)#vtp domain Goodluck
Domain name already set to Goodluck.
SW1(config)#vtp password 123123
Setting device VTP password to 123123
SW1(config)#vtp mode server
Device mode already VTP Server for VLANS.
SW1(config)#vtp version 2

 

SW2(config)#vtp domain Goodluck
Changing VTP domain name from NULL to Goodluck
*Jun 25 12:50:43.708: %SW_VLAN-6-VTP_DOMAIN_NAME_CHG: VTP domain name changed to Goodluck.
SW2(config)#vtp password 123123
Setting device VTP password to 123123
SW2(config)#vtp mode transparent
Setting device to VTP Transparent mode for VLANS.
SW2(config)#vtp version 2

 

VTP version은 server에서만 설정이 가능합니다.

SW3(config)#vtp domain Goodluck
Changing VTP domain name from NULL to Goodluck
*Jun 25 12:53:17.094: %SW_VLAN-6-VTP_DOMAIN_NAME_CHG: VTP domain name changed to Goodluck.
SW3(config)#vtp password 123123
Password already set to 123123
SW3(config)#vtp mode client
SW3(config)#vtp version 2 
Cannot modify version in VTP client mode unless the system is in VTP version 3

 

 

 

설정을 해주고나서 SW1에서 VLAN을 만들었습니다.

VLAN 100, 500, 1000, 1500을 만들었는데 위에 설명과 같이 VLAN 1500의 정보는 전송이 안됩니다.

 

 

VTP - server mode

 

 

VTP - transparent mode

 

 

VTP - client mode

 

 

 

 

 

 

VTP pruning (가지치기)

VLAN을 조금 더 효율성있게 관리하기 위해 만든 기술입니다.

스위치를 여러 도메인으로 나누면 브로드캐스트 도메인 크기가 줄어들어 브로드캐스트 트래픽이 감소하게 되는데 Trunk Port는 모든 VLAN의 정보를 전송하기에 필요없는 VLAN 정보로 인하여 트래픽을 발생시킨다.

VLAN 트래픽이 이동할 때 갈 필요가 없는 Trunk Port 방향을 잘라버려 Trunk Port라도 VLAN정보에 대한 트래픽을 수신하지 않게하는 기술입니다.

 

 

SW1#sh vtp status 
VTP Version capable             : 1 to 3
VTP version running             : 2
VTP Domain Name                 : Goodluck
VTP Pruning Mode                : Disabled
VTP Traps Generation            : Disabled
Device ID                       : aabb.cc00.1000
Configuration last modified by 0.0.0.0 at 6-25-20 12:55:44
Local updater ID is 0.0.0.0 (no valid interface found)

Feature VLAN:
--------------
VTP Operating Mode                : Server
Maximum VLANs supported locally   : 1005
Number of existing VLANs          : 8
Configuration Revision            : 4
MD5 digest                        : 0xF3 0xB1 0x90 0x70 0x66 0xA4 0xB6 0x41 
                                    0x9C 0x9F 0x43 0x32 0xFF 0xC1 0x04 0x97 

 

 

VTP - server에서 아래와 같이 입력해주면 연결된 client 들에게 자동으로 설정이 됩니다.

SW1(config)#vtp pruning 
Pruning switched on

 

 

SW3#sh vtp  status 
VTP Version capable             : 1 to 3
VTP version running             : 2
VTP Domain Name                 : Goodluck
VTP Pruning Mode                : Enabled
VTP Traps Generation            : Disabled
Device ID                       : aabb.cc00.3000
Configuration last modified by 0.0.0.0 at 6-25-20 13:11:03

Feature VLAN:
--------------
VTP Operating Mode                : Client
Maximum VLANs supported locally   : 1005
Number of existing VLANs          : 8
Configuration Revision            : 5
MD5 digest                        : 0xCF 0x2E 0x6B 0x98 0x93 0xEF 0x1A 0x08 
                                    0x2C 0x04 0xC3 0x63 0x29 0xDB 0x56 0x83 

 

반응형
반응형

모든 글은 제가 공부하기 위해 편하게 기록하는 블로그입니다.

자세한 설명이 없거나 불편하실 수 있습니다. 감사합니다 !!

 

 

 

 

 

오늘은 EVE-NG에서 CISCO IOU/IOL 설정 하는법에 대해서 공부할거에요.

EVE-NG 관련 IOS 이미지도 받아오셔야 합니다. 구글링하면 금방 받을 수 있어요 !!

 

 

 

 

일단 FileZilla 를 설치해주세요.

filezilla-project.org/download.php?type=client

 

Download FileZilla Client를 눌러서 설치해주세요.

설치하실때 백신프로그램은 꺼주세요..

 

설치가 다됐으면 실행하여 호스트 / 사용자명 / 비밀번호 / 포트를 입력해주세요.

호스트는 VirtualBox에 자신의 IP를 넣어주시면 됩니다. (여러 프로토콜로 SSH, FTP 접속도 가능합니다.)

사용자명은 root, 비밀번호는 초기에 자신이 설정한 비밀번호, 포트는 22번으로 설정해주시면 됩니다.

 

 

 

이제 /root 경로가 아닌 리모트 사이트 부분에 직접 입력하시면 됩니다.

/opt/unetlab/addons/iol/bin 폴더로 들어가 CISCO IOU/IOL.bin 파일을 넣어주세요.

그리고 IOU / IOL을 사용하려면 license key가 필요합니다.

 

 

 

그리고 Virtualbox나 자신의 terminal 프로그램을 이용하여 접속합니다.

저는 SecureCRT를 이용하였습니다.

 

 

위와같이 입력해주세요.

경로로 이동하여 권한을 수정해주는 작업입니다.

cd /opt/unetlab/addons/iol/bin

/opt/unetlab/wrappers/unl_wrapper -a fixpermissions

 

그리고 license key를 얻기위해 실행해 주세요.

python CiscoKeyGen.py 

 

중간에 이부분을 복사해 주세요.

[license]
eve-ng = 972f30267ef51616;

 

 

nano 에디터를 이용하여 nano iourc를 입력해 주세요.

 

아까 복사한 라이센스를 입력하고 ctrl + x 키를 누르고 y를 눌러 저장한다음 enter키를 눌러 나와주세요.

 

 

 

 

그럼이제 iourc가 저장된 모습을 볼 수 있습니다.

 

이제 EVE-NG 사이트를 들어가 Add an object를 눌러 Cisco IOL을 눌러주세요.

 

 

 

L2인지 L3인지 선택해주고 Icon, name을 적어주세요.

 

 

 

 

 

 

 

 

 

 

이제 만들어진 스위치로 우측 클릭하시고 Start 눌른 후 더블클릭 해주시면 콘솔창이 나옵니다.

 

 

 

감사합니다.

 

 

반응형
반응형

모든 글은 제가 공부하기 위해 편하게 기록하는 블로그입니다.

자세한 설명이 없거나 불편하실 수 있습니다. 감사합니다 !!

 

 

 

 

 

오늘은 EVE-NG 설치 및 설정 하는법에 대해서 공부할거에요.

 

 

 

 

일단 VM VirtualBox, VMware 가 설치되어 있어야 합니다.

EVE-NG 관련 IOS 이미지도 받아오셔야 합니다. 구글링하면 금방 받을 수 있어요 !!

 

 

 

 

 

먼저 www.eve-ng.net/index.php/download/#DL-COMM 접속하셔서 Free EVE Community Edition을 눌러주세요.

 

EVE-NG OVF - MEGA mirror, Google mirror 를 눌러 설치해주세요.

 

 

 

 

 

 

설치가 완료 되면 VirtualBox를 실행해서 새로만들기 눌러주시고 설치한 파일을 불러와 주세요.

 

 

그리고 설정을 해야하는데 그냥 작동시키면 WARNING : neither Intel VT-x or AMD-V found 가 발생합니다.

 

그래서 문제를 해결해줘야 하는데요.

 

 

설정 누르고 시스템에 프로세서 부분을 보면 네스티드 VT-x / AMD-V 사용하기가 있는데 아마 회색에 체크가 안될수도 있습니다.

 

 

 

여기서 명령 프롬프트 window + R 키를 눌러 실행창에 cmd 쳐주시면 됩니다.

위와 같이 VirtualBox를 설치한 경로로 이동을 합니다.

그리고 VBoxManage modifyvm <VM-NAME> --nested-hw-virt on 입력해 주세요.

VirtualBox를 기본으로 설치하셨다면 저와 같은 위치에 설치가 되어 있을거에요.

 

 

위와 같이하니 체크가 되어있네요.

 

확인을하고 EVE-NG를 작동시켜주세요.

 

계정은 root / eve 를 입력해주세요

 

 

 

root계정 암호설정인데 화면에 표시가 안되니 신중하게 입력해주고 확인넘어가면 또 입력해주세요.

 

 

 

 

그리고 쭉 넘기다보면 EVE가 설치 완료 되었습니다 .!!

 

이제 아까 설정한 root / 설정한 암호 입력해주면 아래와같이 나옵니다.

 

 

이제 크롬을 켜서 위에 Virtualbox에 나와있는 자신의 IP를 넣어주세요.

계정은 admin / eve 입니다.

 

그리고 https://www.eve-ng.net/index.php/download/#DL-LIN 에서 자신에 운영체제에 맞는 Client Pack을 설치해주세요.

 

 

이제 편하게 네트워크 공부하세요 !!

 

 

 

 

 

 

 

 

 

 

감사합니다.

 

 

 

 

반응형

+ Recent posts