I have been struggling with Q-inQ on my QFX 5100 switches all day and despite reading all the forum posts and KB articles I could find, was not able to find a complete configuration that would work for me on 14.1X53-D42.3. All seemed to be missing the complete S-VLAN interface.
Some of the resources I found are listed below.
http://www.netscreen-support.com/documentation/en_US/junos/topics/task/configuration/qinq-tunneling-qfx-series-dual-tag-rewrite-els.html
https://www.juniper.net/documentation/en_US/junos/topics/task/configuration/qinq-tunneling-qfx-series-els.html
https://eising.wordpress.com/2015/08/26/juniper-els-and-qinq/
I suspect something has changed as of the latest release, because nothing seemed to work and the example configs don't have the uplink configuration.
My setup is pretty simple, using some test switches with SVIs as the traffic initiators on either side of the Q-in-Q tunnel.
TestSW1 <-> QFX5100SW1 <-> QFX5100SW2 <-> TestSW2
QFX5100SW1
set interfaces ge-0/0/0 description "Connection to TestSW1"
set interfaces ge-0/0/0 flexible-vlan-tagging
# Native VLAN ID here refers to the customer's native VLAN
# Some documentation implies this is actually the VLAN ID that will be pushed onto the packet in a new DOT1Q header, but that is not the case
set interfaces ge-0/0/0 native-vlan-id 1
# Probably don't need jumbo frames, but I thought maybe the extra header might push it over 1500 bytes
set interfaces ge-0/0/0 mtu 9216
set interfaces ge-0/0/0 encapsulation extended-vlan-bridge
# What customer VLANs are allowed on the Q-in-Q tunnel
# For my purposes, whatever the customer wants to do is fine by me so I am accepting all VLANs
set interfaces ge-0/0/0 unit 100 vlan-id-list 1-4094
# This is the interesting bit, push VLAN ID 100 onto any frames received on this interface
set interfaces ge-0/0/0 unit 100 input-vlan-map push
# Without the line below nothing worked, I assume because the switch didn't know which VLAN to use for the outer tag
set interfaces ge-0/0/0 unit 100 input-vlan-map vlan-id 100
# Pop the outer VLAN off again before sending out frames with their original VLAN header (or not) intact
set interfaces ge-0/0/0 unit 100 output-vlan-map pop
# I have an AE interface configured, which I figure would be the norm for most people with QFX switches
set interfaces xe-0/0/44 ether-options 802.3ad ae46
set interfaces xe-0/0/45 ether-options 802.3ad ae46
set interfaces ae46 description "L2 interconnect"
# The line below is required or else you can't have a VLAN ID against a unit other than 0
set interfaces ae46 flexible-vlan-tagging
set interfaces ae46 mtu 9216
# I chose flexible-ethernet-services because you can still have a unit 0 with non S-VLANs as members (or so it seems to me)
# Note that this does mean that you have to specify the encapsulation for all units other than 0 and that 0 must be family ethernet switching (again as far as I can tell)
set interfaces ae46 encapsulation flexible-ethernet-services
set interfaces ae46 aggregated-ether-options link-speed 10g
set interfaces ae46 aggregated-ether-options lacp active
set interfaces ae46 aggregated-ether-options lacp periodic fast
# This is where I tell the switch that for unit 100 it should encapsulate as a vlan-bridge
set interfaces ae46 unit 100 encapsulation vlan-bridge
set interfaces ae46 unit 100 vlan-id 100
# The lines below initially confused me since there is no ID listed against the VLAN
# But it seems that JunOS with ELS generates the VLAN ID based on the unit number of the C-VLAN interface
# The purpose of these lines seems to be to stitch together the two logical interfaces to become a kind of switch
# I agree with EISING in his linked article that this is inelegant and shared some of his expletives at the lack of documentation from Juniper
set vlans TEC001_qinq_100 interface ge-0/0/0.100
set vlans TEC001_qinq_100 interface ae46.100
QFX5100SW2 (no comments as it is the same)
set interfaces ge-0/0/0 description "Connection to VasilySwitch"
set interfaces ge-0/0/0 flexible-vlan-tagging
set interfaces ge-0/0/0 native-vlan-id 1
set interfaces ge-0/0/0 mtu 9216
set interfaces ge-0/0/0 encapsulation extended-vlan-bridge
set interfaces ge-0/0/0 unit 100 vlan-id-list 1-4094
set interfaces ge-0/0/0 unit 100 input-vlan-map push
set interfaces ge-0/0/0 unit 100 input-vlan-map vlan-id 100
set interfaces ge-0/0/0 unit 100 output-vlan-map pop
set interfaces xe-0/0/44 ether-options 802.3ad ae46
set interfaces xe-0/0/45 ether-options 802.3ad ae46
set interfaces ae46 description "L2 interconnect"
set interfaces ae46 flexible-vlan-tagging
set interfaces ae46 mtu 9216
set interfaces ae46 encapsulation flexible-ethernet-services
set interfaces ae46 aggregated-ether-options link-speed 10g
set interfaces ae46 aggregated-ether-options lacp active
set interfaces ae46 aggregated-ether-options lacp periodic fast
set interfaces ae46 unit 100 encapsulation vlan-bridge
set interfaces ae46 unit 100 vlan-id 100
set vlans TEC001_qinq_100 interface ge-0/0/0.100
set vlans TEC001_qinq_100 interface ae46.100
TestSW1
vlan 10
name CVLAN10
!
vlan 11
name CVLAN11
!
interface GigabitEthernet0/1
switchport mode trunk
switchport nonegotiate
spanning-tree bpdufilter enable
!
interface Vlan1
ip address 192.168.1.10 255.255.255.0
no ip route-cache
!
interface Vlan10
ip address 192.168.10.10 255.255.255.0
!
interface Vlan11
ip address 192.168.11.10 255.255.255.0
!
TestSW1#ping 192.168.1.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/9 ms
TestSW1#ping 192.168.10.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
TestSW1#ping 192.168.11.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.11.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/9 ms
TestSW2
vlan 10
name CVLAN10
!
vlan 11
name CVLAN11
!
interface GigabitEthernet0/1
switchport mode trunk
switchport nonegotiate
spanning-tree bpdufilter disable
!
interface Vlan1
ip address 192.168.1.20 255.255.255.0
no ip route-cache
!
interface Vlan10
ip address 192.168.10.20 255.255.255.0
!
interface Vlan11
ip address 192.168.11.20 255.255.255.0
!
TestSW2#ping 192.168.1.20
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
TestSW2#ping 192.168.10.20
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms
TestSW2#ping 192.168.11.20
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.11.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms
Hopefully this helps someone else out with their Q-in-Q/QFX/ELS woes.