Redundant Trunk Group

In some scenario, it is more convenient to use RTG to replace STP, e.g. when we do not want to extend the STP domain to “foreign” unmanaged switches, or we want to improve the convergence time. For instance, in the scenario given in the diagram, we will enable RTG on SW3, as we do not want to extend STP domain to VS1 and VS2 (and vice versa).

RTG

Configuration

[edit]
lab@SW03# show interfaces     
ge-0/0/0 {
    description "LINK to VS1";
    unit 0 {
        family ethernet-switching {
            port-mode trunk;
            vlan {
                members 111-112;
            }
        }
    }
}
ge-0/0/1 {
    description "LINK to VS2";
    unit 0 {
        family ethernet-switching {
            port-mode trunk;
            vlan {
                members 111-112;
            }
        }
    }
}

[edit]
lab@SW03# show ethernet-switching-options    
redundant-trunk-group {
    group VS1_and_VS2 {
        preempt-cutover-timer 10;
        interface ge-0/0/0.0 {
            primary;
        }
        interface ge-0/0/1.0;
    }
}

Verification

lab@SW03> show redundant-trunk-group       
Group      Interface   State       Time of last flap                      Flap 
name                                                                      count

VS1_and_VS2 ge-0/0/0.0 Up/Pri/Act  2012-11-28 23:35:08 UTC (00:05:22 ago)     2
           ge-0/0/1.0  Up          Never                                      0

Disable the primary link:

[edit]
lab@MX1# set interfaces ge-1/0/0 disable 

[edit]
lab@MX1# commit 
commit complete

lab@SW03> show redundant-trunk-group    
Group      Interface   State       Time of last flap                      Flap 
name                                                                      count

VS1_and_VS2 ge-0/0/0.0 Dwn/Pri     2012-11-28 23:41:07 UTC (00:00:02 ago)     3
           ge-0/0/1.0  Up/Act      Never                                      0

Recover the primary link:

[edit]
lab@MX1# delete interfaces ge-1/0/0 disable 

[edit]
lab@MX1# commit 

lab@SW03> show redundant-trunk-group    
Group      Interface   State       Time of last flap                      Flap 
name                                                                      count

VS1_and_VS2 ge-0/0/0.0 Up/Pri      2012-11-28 23:41:57 UTC (00:00:07 ago)     4
           ge-0/0/1.0  Up/Act      Never                                      0

Loop will occur if we turn off the redundant trunk group, and RSTP. We may need to trigger the loop by pinging an unknown IP.

lab@SW03# deactivate redundant-trunk-group 

[edit ethernet-switching-options]
lab@SW03# commit 
configuration check succeeds
commit complete

lab@MX1> ping routing-instance VR1 10.10.111.123 
PING 10.10.111.123 (10.10.111.123): 56 data bytes
^C
--- 10.10.111.123 ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss

lab@SW03> monitor interface ge-0/0/0 

SW03                              Seconds: 57                  Time: 23:44:41
                                                          Delay: 0/0/35
Interface: ge-0/0/0, Enabled, Link is Up
Encapsulation: Ethernet, Speed: 1000mbps
Traffic statistics:                                              Current delta
  Input bytes:               17218698648 (167872912 bps)           [507803328]
  Output bytes:              17278235868 (167871376 bps)           [508118046]
  Input packets:               269042160 (327870 pps)                [7934430]
  Output packets:              269972162 (327870 pps)                [7939338]
Error statistics:
  Input errors:                        0                                   [0]
  Input drops:                         0                                   [0]
  Input framing errors:                0                                   [0]
  Policed discards:                    0                                   [0]
  L3 incompletes:                      0                                   [0]
  L2 channel errors:                   0                                   [0]
  L2 mismatch timeouts:                0                                   [0]
  Carrier transitions:                 5                                   [0]
  Output errors:                       0                                   [0]
  Output drops:                        0                                   [0]
  Aged packets:                        0                                   [0]
