반응형

 

 

 

 

 

 

 

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

반응형
반응형

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

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

 

 

 

 

 

오늘은 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을 설치해주세요.

 

 

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

 

 

 

 

 

 

 

 

 

 

감사합니다.

 

 

 

 

반응형
반응형

 

 

 

 

 

Port-Security 란?

특정 포트에 Port-Security 기능을 사용하여 포트에 학습할 수 있는 MAC주소의 수를 제한하거나 포트에 MAC 주소를 설정하여 허가된 MAC 주소만 접속 가능하도록 설정하는 것입니다. 

 

 

 

 

사용 목적
  • 스위치는 하나의 포트에 여러 개의 MAC주소를 학습할 수 있도록 되어있고 제한이 없다.
  • 이러한 점을 이용하여 여러 개의 MAC주소를 학습하게 하여 스위치의 MAC Address table을 가득차게 만들고 더이상 MAC주소를 학습하지 못하게 된 스위치는 그 이후에 들어오는 모든 Frame을 Flooding 시켜 허브처럼 동작하게 만든다. 이러한 공격하는 기법을 MAC Flooding Attack이라고 한다.
  • 내부 네트워크까지 침입한 공격자는 Sniffing 환경을 구성하여 중간에서 패킷을 훔쳐볼 수 있다. 이런 공격으로 대표적인 것은 MAC주소를 변경하여 네트워크 시스템에 들어갈 수 있는 ARP Spoofing이 있다.

 

 

이제 실습을 해보겠습니다.

 

 

GNS3를 이용하여 구성하였습니다.

SW1 가지고 있는 MAC 주소

SW1#show mac address-table 
          Mac Address Table
-------------------------------------------
Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 100    0050.7966.6802    DYNAMIC     Et1/0
 100    0050.7966.6804    DYNAMIC     Et1/1
 100    0050.7966.6805    DYNAMIC     Et1/2
Total Mac Addresses for this criterion: 3

 

 

 

SW2 가지고 있는 MAC 주소

SW2#show mac address-table 
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 100    0050.7966.6806    DYNAMIC     Et1/2
 100    0050.7966.6807    DYNAMIC     Et1/1
 100    0050.7966.6808    DYNAMIC     Et1/0
Total Mac Addresses for this criterion: 3

 

 

 

 

Port-Security 활성화
SW1(config)#interface ethernet 1/0
SW1(config-if)#switchport port-security

 

 

 

 

Port-Security 학습 가능한 최대 MAC주소 개수 설정
SW1(config)#interface ethernet 0/0 
SW1(config-if)#switchport port-security
SW1(config-if)#switchport port-security maximum 5 (기본은 1개 장비마다 다르지만 최대 4097개까지 가능)

 

 

SW2에 MAC주소는 총 3개 입니다. 하지만 Maximum을 2개로 테스트 했을 경우 Log 입니다.

SW1(config-if)#switchport port-security maximum 2

*Mar 26 14:14:01.841: %PM-4-ERR_DISABLE: psecure-violation error detected on Et0/0, putting Et0/0 in err-disable state 
*Mar 26 14:14:01.842: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address 0050.7966.6806 on port Ethernet0/0. 
*Mar 26 14:14:01.842: %IP-4-DUPADDR: Duplicate address 192.168.100.1 on Vlan100, sourced by aabb.cc80.0200 
*Mar 26 14:14:02.847: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to down. 
*Mar 26 14:14:03.843: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to down

 

Port-Security의 학습 3가지 방식

 

Static Port-Security MAC Address

특정 포트에 사용할 사용자의 MAC주소를 직접 입력하여 설정하고 NVRAM에 저장할 수 있다.

SW1(config)#int ethernet 1/0
SW1(config-if)#switchport port-security
SW1(config-if)#switchport port-security mac-address 0050.7966.6804

 

해당 포트에 다른 MAC주소를 설정해놨을때 차단되었다는 Log 입니다.

*Mar 26 14:38:44.398: %PM-4-ERR_DISABLE: psecure-violation error detected on Et1/0, putting Et1/0 in err-disable state
*Mar 26 14:38:44.398: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address 0050.7966.6802 on port Ethernet1/0.
*Mar 26 14:38:45.403: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/0, changed state to down
*Mar 26 14:38:46.399: %LINK-3-UPDOWN: Interface Ethernet1/0, changed state to down

 

 

Dynamic Port-Security MAC Address

특정 포트에 사용할 사용자의 MAC주소를 동적으로 학습하지만 학습한 MAC주소는 NVRAM에 저장할 수 없다

스위치가 Reboot이 되면 Port-Security에 학습했던 MAC주소는 삭제된다.

