ERSAPN Configuration on CISCO Nexus

시나리오


1. Source에서 발생하는 트래픽을 Analyzer에서 캡쳐할 수 있도록 포트미러링을 설정해라


Pre-configuration

1. 9K #1
Create vlan 100

interface eth2/5
switchport mode access
switchport access vlan 100

interface vlan 100
ip address 10.0.0.1/24

interface eth1/1
no switchport
ip address 1.1.1.1/30

interface lo0
ip address 10.254.254.1/32

ip route 192.168.0.0 255.255.255.0 1.1.1.2
ip route 10.254.254.2 255.255.255.255 1.1.1.2


2. 9K #2
Create vlan 200

interface eth2/5
switchport mode access
switchport access vlan 200

interface vlan 200
ip address 192.168.0.1/24

interface eth1/2
no switchport
ip address 1.1.1.2/30

interface lo0
ip address 10.254.254.2/32

ip route 10.0.0.0 255.255.255.0 1.1.1.1
ip route 10.254.254.1 255.255.255.255 1.1.1.1


ERSPAN configuration

1. 9K #1
!--모니터 세션 생성
9K#1(config)#monitor session 1 type erspan-source

!--캡쳐할 인터페이스 설정
9K#1(config-erspan-src)#source interface Eth2/5 both

!--mirrored packet을 받아볼 디바이스 IP설정
9K#1(config-erspan-src)#destination ip 192.168.0.10

!--ERSPAN ID 설정 (source 및 destination장비의 ID값이 일치해야 한다)
9K#1(config-erspan-src)#erspan-id 10

!--VRF설정 (따로 사용하는게 없다면 default로 설정)
9K#1(config-erspan-src)#vrf default

!--ERSPAN 활성화 (기본적으로 shutdown 상태이다)
9K#1(config-erspan-src)#no shut

!--ERSPAN의 origin ip설정 (루프백 인터페이스 사용)
9K#1(config)#monitor erspan origin ip-address 10.254.254.1 global


2. 9K #2
!--모니터 세션 생성
9K#2(config)#monitor session 1 type erspan-destination

!--mirrored packet을 캡쳐할 디바이스 설정
9K#2(config-erspan-dst)#source
9K#2(config-erspan-dst-src)#ip address 192.168.0.10

!--ERSPAN ID 설정
9K#2(config-erspan-dst)#erspan-id 10

!--ERSPAN 활성화
9K#2(config-erspan-dst)#no shut


설명

1. SPAN은 포트미러링을 시스코가 부르는 이름이다
2. SPAN의 종류는 SPAN (local span), RSPAN(remote-span), ERSPAN(Encapsulated-RSPAN) 세가지가 있다
3. span은 하나의 장비에서 source포트와 destination포트를 모두 지정할 때 사용
4. RSPAN은 destinationd을 다른 디바이스에 설정할 때 사용. mirroring된 패킷을 remote vlan을 지정하여 L2 VLAN통신으로 다른 디바이스로 전송
5. ERSPAN 역시 다른 디바이스에서 mirroring된 패킷을 받을 때 사용하지만 L2통신이 아닌 L3통신을 통해 전송한다
6. Nexus 9K는 RSPAN 명령어가 존재하지 않는다
7. 생각해보면 RSPAN보다 ERSPAN이 더 깔끔하고 쉽다. RSPAN은 원격지 장비까지 tagging된 vlan통신을 해야하기 때문에 모든 trunk포트에 remote-vlan을 생성해야 하지만 ERSPAN은 IP통신 기반이니 라우팅타고 넘기면 된다.
8. erspan-source장비와 erspan-destination장비는 GRE터널이 생성되며 이를 통해 mirroring된 패킷을 전송하지만 사실 이건 그닥 중요하지 않다
9. erspan-destination장비에 destination port를 설정하는 메뉴가 있는데 이를 통해서는 패킷수집이 되지 않았다 (내가 뭔가 잘못한거겠지)
10. 수집을 담당하는 장비는 어차피 IP통신으로 패킷을 받기 때문에 일반 mirroring상태와는 다르게 데이터통신을 동시에 할 수 있다

댓글

이 블로그의 인기 게시물

ping 일반오류 (General failure)를 고쳐보자

Windows 10. 공유폴더 쉽게 삭제하기 (feat. CMD)

Piolink TiFront Switch password recovery (파이오링크 스위치 비밀번호 초기화)