Active alarms : None
Active defects: None
Input MAC/Filter statistics:
  Unicast packets                      4  Broadcast packets                [0]

Next='n', Quit='q' or ESC, Freeze='f', Thaw='t', Clear='c', Interface='i'

Note that we can not enable both RSTP and RTG on the same interface. The switch will complain if we try to do so. We can still run RTP on certain interfaces, and RSTP on other interfaces though.

[edit ethernet-switching-options]
lab@SW3# activate redundant-trunk-group 

[edit]
lab@SW3# commit 
error: XSTP : msti 0 STP and RTG cannot be enabled on the same interface ge-0/0/0.0
error: configuration check-out failed

[edit protocols rstp]
lab@SW3# set interface ge-0/0/0 disable 

[edit protocols rstp]
lab@SW3# set interface ge-0/0/1 disable    

[edit protocols rstp]
lab@SW3# top 

[edit]
lab@SW3# commit 
configuration check succeeds

lab@SW3> show spanning-tree interface    

Spanning tree interface parameters for instance 0

Interface    Port ID    Designated      Designated         Port    State  Role
                         port ID        bridge ID          Cost
ge-0/0/0.0     128:513       128:41  32768.aa1111111111     20000  DIS    DIS  
ge-0/0/1.0     128:514       128:51   8192.aa2222222222     20000  DIS    DIS

lab@SW3> show redundant-trunk-group 
Group      Interface   State       Time of last flap                      Flap 
name                                                                      count

VS1_and_VS2 ge-0/0/0.0 Up/Pri/Act  Never                                      0
           ge-0/0/1.0  Up          Never                                      0

Reference

http://www.juniper.net/techpubs/en_US/junos11.4/topics/example/cfm-ex-series-redundant-trunk-groups.html

Multiple Spanning Tree Protocol (MSTP)

In this lab, we are going to configure MSTP such that VS2 is the root bridge for MSTP1 (VLAN111) and MSTP2 (VLAN112); VS1 is the root for MSTP 3 and 4. The forwarding path is as shown in the diagram.

MSTP

Configuration

interfaces {
/* … All VS interfaces are configured in trunk mode, using Enterprise Style */ 
    ge-1/0/1 {
        unit 0 {
            family bridge {
                interface-mode trunk;
                vlan-id-list 111-114;
            }
        }
    }

   … 

}

routing-instances {

    VS1 {                               
        instance-type virtual-switch;
        interface ge-1/0/1.0;
        interface ge-1/0/3.0;
        interface ge-1/0/4.0;
        interface ge-1/1/0.0;
        protocols {
            mstp {
                configuration-name lab4;
                revision-level 1;
                system-identifier aa:11:11:11:11:11;
                interface ge-1/0/1;
                interface ge-1/0/3;
                interface ge-1/0/4;
                msti 1 {
                    vlan 111;
                    interface ge-1/0/1 {
                        cost 100;
                    }
                }
                msti 2 {
                    vlan 112;
                    interface ge-1/0/1 {
                        cost 100;
                    }
                }
                msti 3 {                
                    bridge-priority 8k;
                    vlan 113;
                }
                msti 4 {
                    bridge-priority 8k;
                    vlan 114;
                }
            }
        }
        bridge-domains {
            Customer-bds {
                vlan-id-list 111-114;
            }
        }
    }
    VS2 {
        instance-type virtual-switch;
        interface ge-1/0/2.0;
        interface ge-1/1/1.0;
        protocols {
            mstp {
                configuration-name lab4;
                revision-level 1;
                system-identifier aa:22:22:22:22:22;
                interface ge-1/0/2;
                interface ge-1/1/1;     
                msti 1 {
                    bridge-priority 8k;
                    vlan 111;
                }
                msti 2 {
                    bridge-priority 8k;
                    vlan 112;
                }
                msti 3 {
                    vlan 113;
                }
                msti 4 {
                    vlan 114;
                }
            }
        }
        bridge-domains {
            Customer-bds {
                vlan-id-list 111-114;
            }
        }
    }
    VS3 {
        instance-type virtual-switch;
        interface ge-1/0/5.0;
        interface ge-1/1/2.0;           
        interface ge-1/1/3.0;
        interface ge-1/1/4.0;
        protocols {
            mstp {
                configuration-name lab4;
                revision-level 1;
                system-identifier aa:33:33:33:33:33;
                interface ge-1/1/2;
                interface ge-1/1/3;
                interface ge-1/1/4;
                msti 1 {
                    vlan 111;
                    interface ge-1/1/2 {
                        cost 100;
                    }
                }
                msti 2 {
                    vlan 112;
                    interface ge-1/1/2 {
                        cost 100;
                    }
                }
                msti 3 {
                    vlan 113;
                    interface ge-1/1/3 {
                        cost 100;       
                    }
                }
                msti 4 {
                    vlan 114;
                    interface ge-1/1/4 {
                        cost 100;
                    }
                }
            }
        }
        bridge-domains {
            Customer-bds {
                vlan-id-list 111-114;
            }
        }
    }
}

