I have been labbing JNCIP-ENT topics and the latest one I tried was Q-in-Q. I was not even going to write this article because the lab did not actually work. I did all the configs and in the end the hosts still could not ping each other. I spent hours troubleshooting it, assuming I had missed something stupid, only to find out that Q-in-Q does not actually work on vQFX. I had a similar problem before with private VLANs, so apparently I did not learn my lesson.
Still, the topic itself is useful because it might come up in the exam and the config is worth understanding even if the platform turns the lab into a waste of time. So this is less of a success story and more of a postmortem on a lab that should have worked, looked like it worked, and then did not.
WHAT Q-IN-Q IS SUPPOSED TO DO
Normal 802.1Q tagging adds one VLAN tag to an Ethernet frame. Q-in-Q adds a second outer tag.
At a high level:
- The customer sends traffic with its own VLAN tag such as
10or20. - The provider edge adds an outer service tag such as
100. - The provider carries the frame across its network with both tags present.
- The far-end provider edge removes the outer tag before sending the traffic back to the customer side.
The customer keeps using its own VLAN numbering while the provider wraps that traffic inside a service VLAN for transport.
WHERE THE LAB WENT BAD
This how it went down:
- Build the CE side as normal VLAN switching.
- Build the PE side with
flexible-vlan-tagging,extended-vlan-bridge, and the VLAN maps. - Commit everything successfully.
- Check the interface output and see the expected
pushandpopbehavior in the operational view. - Try to pass actual traffic.
- Waste far too much time wondering what stupid thing you missed.
Eventually I stopped treating it like a personal failure and accepted the more likely explanation. This is a platform limitation.
This is one of the more annoying failure modes because the platform does not give clear error. It looks like it works but it doesn't and you end up wasting an afternoon.
THE LAB
CE1andCE2: Customer edge switchesPE1andPE2: Provider edge switches- Customer VLANs:
10,20 - Service VLAN:
100
Main path:
H1andH3are in VLAN10H2andH4are in VLAN20CE1 -> PE1 -> PE2 -> CE2is the customer path across the provider
What should happen in a working lab:
- VLAN
10crosses the provider and stays VLAN10from the customer point of view - VLAN
20does the same - VLAN isolation remains intact
What happened on vQFX:
- the config was fine
- the operational output looked fine
- the actual end result was not fine
WHAT THE TRAFFIC WAS SUPPOSED TO DO
The intended flow was:
H1sends traffic toH3.CE1places that traffic into VLAN10.CE1sends it towardPE1over a trunk as VLAN10.PE1matches customer VLAN10on the UNI andpushes outer S-VLAN100.PE1sends the double-tagged frame across the provider link toPE2.PE2receives service VLAN100, identifies the service, andpops the outer tag.CE2receives customer VLAN10and forwards it toH3.
THE CUSTOMER SIDE
On the CE switches we have normal Layer 2 switching. Example for CE1:
configureset vlans v10 vlan-id 10set vlans v20 vlan-id 20set interfaces xe-0/0/0 unit 0 family ethernet-switching interface-mode accessset interfaces xe-0/0/0 unit 0 family ethernet-switching vlan members v10set interfaces xe-0/0/1 unit 0 family ethernet-switching interface-mode accessset interfaces xe-0/0/1 unit 0 family ethernet-switching vlan members v20set interfaces xe-0/0/2 unit 0 family ethernet-switching interface-mode trunkset interfaces xe-0/0/2 unit 0 family ethernet-switching vlan members [ v10 v20 ]commit and-quitTHE PROVIDER SIDE
This is where the Q-in-Q service happens.
On PE1:
configureset interfaces xe-0/0/2 flexible-vlan-taggingset interfaces xe-0/0/2 encapsulation extended-vlan-bridgeset interfaces xe-0/0/2 unit 100 vlan-id-list [ 10 20 ]set interfaces xe-0/0/2 unit 100 input-vlan-map pushset interfaces xe-0/0/2 unit 100 output-vlan-map popset interfaces xe-0/0/1 mtu 9216set interfaces xe-0/0/1 flexible-vlan-taggingset interfaces xe-0/0/1 encapsulation extended-vlan-bridgeset interfaces xe-0/0/1 unit 100 vlan-id 100set vlans s100 interface xe-0/0/2.100set vlans s100 interface xe-0/0/1.100commit and-quitPE2 mirrors the same logic on the far side.
The important lines:
flexible-vlan-tagginglets the interface handle the tagged setup needed for this labencapsulation extended-vlan-bridgeis required for this style of bridgingvlan-id-list [ 10 20 ]matches the customer VLANs on the UNIinput-vlan-map pushadds the outer service tagoutput-vlan-map popremoves that outer tag toward the customerunit 100 vlan-id 100defines the service VLAN on the NNI
WHAT I EXPECTED TO SEE
At this point I expected the lab to be basically done.
The quick checks on the PE looked fine:
show interfaces xe-0/0/2.100 extensiveshow interfaces xe-0/0/1.100 extensiveshow vlans s100Tried pinging from hosts:
H1> ping 10.10.10.3H2> ping 10.10.20.4Those pings should pass, and traffic between different VLANs should fail. But nothing worked.
FINAL THOUGHTS
I didn't really see Q-in-Q in play but at least I was able to configure it and learn how it works. Customer traffic comes in with its own VLAN tag then provider adds another tag on top, traffic crosses the network, far side removes that outer tag again. In that sense it kind of reminds me of MPLS, not because it is the same thing, but because you are basically wrapping traffic so it can cross somebody else's network. In the end this lab was more useful as a reminder that just because Junos accepts the config does not mean the virtual platform will actually do the thing properly. Sometimes the only thing you really learn from a lab is that the platform is broken and you should have stopped earlier.
