JunOS EX port mirroring


  • Fri 04 January 2019
  • misc

Quick cheat sheet for mirroring a port to a span port:

{% highlight c %} rs@woodburn-bigswitch> show configuration ethernet-switching-options analyzer spanport { ratio 1; input { ingress { interface ge-0/0/0.0; } egress { interface ge-0/0/0.0; } } output { interface { ge-0/0/1.0; } } }

rs@woodburn-bigswitch>

{% endhighlight %}

and for mirroring all ingress traffic to a vlan to a span port:

{% highlight c %} rs@woodburn-bigswitch> show configuration ethernet-switching-options analyzer spanport { ratio 1; input { ingress { vlan woodburn; } } output { interface { ge-0/0/1.0; } } }

rs@woodburn-bigswitch>

{% endhighlight %}

This was done on an EX3200 but I'm sure it will work on other EX models as well.

Note that if you mirror a trunk port you'll get 802.1q tagged traffic out the span port, while if you mirror a vlan you will get untagged traffic.