Verification

Check interface forwarding states

lab@MX1> show l2-learning interface 
Routing Instance Name : VS1
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/0/3.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS1
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/0/4.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS3
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/0/5.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS1
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/0/1.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS2
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/1/1.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS2
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/0/2.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Discarding  
                    Custom..   1024       Discarding  
Routing Instance Name : VS1
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/1/0.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS3
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/1/3.0                     8192                   
                    Custom..   1024       Discarding  
                    Custom..   1024       Discarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Discarding  
Routing Instance Name : VS3
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/1/2.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS3
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/1/4.0                     8192                   
                    Custom..   1024       Discarding  
                    Custom..   1024       Discarding  
                    Custom..   1024       Discarding  
                    Custom..   1024       Forwarding

Make sure that all MST instances on all switches agree on the root switch.

lab@MX1> show spanning-tree bridge routing-instance VS1 msti 1 
STP bridge parameters 
Routing instance name               : VS1
Context ID                          : 1
Enabled protocol                    : MSTP

STP bridge parameters for MSTI 1
  MSTI regional root                : 8193.aa:22:22:22:22:22
  Root cost                         : 100
  Root port                         : ge-1/0/1
  Hello time                        : 2 seconds
  Maximum age                       : 20 seconds
  Forward delay                     : 15 seconds
  Hop count                         : 19 
  Number of topology changes        : 3
  Time since last topology change   : 1336 seconds
  Local parameters 
    Bridge ID                       : 32769.aa:11:11:11:11:11

Verify that the spanning tree interface state is as expected

lab@MX1> show spanning-tree interface routing-instance VS1 msti 1 

Spanning tree interface parameters for instance 1

Interface    Port ID    Designated      Designated         Port    State  Role
                         port ID        bridge ID          Cost
ge-1/0/1        128:42       128:52   8193.aa2222222222       100  FWD    ROOT 
ge-1/0/3        128:44       128:44  32769.aa1111111111     20000  FWD    DESG 
ge-1/0/4        128:45       128:45  32769.aa1111111111     20000  FWD    DESG

Rapid Spanning Tree Protocol (RSTP)

In this lab, we are going to configure RSTP with VS2 being the root bridge.

RSTP

Configuration

lab@MX1> show configuration 

interfaces {

/* … All VS interfaces are configured in trunk mode, using Enterprise Style */ 
    ge-1/0/1 {
        unit 0 {
            family bridge {
                interface-mode trunk;
                vlan-id-list 111-114;
            }
        }
    }

    …

}

