Ejemplo: configuración de circuito de capa 2 basada en Ethernet

En la figura 1, se establece un circuito de capa 2 entre los enrutadores PE1 y PE2 para entregar tráfico de capa 2 entre los enrutadores CE1 y CE2 del cliente. Una conexión de VC de circuito de capa 2 solo se configura en los enrutadores PE. No se requiere ninguna configuración especial en los enrutadores CE, y el enrutador P0 central del proveedor solo requiere MPLS y LDP en las interfaces apropiadas para permitir que las etiquetas se compartan entre los enrutadores PE.
En el enrutador CE1, configure la interfaz Fast Ethernet para manejar el tráfico VLAN. Asegúrese de utilizar el mismo ID de VLAN aquí y en la interfaz Fast Ethernet del enrutador CE2.
Enrutador CE1
[edit] interfaces { fe-1/1/2 { description "to PE1 fe-1/1/0"; vlan-tagging; unit 600 { vlan-id 600; # Be sure this VLAN ID matches the VLAN ID of your CE neighbor. family inet { address 10.1.1.1/24; } } } }
En el enrutador PE1, configure la interfaz orientada a CE basada en Ethernet con el tipo de encapsulación CCC de su elección. Si utiliza CCC de VLAN, incluya la vlan-tagging
instrucción en el nivel de [edit interfaces
ethernet-interface-fpc
jerarquía //pic
.port]
Además, incluya la encapsulation vlan-ccc
instrucción en los ethernet-interface-fpc
[edit interfaces
niveles de jerarquía // y ethernet-interface-fpc
[edit interfaces
//.port
unit
unit-number]
pic
port]
pic
Establezca el circuito de capa 2 con la configuración de la l2circuit
instrucción en el [edit protocols]
nivel jerárquico. Recuerde incluir en la configuración del circuito de capa 2 la dirección IP del vecino de PE remoto (normalmente la dirección de circuito cerrado del vecino), la interfaz conectada al enrutador CE y un identificador de circuito virtual para este VC. A continuación, configure MPLS, LDP y un IGP (como OSPF) para habilitar la señalización para el circuito de capa 2.
Enrutador PE1
[edit] interfaces { so-0/1/0 { description "to P0 so-0/0/0"; unit 0 { family inet { address 192.168.245.22/30; } family mpls; # Include the MPLS family on core-facing interfaces. } } fe-1/1/0 { description "to CE1 fe-1/1/2"; vlan-tagging; encapsulation vlan-ccc; # Configure CCC encapsulation on CE-facing interfaces. unit 600 { encapsulation vlan-ccc; # Enable this encapsulation on the logical interface. vlan-id 600; } } lo0 { unit 0 { family inet { address 10.245.14.173/32; } } } } protocols { ospf { traffic-engineering; area 0.0.0.0 { interface so-0/1/0.0; interface lo0.0; } } ldp { # LDP is required as the signaling protocol for Layer 2 circuits. interface so-0/1/0.0; interface lo0.0;# You must include the loopback address in LDP. } l2circuit { neighbor 10.245.14.179 { # This points to the loopback of the PE neighbor. interface fe-1/1/0.600 { # Here you include the local CE-facing interface. virtual-circuit-id 5; # Be sure this ID matches the ID of your PE neighbor. } } } }
En el enrutador P0, configure LDP, MPLS y OSPF en las interfaces conectadas a los enrutadores PE. El enrutador central proporciona la red troncal MPLS necesaria para tunelizar el tráfico de capa 2 desde el enrutador PR de entrada al enrutador de PE de salida.
Enrutador P0
[edit] interfaces { so-0/0/0 { description "to PE1 so-0/1/0"; unit 0 { family inet { address 192.168.245.21/30; } family mpls; # Include the MPLS family on core interfaces. } } t3-0/2/1 { description "to PE2 t3-0/1/0"; unit 0 { family inet { address 192.168.245.17/30; } family mpls; # Include the MPLS family on core interfaces. } } lo0 { unit 0 { family inet { address 10.245.14.171/32; } } } } protocols { ospf { traffic-engineering; area 0.0.0.0 { interface so-0/0/0.0; interface t3-0/2/1.0; } } ldp { # LDP is required as the signaling protocol for Layer 2 circuits. interface so-0/0/0.0; interface t3-0/2/1.0; } }
En el enrutador PE2, configure instrucciones para que coincidan con las establecidas anteriormente en el enrutador PE1. Configure la interfaz orientada a CE basada en Ethernet con encapsulación CCC. Nuevamente, debe incluir la vlan-tagging
instrucción en el nivel de jerarquía //pic
port]
cuando utilice CCC [edit interfaces
ethernet-interface-fpc
de VLAN. Además, incluya la encapsulation vlan-ccc
instrucción en losethernet-interface-fpc
[edit interfaces
niveles de jerarquía // y ethernet-interface-fpc
[edit interfaces
//.port
unit
unit-number]
pic
port]
pic
Establezca el circuito de capa 2 con la configuración de la l2circuit
instrucción en el [edit protocols]
nivel jerárquico. Recuerde incluir en la configuración del circuito de capa 2 la dirección IP de su vecino de PE remoto (Router PE1), el identificador de circuito virtual configurado previamente en el router PE1 y la interfaz conectada al router CE. Por último, configure MPLS, LDP y OSPF para habilitar la señalización para el circuito de capa 2.
Enrutador PE2
[edit] interfaces { t3-0/1/0 { description "P0 t3-0/2/1"; unit 0 { family inet { address 192.168.245.18/30; } family mpls; # Include the MPLS family on core-facing interfaces. } } fe-0/2/0 { description "to CE2 fe-0/2/0"; vlan-tagging; encapsulation vlan-ccc; # Configure CCC encapsulation on CE-facing interfaces. unit 600 { encapsulation vlan-ccc; # Enable this encapsulation on the logical interface. vlan-id 600; } } lo0 { unit 0 { family inet { address 10.245.14.179/32; } } } } protocols { ospf { traffic-engineering; area 0.0.0.0 { interface t3-0/1/0.0; interface lo0.0; } } ldp { # LDP is required as the signaling protocol for Layer 2 circuits. interface t3-0/1/0.0; interface lo0.0; # You must include the loopback address in LDP. } l2circuit { neighbor 10.245.14.173 { # This points to the loopback of the PE neighbor. interface fe-0/2/0.600 { # Here you include the local CE-facing interface. virtual-circuit-id 5; # Be sure this ID matches the ID of your PE neighbor. } } } }
En el enrutador CE2, configure la interfaz Fast Ethernet para manejar el tráfico VLAN. Asegúrese de utilizar el mismo ID de VLAN en esta interfaz que el que se ve en la interfaz de Fast Ethernet del enrutador CE1.
Enrutador CE2
[edit] interfaces { fe-0/2/0 { description "to PE2 fe-0/2/0"; vlan-tagging; unit 600 { vlan-id 600; # Be sure this VLAN ID matches the VLAN ID of your CE neighbor. family inet { address 10.1.1.2/24; } } } }
Verificación de su trabajo
Para verificar el correcto funcionamiento de los circuitos de capa 2, utilice los siguientes comandos:
ping mpls l2circuit interfaceinterface-name
ping mpls l2circuit virtual-circuit virtual-circuit-id neighbor
ip-address
show l2circuit connections
Opciones:
[brief] | [down] | [extensive] | [history] | [instance] | [local-site] | [remote-site] |[status] | [summary] | [up] | [up-down]
show ldp database
Además de mostrar enlaces para prefijos IP, el show ldp database
comando también muestra los enlaces para los FEC de capa 2.
En las secciones siguientes se muestra el resultado de estos comandos utilizados con el ejemplo de configuración:
Estado PE1 del enrutador
user@PE1> show l2circuit connections Layer-2 Circuit Connections: Legend for connection status (St) Legend for interface status EI -- encapsulation invalid UP -- operational MM -- mtu mismatch Dn -- down EM -- encapsulation mismatch NP -- no present OL -- no outgoing label DS -- disabled Dn -- down WE -- wrong encapsulation VC-Dn -- Virtual circuit Down UN -- uninitialized UP -- operational XX -- unknown Neighbor: 10.245.14.179 Interface Type St Time last up # Up trans fe-1/1/0.600 (vc 5) rmt Up Nov 30 00:54:55 2001 1 Local interface: fe-1/1/0.600, Status: Up, Encapsulation: VLAN Remote PE: 10.245.14.179, Negotiated control-word: Yes (Null) Incoming label: 100007, Outgoing label: 100000 user@PE1> show ldp database Input label database, 10.245.14.173:0-10.245.14.171:0 Label Prefix 100019 10.245.14.173/32 100020 10.245.14.179/32 3 10.245.14.171/32 Output label database, 10.245.14.173:0-10.245.14.171:0 Label Prefix 100009 10.245.14.179/32 3 10.245.14.173/32 100008 10.245.14.171/32 Input label database, 10.245.14.173:0-10.245.14.179:0 Label Prefix 100001 10.245.14.171/32 100002 10.245.14.173/32 3 10.245.14.179/32 100000 L2CKT VLAN VC 5 Output label database, 10.245.14.173:0-10.245.14.179:0 Label Prefix 100009 10.245.14.179/32 3 10.245.14.173/32 100008 10.245.14.171/32 100007 L2CKT VLAN VC 5
Estado del enrutador P0
user@P0> show ldp database Input label database, 10.245.14.171:0-10.245.14.173:0 Label Prefix 3 10.245.14.173/32 100009 10.245.14.179/32 100008 10.245.14.171/32 Output label database, 10.245.14.171:0-10.245.14.173:0 Label Prefix 100019 10.245.14.173/32 100020 10.245.14.179/32 3 10.245.14.171/32 Input label database, 10.245.14.171:0-10.245.14.179:0 Label Prefix 100001 10.245.14.171/32 3 10.245.14.179/32 100002 10.245.14.173/32 Output label database, 10.245.14.171:0-10.245.14.179:0 Label Prefix 100019 10.245.14.173/32 100020 10.245.14.179/32 3 10.245.14.171/32
Estado PE2 del enrutador
user@PE2> show l2circuit connections Layer-2 Circuit Connections: Legend for connection status (St) Legend for interface status EI -- encapsulation invalid UP -- operational MM -- mtu mismatch Dn -- down EM -- encapsulation mismatch NP -- no present OL -- no outgoing label DS -- disabled Dn -- down WE -- wrong encapsulation VC-Dn -- Virtual circuit Down UN -- uninitialized UP -- operational XX -- unknown Neighbor: 10.245.14.173 Interface Type St Time last up # Up trans fe-0/2/0.600 (vc 5) rmt Up Nov 30 00:54:54 2001 1 Local interface: fe-0/2/0.600, Status: Up, Encapsulation: VLAN Remote PE: 10.245.14.173, Negotiated control-word: Yes (Null) Incoming label: 100000, Outgoing label: 100007 user@PE2> show ldp database Input label database, 10.245.14.179:0-10.245.14.171:0 Label Prefix 100019 10.245.14.173/32 3 10.245.14.171/32 100020 10.245.14.179/32 Output label database, 10.245.14.179:0-10.245.14.171:0 Label Prefix 100001 10.245.14.171/32 100002 10.245.14.173/32 3 10.245.14.179/32 Input label database, 10.245.14.179:0-10.245.14.173:0 Label Prefix 3 10.245.14.173/32 100008 10.245.14.171/32 100009 10.245.14.179/32 100007 L2CKT VLAN VC 5 Output label database, 10.245.14.179:0-10.245.14.173:0 Label Prefix 100001 10.245.14.171/32 100002 10.245.14.173/32 3 10.245.14.179/32 100000 L2CKT VLAN VC 5