Exemplo: Configuração de circuito de camada 2 baseada em ethernet

Na Figura 1, um circuito de Camada 2 é estabelecido entre os roteadores PE1 e PE2 para entregar tráfego de Camada 2 entre os roteadores clientes CE1 e CE2. Uma conexão VC de circuito de Camada 2 está configurada apenas nos roteadores PE. Nenhuma configuração especial é necessária nos roteadores CE, e o roteador P0 núcleo do provedor requer apenas MPLS e LDP nas interfaces apropriadas para permitir que os rótulos sejam compartilhados entre os roteadores PE.
No Roteador CE1, configure a interface Ethernet rápida para lidar com o tráfego VLAN. Certifique-se de usar o mesmo VLAN ID aqui e na interface Fast Ethernet do Roteador CE2.
Roteador 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; } } } }
No Roteador PE1, configure a interface voltada para CE baseada em Ethernet com o tipo de encapsulamento CCC de sua escolha. Se você usar o VLAN CCC, inclua a vlan-tagging
declaração no [edit interfaces
ethernet-interface-fpc
nível /pic
/port]
hierarquia. Além disso, inclua a encapsulation vlan-ccc
declaração nos ethernet-interface-fpc
[edit interfaces
níveis /pic
/port]
e [edit interfaces
ethernet-interface-fpc
/pic
/port
unit
unit-number]
hierarquia.
Estabeleça seu circuito de Camada 2 com a configuração da l2circuit
declaração no nível de [edit protocols]
hierarquia. Lembre-se de incluir em sua configuração de circuito de Camada 2 o endereço IP do seu vizinho PE remoto (geralmente o endereço loopback do vizinho), a interface conectada ao roteador CE e um identificador de circuito virtual para este VC. Em seguida, configure MPLS, LDP e um IGP (como OSPF) para habilitar a sinalização para o seu circuito de Camada 2.
Roteador 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. } } } }
No Roteador P0, configure LDP, MPLS e OSPF nas interfaces conectadas aos roteadores PE. O roteador de núcleo fornece o backbone MPLS necessário para tunelar o tráfego de Camada 2 do roteador de RP de entrada até o roteador PE de saída.
Roteador 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; } }
No Roteador PE2, preencha o circuito de Camada 2 configurando declarações para combinar com as definidas anteriormente no Roteador PE1. Configure a interface voltada para CE baseada em Ethernet com encapsulamento de CCC. Novamente, você deve incluir a vlan-tagging
declaração no [edit interfaces
ethernet-interface-fpc
nível /pic
/port]
hierarquia ao usar o VLAN CCC. Além disso, inclua a encapsulation vlan-ccc
declaração nosethernet-interface-fpc
[edit interfaces
níveis /pic
/port]
e [edit interfaces
ethernet-interface-fpc
/pic
/port
unit
unit-number]
hierarquia.
Estabeleça seu circuito de Camada 2 com a configuração da l2circuit
declaração no nível de [edit protocols]
hierarquia. Lembre-se de incluir em sua configuração de circuito de Camada 2 o endereço IP do seu vizinho PE remoto (Roteador PE1), o identificador de circuito virtual previamente configurado no Roteador PE1 e a interface conectada ao roteador CE. Por fim, configure MPLS, LDP e OSPF para habilitar a sinalização para o circuito de Camada 2.
Roteador 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. } } } }
No Roteador CE2, configure a interface Ethernet rápida para lidar com o tráfego VLAN. Certifique-se de usar o mesmo VLAN ID nesta interface que o visto na interface Fast Ethernet do Roteador CE1.
Roteador 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; } } } }
Verificando seu trabalho
Para verificar a operação adequada dos circuitos de Camada 2, use os seguintes comandos:
ping mpls l2circuit interfaceinterface-name
ping mpls l2circuit virtual-circuit virtual-circuit-id neighbor
ip-address
show l2circuit connections
Opções:
[brief] | [down] | [extensive] | [history] | [instance] | [local-site] | [remote-site] |[status] | [summary] | [up] | [up-down]
show ldp database
Além de exibir ligações para prefixos IP, o show ldp database
comando também exibe as ligações para os FECs de Camada 2.
As seções a seguir mostram a saída desses comandos usados com o exemplo de configuração:
Status do roteador PE1
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
Status do roteador 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
Status do Roteador PE2
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