routing-instances {

    VS1 {                               
        instance-type virtual-switch;
        interface ge-1/0/1.0;
        interface ge-1/0/3.0;
        interface ge-1/0/4.0;
        interface ge-1/1/0.0;
        protocols {
            rstp {
                system-identifier aa:11:11:11:11:11;
                interface ge-1/0/1;
                interface ge-1/0/3;
                interface ge-1/0/4;
            }
        }
        bridge-domains {
            Customer-bds {
                vlan-id-list 111-114;
            }
        }
    }
    VS2 {
        instance-type virtual-switch;
        interface ge-1/0/2.0;
        interface ge-1/1/1.0;
        protocols {
            rstp {
                bridge-priority 8k;     
                system-identifier aa:22:22:22:22:22;
                interface ge-1/0/2;
                interface ge-1/1/1;
            }
        }
        bridge-domains {
            Customer-bds {
                vlan-id-list 111-114;
            }
        }
    }
    VS3 {
        instance-type virtual-switch;
        interface ge-1/0/5.0;
        interface ge-1/1/2.0;
        interface ge-1/1/3.0;
        interface ge-1/1/4.0;
        protocols {
            rstp {
                system-identifier aa:33:33:33:33:33;
                interface ge-1/1/2;
                interface ge-1/1/3;
                interface ge-1/1/4;
            }
        }
        bridge-domains {                
            Customer-bds {
                vlan-id-list 111-114;
            }
        }
    }
}

Verification

Check interface forwarding states

lab@MX1> show l2-learning interface 
Routing Instance Name : VS1
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/0/3.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS1
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/0/4.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS3
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/0/5.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS1
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/0/1.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS2
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/1/1.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS2
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/0/2.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS1
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/1/0.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS3
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/1/3.0                     8192                   
                    Custom..   1024       Discarding  
                    Custom..   1024       Discarding  
                    Custom..   1024       Discarding  
                    Custom..   1024       Discarding  
Routing Instance Name : VS3
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/1/2.0                     8192                   
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
                    Custom..   1024       Forwarding  
Routing Instance Name : VS3
Logical Interface flags (DL -disable learning, AD -packet action drop,
                         LH - MAC limit hit, DN - Interface Down )
Logical             BD         MAC        STP          Logical          
Interface           Name       Limit      State        Interface flags  
ge-1/1/4.0                     8192                   
                    Custom..   1024       Discarding  
                    Custom..   1024       Discarding  
                    Custom..   1024       Discarding  
                    Custom..   1024       Discarding

Make sure that all switches agree on the root switch.

lab@MX1> show spanning-tree bridge routing-instance VS1    
STP bridge parameters 
Routing instance name               : VS1
Context ID                          : 1
Enabled protocol                    : RSTP
  Root ID                           : 8192.aa:22:22:22:22:22
  Root cost                         : 20000
  Root port                         : ge-1/0/1
  Hello time                        : 2 seconds
  Maximum age                       : 20 seconds
  Forward delay                     : 15 seconds
  Message age                       : 1 
  Number of topology changes        : 2
  Time since last topology change   : 55 seconds
  Local parameters 
    Bridge ID                       : 32768.aa:11:11:11:11:11
    Extended system ID              : 0

Verify that the spanning tree interface state is as expected

lab@MX1> show spanning-tree interface routing-instance VS1                

Spanning tree interface parameters for instance 0

Interface    Port ID    Designated      Designated         Port    State  Role
                         port ID        bridge ID          Cost
ge-1/0/1        128:42       128:52   8192.aa2222222222     20000  FWD    ROOT 
ge-1/0/3        128:44       128:44  32768.aa1111111111     20000  FWD    DESG 
ge-1/0/4        128:45       128:45  32768.aa1111111111     20000  FWD    DESG

Q-in-Q

Task

In this lab, we will configure and verify Q-in-Q operation.

QinQ Routed

Step 1: MX5 configured with Access ports, and SW1 & SW2 port are standard access to verify physical connectivity.

MX5

interfaces {
    ge-1/0/2 {
        unit 0 {
            family inet {
                address 10.1.1.1/24;
            }
        }
    }
    ge-1/1/2 {
        unit 0 {
            family inet {
                address 10.1.1.2/24;
            }
        }
    }
}

