# ERSPAN type II decpasulation/processing

**URL:** <https://forum.suricata.io/t/erspan-type-ii-decpasulation-processing/242>\
**Category:** Help\
**Tags:** ips\
**Created:** [May 20, 2020, 1:40pm UTC](https://forum.suricata.io/t/erspan-type-ii-decpasulation-processing/242 "2020-05-20T13:40:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgs240](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jgs240](https://forum.suricata.io/u/jgs240)\
**Post date:** [May 20, 2020, 1:40pm UTC](https://forum.suricata.io/t/erspan-type-ii-decpasulation-processing/242/1 "2020-05-20T13:40:47Z")

</div>

I see in the src that there is a mention of processing ERSPAN type II traffic:

> <https://github.com/OISF/suricata/blob/master/src/decode-erspan.c>

I can’t find how to invoke this or implement it…does anyone know how to use this?

Edit: I think my question might be too vague (sorry!). Does anyone know how to get Suricata to process ERSPAN traffic?

---

<div class="post-metadata">

**Author:** ![Jeff\_Lucovsky](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/jeff_lucovsky/32/11_2.png) [@Jeff\_Lucovsky](https://forum.suricata.io/u/Jeff_Lucovsky)\
**Post date:** [May 20, 2020, 1:49pm UTC](https://forum.suricata.io/t/erspan-type-ii-decpasulation-processing/242/2 "2020-05-20T13:49:16Z")

</div>

Encapsulated remote SPAN (ERSPAN) is a tunneling protocol – [https://community.cisco.com/t5/networking-documents/understanding-span-rspan-and-erspan/ta-p/3144951](https://community.cisco.com/t5/networking-documents/understanding-span-rspan-and-erspan/ta-p/3144951).

Does it apply to your deployment?

---

<div class="post-metadata">

**Author:** ![jgs240](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jgs240](https://forum.suricata.io/u/jgs240)\
**Post date:** [May 20, 2020, 1:54pm UTC](https://forum.suricata.io/t/erspan-type-ii-decpasulation-processing/242/3 "2020-05-20T13:54:21Z")

</div>

Yes that applies, that is what we are using to send traffic to Suricata (ERSPAN type II). I updated the OP with a clarified question. I am very familiar with ERSPAN/GRE tunneling, just can’t get Suricata to process it.

---

<div class="post-metadata">

**Author:** ![Jeff\_Lucovsky](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/jeff_lucovsky/32/11_2.png) [@Jeff\_Lucovsky](https://forum.suricata.io/u/Jeff_Lucovsky)\
**Post date:** [May 20, 2020, 2:00pm UTC](https://forum.suricata.io/t/erspan-type-ii-decpasulation-processing/242/4 "2020-05-20T14:00:58Z")

</div>

What version of Suricata are you using?

With 5.0.3 and later, ERSPAN Type II traffic is processed. The statistic `decoder.erspan` reflects how many ERSPAN packets are seen.

ERSPAN Type I traffic must be configured with `decoder.erspan.typeI.enabled` (default: off)

ERSPAN’s ethertype value is `0x88BE`. We use this to determine if it’s Type I or Type II:

```auto
GRE Header bits
Type I: 0|0|0|0|0|00000|000000000|00000
Type II: 0|0|0|1|0|00000|000000000|00000

```

---

<div class="post-metadata">

**Author:** ![jgs240](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jgs240](https://forum.suricata.io/u/jgs240)\
**Post date:** [May 20, 2020, 2:29pm UTC](https://forum.suricata.io/t/erspan-type-ii-decpasulation-processing/242/5 "2020-05-20T14:29:08Z")

</div>

Thanks Jeff!

We are on 5.0.3.

I had to enable type I and this got the processing working! I don’t see decorder.erspan in stats.log though, is this located somewhere else?

---

<div class="post-metadata">

**Author:** ![Jeff\_Lucovsky](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/jeff_lucovsky/32/11_2.png) [@Jeff\_Lucovsky](https://forum.suricata.io/u/Jeff_Lucovsky)\
**Post date:** [May 20, 2020, 2:34pm UTC](https://forum.suricata.io/t/erspan-type-ii-decpasulation-processing/242/6 "2020-05-20T14:34:44Z")

</div>

It’s in `stats.log`, e.g.,

```auto
 $ grep decoder.erspan stats.log
decoder.erspan | Total | 84
$

```

its value must be \> 0 to be included.

---

<div class="post-metadata">

**Author:** ![jgs240](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jgs240](https://forum.suricata.io/u/jgs240)\
**Post date:** [May 20, 2020, 2:41pm UTC](https://forum.suricata.io/t/erspan-type-ii-decpasulation-processing/242/7 "2020-05-20T14:41:07Z")

</div>

That was it, thanks again! This solves many issues for me!
