Vlan – Juniper mirroring trunk ports

juniper-exmirrorvlan

I have a virtual chassis of 2 EX4600-40f. The 4 ports (0/0/1, 0/0/2, 0/0/3, 0/0/4) where my ESX are connected are configured in trunk mode with some vlans.
I would like to copy the traffic (tagged) of my 4 ESX to a port (1/0/27) in order to analyze it.

I already configured an analyzer on the swtich :

input {
    ingress {
        interface xe-0/0/1.0;
        interface xe-0/0/2.0;
        interface xe-0/0/3.0;
        interface xe-0/0/4.0;
    }
    egress {
        interface xe-0/0/1.0;
        interface xe-0/0/2.0;
        interface xe-0/0/3.0;
        interface xe-0/0/4.0;
    }
}
output {
    interface xe-1/0/21.0;
}

ports to be mirrored config :

xe-0/0/2 {
    unit 0 {family ethernet-switching {
            interface-mode trunk;
            vlan {
                members [ 15 51 123 207 2260-2263 ];

port to connect the network analyzer :

xe-1/0/21 {
unit 0 {
    family ethernet-switching {
        interface-mode access;

But I have incorrect vlan tag on packet received by the server on the port 1/0/21, half of the traffic is tagged and the rest is not.

How can I do ?
Is it possible to mirror a trunk port and keep tags?

Thanks in advance for your answers

Best Answer

Try to put interface xe-1/0/21 in trunk mode instead of access. I recall by experience on MX platform that I had to set a similar option on mirror port while doing layer2 mirroring for the packets to keep the tag. So maybe the same trick will do the job on EX. I didnt find documentation on this though.