protocols {
    lldp {
        interface all;
    }
}
routing-instances {
    R2 {
        instance-type virtual-router;
        interface ge-1/1/2.0;
        routing-options {
            router-id 10.1.1.2;
        }
    }
}

SW1

interfaces {
    ge-0/0/0 {
        unit 0 {
            family ethernet-switching {
                port-mode trunk;        
                vlan {
                    members all;
                }
            }
        }
    }

    ge-0/0/2 {
        unit 0 {
            family ethernet-switching;
        }
    }
}

vlans {
    QinQ_Vlan {
        description "Test Q-in-Q VLAN";
        vlan-id 111;
        interface {
            ge-0/0/2.0;
        }
    }
}

SW2

interfaces {
    ge-1/0/0 {
        unit 0 {
            family ethernet-switching {
                port-mode trunk;
                vlan {
                    members all;
                }
            }
        }
    }
    ge-1/0/2 {
        description "TEST to MX5";
        unit 0 {
            family ethernet-switching;
        }
    }
}

vlans {
    QinQ_Vlan {
        description "Test Q-in-Q VLAN";
        vlan-id 111;
        interface {
            ge-1/0/2.0;
        }
    }
}

Verification:

admin@MX5> ping 10.1.1.2    
PING 10.1.1.2 (10.1.1.2): 56 data bytes
64 bytes from 10.1.1.2: icmp_seq=0 ttl=64 time=0.582 ms
64 bytes from 10.1.1.2: icmp_seq=1 ttl=64 time=0.530 ms
^C

Step 2: Convert the MX5 interfaces to the Dot1Q

R1 R2 connectivity will break, as the current switch configuration does not support Dot1Q config.

MX5

interfaces {
    ge-1/0/2 {
        vlan-tagging;
        unit 0 {
            vlan-id 100;
            family inet {
                address 10.1.1.1/24;
            }
        }
    }
    ge-1/1/2 {
        vlan-tagging;
        unit 0 {
            vlan-id 100;
            family inet {
                address 10.1.1.2/24;
            }
        }
    }
}

The pings fail as expected, because EX switches do not expected VLAN tagging on Access Ports.

admin@MX5> ping 10.1.1.2 count 5 rapid       
PING 10.1.1.2 (10.1.1.2): 56 data bytes
.....
--- 10.1.1.2 ping statistics ---
5 packets transmitted, 0 packets received, 100% packet loss

Step 3: Convert the EX interfaces into a Q-in-Q

{master:0}[edit vlans QinQ_Vlan]
admin@SW1# set dot1q-tunneling customer-vlans 1-4094 

{master:0}[edit vlans QinQ_Vlan]
admin@SW1# show 
description "Test Q-in-Q VLAN";
vlan-id 111;
interface {
    ge-0/0/2.0;
}
dot1q-tunneling {
    customer-vlans 1-4094;
}

{master:0}[edit vlans QinQ_Vlan]
admin@SW1# commit 
error: Trunk interface <ge-0/0/0.0> can not be memeber of both dot1q-tunneling enabled vlan <QinQ_Vlan>, and a non dot1q-tunneled vlan <TEST_VLAN> when dot1q-tunneling ethernet-type is not 
error: configuration check-out failed

admin@SW1# top        

{master:0}[edit]
admin@SW1# edit ethernet-switching-options 

{master:0}[edit ethernet-switching-options]
admin@SW1# set dot1q-tunneling ether-type 0x
                                                      ^
'0x' is ambiguous.
Possible completions:
  0x8100               Dot1q ether-type value 0x8100
  0x88a8               Dot1q ether-type value 0x88a8
  0x9100               Dot1q ether-type value 0x9100
{master:0}[edit ethernet-switching-options]
admin@SW1# set dot1q-tunneling ether-type 0x8100 

{master:0}[edit ethernet-switching-options]
admin@SW1# commit

Below is full Q-in-Q switch config:

SW1