(명령어 X)

 

 

 

Sticky Port-Security MAC Address

특정 포트에 사용할 사용자의 MAC주소를 동적으로 학습하고, 학습한 MAC주소는 NVRAM에 저장할 수 있다.

스위치가 Reboot이 되어도 Port-Security에 학습했던 MAC주소는 NVRAM에 저장된다.

SW1(config)#interface ethernet 0/0
SW1(config-if)#switchport port-security
SW1(config-if)#switchport port-security mac-address sticky

 

 

 

 

 

Port-Security Violation Mode 3가지

 

Violation shutdown

Port-Security가 동작하는 포트에서 위반했을 경우 해당 포트는 Shutdown이 되며 err-disabled 상태로 넘어간다.

Port-Security Default Violation 이다.

SW1(config)#interface ethernet 0/0
SW1(config-if)#switchport port-security
SW1(config-if)#switchport port-security mac-address 0050.7966.6804
SW1(config-if)#switchport port-security violation shutdown

 

 

 

Violation restrict

Port-Security가 동작하는 포트에서 위반한 MAC주소를 가진 장비의 모든 Frame을 Drop시킨다.

Drop과 동시에 위반한 MAC주소에 대해서 Log가 발생한다.

SW1(config)#interface ethernet 0/0
SW1(config-if)#switchport port-security
SW1(config-if)#switchport port-security maximum 2
SW1(config-if)#switchport port-security violation restrict

 

최대 2개까지 가능하게 했을때 0050.7966.6806의 MAC주소가 제한 되었다는 Log 입니다.

*Mar 26 15:15:47.206: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by MAC address 0050.7966.6806 on port Ethernet0/0.

 

 

 

Violation protect

Port-Security가 동작하는 포트에서 위반한 MAC주소를 가진 장비의 모든 Frame을 Drop시킨다.

restrict와 동일하게 동작하지만, protect는 Log를 발생시키지 않는다.

SW1(config)#interface ethernet 0/0
SW1(config-if)#switchport port-security
SW1(config-if)#switchport port-security maximum 2
SW1(config-if)#switchport port-security violation
SW1(config-if)#switchport port-security violation protect

 

 

 

 

 

 

Port-Security Aging Time 2가지

특정 포트에 Port-Security가 동작하면 해당 포트의 연결된 장비의 MAC주소에 대한 유지 시간을 설정할 수 있다.

포트의 MAC주소 개수를 제한하면서 기존의 MAC주소를 수동으로 삭제하지 않고 aging time을 설정하여 관리할 수 있다. 기본 aging time 은 0분이고 최대 1440분이다.

 

Absolute

특정 포트 Port-Security에 등록된 MAC주소가 설정한 aging time이 만료되어야 Port-Security에 등록된 MAC주소가 삭제된다. 

SW1(config)#interface ethernet 0/0
SW1(config-if)#switchport port-security 
SW1(config-if)#switchport port-security aging time 10
SW1(config-if)#switchport port-security aging type absolute 

  

 

 

Inactivity

특정 포트 Port-Security에 등록된 MAC주소로 설정한 aging time동안 Data Traffic이 없는 경우에 해당 Port-Security에 등록된 MAC주소가 삭제된다.

SW1(config)#interface ethernet 0/0 
SW1(config-if)#switchport port-security  
SW1(config-if)#switchport port-security aging time 10
SW1(config-if)#switchport port-security aging type inactivity

 

 

 

 

 

 

해당 포트에 Port-Security 설정 확인입니다.

SW1#show port-security interface ethernet 0/0
Port Security              : Enabled
Port Status                : Secure-up
Violation Mode             : Restrict
Aging Time                 : 0 mins
Aging Type                 : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses      : 2
Total MAC Addresses        : 2
Configured MAC Addresses   : 0
Sticky MAC Addresses       : 0
Last Source Address:Vlan   : 0050.7966.6806:100 - 가장 마지막에 연결된 MAC주소
Security Violation Count   : 20 - 위반된 MAC주소 횟수

 

 

 

 

저는 스탠다드로 이렇게 사용합니다.

SW1(config)#interface ethernet 0/0 
SW1(config-if)#switchport port-security  
SW1(config-if)#switchport port-security aging time 1
SW1(config-if)#switchport port-security aging type inactivity
SW1(config-if)#switchport port-security maximum 5
SW1(config-if)#switchport port-security violation restrict

 

 

 

 

 

감사합니다 !!

부족한 부분이나 빠진 부분이 있으면 댓글로 남겨주세요.

 

 

자세한 내용은 CISCO 홈페이지에서 확인 가능합니다.

https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst4500/12-2/25ew/configuration/guide/conf/port_sec.html#wp1054687

 

