>_nexthopreachable

JNCIP-ENT: Understanding Q-in-Q

Ali Bahadır Coşkun6 min read

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 10 or 20.
  • 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:

  1. Build the CE side as normal VLAN switching.
  2. Build the PE side with flexible-vlan-tagging, extended-vlan-bridge, and the VLAN maps.
  3. Commit everything successfully.
  4. Check the interface output and see the expected push and pop behavior in the operational view.
  5. Try to pass actual traffic.
  6. 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

  • CE1 and CE2: Customer edge switches
  • PE1 and PE2: Provider edge switches
  • Customer VLANs: 10, 20
  • Service VLAN: 100

Main path:

  • H1 and H3 are in VLAN 10
  • H2 and H4 are in VLAN 20
  • CE1 -> PE1 -> PE2 -> CE2 is the customer path across the provider

What should happen in a working lab:

  • VLAN 10 crosses the provider and stays VLAN 10 from the customer point of view
  • VLAN 20 does 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:

  1. H1 sends traffic to H3.
  2. CE1 places that traffic into VLAN 10.
  3. CE1 sends it toward PE1 over a trunk as VLAN 10.
  4. PE1 matches customer VLAN 10 on the UNI and pushes outer S-VLAN 100.
  5. PE1 sends the double-tagged frame across the provider link to PE2.
  6. PE2 receives service VLAN 100, identifies the service, and pops the outer tag.
  7. CE2 receives customer VLAN 10 and forwards it to H3.

THE CUSTOMER SIDE

On the CE switches we have normal Layer 2 switching. Example for CE1:

junos
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-quit

THE PROVIDER SIDE

This is where the Q-in-Q service happens.

On PE1:

junos
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-quit

PE2 mirrors the same logic on the far side.

The important lines:

  • flexible-vlan-tagging lets the interface handle the tagged setup needed for this lab
  • encapsulation extended-vlan-bridge is required for this style of bridging
  • vlan-id-list [ 10 20 ] matches the customer VLANs on the UNI
  • input-vlan-map push adds the outer service tag
  • output-vlan-map pop removes that outer tag toward the customer
  • unit 100 vlan-id 100 defines 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:

junos
show interfaces xe-0/0/2.100 extensiveshow interfaces xe-0/0/1.100 extensiveshow vlans s100

Tried pinging from hosts:

text
H1> ping 10.10.10.3H2> ping 10.10.20.4

Those 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.