ethernet-switching-options {
    dot1q-tunneling {
        ether-type 0x8100;
    } 
}
vlans {
    QinQ_Vlan {
        description "Test Q-in-Q VLAN";
        vlan-id 111;
        interface {
            ge-0/0/2.0;
        }
        dot1q-tunneling {
            customer-vlans 1-4094;
        }
    }
}

interfaces {
    ge-0/0/0 {
        unit 0 {
            family ethernet-switching {
                port-mode trunk;        
                vlan {
                    members all;
                }
            }
        }
    }

    ge-0/0/2 {
        unit 0 {
            family ethernet-switching;
        }
    }
}

SW2


ethernet-switching-options {
    dot1q-tunneling {
        ether-type 0x8100;              
    }
}

vlans {
    QinQ_Vlan {
        description "Test Q-in-Q VLAN";
        vlan-id 111;
        interface {
            ge-1/0/2.0;
        }
        dot1q-tunneling {
            customer-vlans 1-4094;
        }
    }
}

interfaces {
    ge-1/0/0 {
        unit 0 {
            family ethernet-switching {
                port-mode trunk;        
                vlan {
                    members all;
                }
            }
        }
    }

    ge-1/0/2 {
        unit 0 {
            family ethernet-switching;
        }
    }
}

Verification:

admin@MX5> ping 10.1.1.2 count 5 rapid    
PING 10.1.1.2 (10.1.1.2): 56 data bytes
!!!!!
--- 10.1.1.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.418/0.689/1.621/0.469 ms

admin@SW1> show configuration vlans 
QinQ_Vlan {
    description "Test Q-in-Q VLAN";
    vlan-id 111;
    interface {
        ge-0/0/2.0;
    }
    dot1q-tunneling {
        customer-vlans 1-4094;
    }
}

admin@SW1> show vlans QinQ_Vlan extensive 
VLAN: QinQ_Vlan, Created at: Tue Sep 11 09:20:46 2012
802.1Q Tag: 111, Internal index: 5, Admin State: Enabled, Origin: Static
Description: Test Q-in-Q VLAN
Dot1q Tunneling status: Enabled
Customer VLAN ranges:
      1-4094
Protocol: Port Mode, Mac aging time: 300 seconds
Number of interfaces: Tagged 1 (Active = 1), Untagged  1 (Active = 1)
      ge-0/0/0.0*, tagged, trunk
      ge-0/0/2.0*, untagged, access

Step 5: Change MX5 interfaces to use no tagging interface

This is to test if current Q-in-Q support customer’s native VLAN without a tag.

admin@MX5> ping 10.1.1.2 
PING 10.1.1.2 (10.1.1.2): 56 data bytes
^C
--- 10.1.1.2 ping statistics ---
5 packets transmitted, 0 packets received, 100% packet loss

This confirms that the above Q-in-Q config does not support the native VLAN traffic.

Step 6: Change the Q-in-Q config to support customer native VLAN as well

To support customer untagged traffic, change the VLAN dot1q-tunneling configuration options:

admin@SW1> show configuration vlans QinQ_Vlan    
description "Test Q-in-Q VLAN";
vlan-id 111;
interface {
    ge-0/0/2.0;
}
dot1q-tunneling {
    customer-vlans [ native 1-4094 ];
    layer2-protocol-tunneling {
        all;
    }
}

admin@SW2> show configuration vlans QinQ_Vlan 
description "Test Q-in-Q VLAN";
vlan-id 111;
interface {
    ge-1/0/2.0;
}
dot1q-tunneling {
    customer-vlans [ native 1-4094 ];
    layer2-protocol-tunneling {
        all;
    }
}

admin@MX5> ping 10.1.1.2 count 2 
PING 10.1.1.2 (10.1.1.2): 56 data bytes
64 bytes from 10.1.1.2: icmp_seq=0 ttl=64 time=0.604 ms
64 bytes from 10.1.1.2: icmp_seq=1 ttl=64 time=0.530 ms

--- 10.1.1.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.530/0.567/0.604/0.037 ms