반응형
반응형

네트워크 공부를 하거나 실습을 하기 위해서는 시뮬레이션 프로그램 중에서 GNS3 만큼 좋은게 없다 !!

이제 GNS3 프로그램을 설치 및 설정 과정을 설명해 드리겠습니다.

참고로 제가 공부하기 위해 편하게 기록하는 블로그입니다.

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

 

 

 

 

 

 

오늘은  IOUKeygen과 GNS3 & Virtualbox 연동 설정하는 법을 배워볼거에요.

 

1편을 못보신 분들은 참고해주세요.

https://light-touch-fish.tistory.com/10

 

 

 

 

 

Virtualbox를 실행하여 주세요. 이상태로 GNS3도 실행하여주세요.

 

 

 

 

GNS3 메뉴 탭에서 Edit - Preferences...를&nbsp; 눌러주세요.

 

 

 

 

 

Preferences 창이 뜨면 IOU Devices를 눌러주세요.

 

 

 

 

 

New 를 눌러주세요.

 

 

 

 

이상태로 Next를 눌러주세요.

 

 

 

 

 

Name에 원하는 이름을 넣어주시고 Type만 L2, L3 이미지와 맞춰서 Finish를 눌러주세요.

 

IOU L2, L3 이미지이름으로 구글 검색만 하셔도 바로 나옵니다.

i86bi-linux-l2-ipbasek9-15.1a.bin

i86bi-linux-l3-adventerprisek9-15.5.2T.bin

 

 

 

 

IOU L2, L3를 만들고 위와 같은 상태로 멈춰주시고 Virtualbox로 돌아가주세요.

 

 

 

 

처음화면에서 OK만 눌러주시면 위와 같은 창이 나옵니다. Shell을 선택하여 OK를 눌러주세요.

 

 

 

Shell 화면이 나오면 아래 두줄을 입력하여 주세요. 그리고 [license]부분을 GNS3에 적어주세요.

 

wget http://www.ipvanquish.com/download/CiscoIOUKeygen3f.py 

python3 CiscoIOUKeygen3f.py

 

 

 

Shell에 있던 license를 적어주세요.

 

 

 

 

 

이제 GNS3에서 OK를 눌러주시고 토폴로지 만들어서 사용하시면 됩니다.

 

 

 

 

 

이제 열공합시다. !!

 

 

다음에는 스위치에 대해서 공부해봐요 !!

 

반응형
반응형

네트워크 공부를 하거나 실습을 하기 위해서는 시뮬레이션 프로그램 중에서 GNS3 만큼 좋은게 없다 !!

이제 GNS3 프로그램을 설치 및 설정 과정을 설명해 드리겠습니다.

참고로 제가 공부하기 위해 편하게 기록하는 블로그입니다.

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

 

 

 

 

 

오늘은 GNS3 와 Virtualbox 를 설치 및 설정하는 것을 배워볼거에요.

 

먼저 Virtualbox.org 를 접속하여 설치를 해주세요.

Virtualbox를 설치하면서 큰 문제는 없으니 next를 누르시면서 설치해주세요.

 

 

 

 

gns3.com에 접속하셔서 GNS3 VM에서 Virtualbox용 파일을 설치해주세요.

 

 

 

 

Virtualbox를 설치 후 실행시켜보면 이런 화면이 나옵니다.

 

 

 

 

 

 

메뉴 탭에서 파일을 누르신 후 가상 시스템 가져오기를 눌러주세요.

 

 

 

 

 

가상 시스템 가져오기 팝업이 나오면 파일부분에 Virtualbox용 GNS3 VM.ova를 선택해 주시고 다음 눌러주세요.

 

 

 

 

 

가져오기 눌러주시면 됩니다.

 

 

 

 

 

이상태로 냅두신 후 GNS3를 실행해주세요.

 

 

 

GNS3를 실행하면 Setup Wizard 팝업이 나옵니다. 전글에서 설명이 있으니 모르시는 분은 참고하세요. Next를 눌러주세요.

 

 

 

 

 

설정해주시고 Next 눌러주세요.

 

 

 

 

VirtualBox 체크한 후 Next 눌러주세요.

 

 

 

연동이 끝났습니다. Next를 눌러주세요.

 

 

 

 

여기서 Finish를 눌러주세요.

 

 

 

 

 

GNS3 설정이 끝나면 자동으로 Virtualbox가 실행됩니다. 실행이 안되시면 시작버튼을 눌러주세요.

 

 

다음편에는 IOUKeygen과 GNS3 & Virtualbox 연동 설정하는 법을 공부하겠습니다.

 

 

 

 

반응형

+ Recent posts