Step 7: Create virtual switches to verify that the Q-in-Q successfully carry the L2 control traffic (such as STP)

QinQ Switch

admin@MX5> show configuration interfaces 
ge-1/0/2 {
    unit 0 {
        family bridge {
            interface-mode trunk;
            vlan-id-list 100;
        }
    }
}
ge-1/1/2 {
    unit 0 {
        family bridge {
            interface-mode trunk;
            vlan-id-list 100;
        }
    }
}

admin@MX5> show configuration routing-instances 
CSW1 {
    description "Virtual SW1";
    instance-type virtual-switch;
    interface ge-1/0/2.0;
    protocols {
        rstp {
            bridge-priority 4k;
            system-identifier a8:11:11:11:11:11;
            interface ge-1/0/2;
        }
    }
}
CSW2 {
    description "Virtual SW2";
    instance-type virtual-switch;
    interface ge-1/1/2.0;
    protocols {
        rstp {
            bridge-priority 8k;
            system-identifier a8:22:22:22:22:22;
            interface ge-1/1/2;
        }
    }
}

admin@MX5> show lldp neighbors    
Local Interface Chassis Id        Port info     System Name
ge-1/1/2        a8:d0:e5:55:26:b0  ge-1/0/2     MX5          
ge-1/0/2        a8:d0:e5:55:26:b0  ge-1/1/2     MX5

This confirms that LLDP traffic is carried across Q-in-Q

Below show output confirm that RSTP is working across the Q-in-Q circuit. Note that switches agree on the same STP root, and the switch port roles are expected (designated, root).

admin@MX5> show spanning-tree bridge routing-instance CSW2  
STP bridge parameters 
Routing instance name               : CSW2
Context ID                          : 2
Enabled protocol                    : RSTP
  Root ID                           : 4096.a8:11:11:11:11:11
  Root cost                         : 20000
  Root port                         : ge-1/1/2
  Hello time                        : 2 seconds
  Maximum age                       : 20 seconds
  Forward delay                     : 15 seconds
  Message age                       : 1 
  Number of topology changes        : 2
  Time since last topology change   : 1878 seconds
  Local parameters 
    Bridge ID                       : 8192.a8:22:22:22:22:22
    Extended system ID              : 0

admin@MX5> show spanning-tree bridge routing-instance CSW1       
STP bridge parameters 
Routing instance name               : CSW1
Context ID                          : 1
Enabled protocol                    : RSTP
  Root ID                           : 4096.a8:11:11:11:11:11
  Hello time                        : 2 seconds
  Maximum age                       : 20 seconds
  Forward delay                     : 15 seconds
  Message age                       : 0 
  Number of topology changes        : 3
  Time since last topology change   : 1938 seconds
  Local parameters 
    Bridge ID                       : 4096.a8:11:11:11:11:11
    Extended system ID              : 0

admin@MX5> show spanning-tree interface routing-instance CSW2  

Spanning tree interface parameters for instance 0

Interface    Port ID    Designated      Designated         Port    State  Role
                         port ID        bridge ID          Cost
ge-1/1/2        128:53       128:43   4096.a81111111111     20000  FWD    ROOT 

admin@MX5> show spanning-tree interface routing-instance CSW1    

Spanning tree interface parameters for instance 0

Interface    Port ID    Designated      Designated         Port    State  Role
                         port ID        bridge ID          Cost
ge-1/0/2        128:43       128:43   4096.a81111111111     20000  FWD    DESG

Note:

Note that the “monitor traffic interface” command can not be used to monitor traffic that is switched by EX interfaces, as it is not traffic handled by Routing Engine.

http://www.juniper.net/techpubs/en_US/junos10.0/information-products/topic-collections/swcmdref-basics-services/monitor-traffic.html

Reference:

http://kb.juniper.net/InfoCenter/index?page=content&id=KB12259
http://www.juniper.net/techpubs/en_US/junos10.2/topics/concept/qinq-tunneling-ex-series.html