Example for configuring a VC for a service instance

Network requirements

CE 1 and CE 2 are connected to PE 1 and PE 2 through VLAN interfaces.

On PE 1 and PE 2, create a VC for CE 1 and CE 2 in service instance view, so CE 1 and CE 2 can exchange Layer 2 packets across the backbone.

Figure 60: Network diagram

Device

Interface

IP address

Device

Interface

IP address

CE 1

Vlan-int10

100.1.1.1/24

CE 2

Vlan-int10

100.1.1.2/24

PE 1

Loop0

192.2.2.2/32

P

Loop0

192.4.4.4/32

Vlan-int23

23.1.1.1/24

Vlan-int23

23.1.1.2/24

PE 2

Loop0

192.3.3.3/32

Vlan-int26

26.2.2.2/24

Vlan-int26

26.2.2.1/24

Configuration procedure

  1. Configure CE 1:

    # Configure an IP address for the interface connected to PE 1.

    <Sysname> system-view
    [Sysname] sysname CE1
    [CE1] interface vlan-interface 10
    [CE1-Vlan-interface10] ip address 100.1.1.1 24
    
  2. Configure PE 1:

    <Sysname> system-view
    [Sysname] sysname PE1
    [PE1] interface loopback 0
    [PE1-LoopBack0] ip address 192.2.2.2 32
    [PE1-LoopBack0] quit
    

    # Configure the LSR ID and enable MPLS globally.

    [PE1] mpls lsr-id 192.2.2.2
    [PE1] mpls
    [PE1-mpls] quit
    

    # Enable L2VPN and MPLS L2VPN.

    [PE1] l2vpn
    [PE1-l2vpn] mpls l2vpn
    [PE1-l2vpn] quit
    

    # Enable LDP globally.

    [PE1] mpls ldp
    [PE1-mpls-ldp] quit
    

    # Configure PE 1 to establish an LDP remote session with PE 2.

    [PE1] mpls ldp remote-peer 1
    [PE1-mpls-ldp-remote-1] remote-ip 192.3.3.3
    [PE1-mpls-ldp-remote-1] quit
    

    # Configure the interface connected to the P device and enable LDP on the interface.

    [PE1] interface vlan-interface 23
    [PE1-Vlan-interface23] ip address 23.1.1.1 24
    [PE1-Vlan-interface23] mpls
    [PE1-Vlan-interface23] mpls ldp
    [PE1-Vlan-interface23] quit
    

    # Configure OSPF.

    [PE1] ospf
    [PE1-ospf-1] area 0
    [PE1-ospf-1-area-0.0.0.0] network 23.1.1.1 0.0.0.255
    [PE1-ospf-1-area-0.0.0.0] network 192.2.2.2 0.0.0.0
    [PE1-ospf-1-area-0.0.0.0] quit
    [PE1-ospf-1] quit
    

    # On the interface connected to CE 1, create a service instance and then create a VC.

    [PE1] interface gigabitethernet 1/0/1
    [PE1-GigabitEthernet1/0/1] port access vlan 10
    [PE1-GigabitEthernet1/0/1] service-instance 1000
    [PE1-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 10
    [PE1-GigabitEthernet1/0/1-srv1000] xconnect peer 192.3.3.3 pw-id 1000
    [PE1-GigabitEthernet1/0/1-srv1000] quit
    [PE1-GigabitEthernet1/0/1] quit
    
  3. Configure the P device:

    <Sysname> system-view
    [Sysname] sysname P
    [P] interface loopback 0
    [P-LoopBack0] ip address 192.4.4.4 32
    [P-LoopBack0] quit
    

    # Configure the MPLS LSR ID and enable MPLS globally.

    [P] mpls lsr-id 192.4.4.4
    [P] mpls
    [P-mpls] quit
    

    # Enable LDP globally.

    [P] mpls ldp
    [P-mpls-ldp] quit
    

    # Configure the interface connected with PE 1 and enable LDP on the interface.

    [P] interface vlan-interface 23
    [P-Vlan-interface23] ip address 23.1.1.2 24
    [P-Vlan-interface23] mpls
    [P-Vlan-interface23] mpls ldp
    [P-Vlan-interface23] quit
    

    # Configure the interface connected with PE 2 and enable LDP on the interface.

    [P] interface vlan-interface 26
    [P-Vlan-interface26] ip address 26.2.2.2 24
    [P-Vlan-interface26] mpls
    [P-Vlan-interface26] mpls ldp
    [P-Vlan-interface26] quit
    

    # Configure OSPF.

    [P] ospf
    [P-ospf-1] area 0
    [P-ospf-1-area-0.0.0.0] network 23.1.1.2 0.0.0.255
    [P-ospf-1-area-0.0.0.0] network 26.2.2.2 0.0.0.255
    [P-ospf-1-area-0.0.0.0] network 192.4.4.4 0.0.0.0
    [P-ospf-1-area-0.0.0.0] quit
    [P-ospf-1] quit
    
  4. Configure PE 2:

    <Sysname> system-view
    [Sysname] sysname PE2
    [PE2] interface loopback 0
    [PE2-LoopBack0] ip address 192.3.3.3 32
    [PE2-LoopBack0] quit
    

    # Configure the MPLS LSR ID and enable MPLS globally.

    [PE2] mpls lsr-id 192.3.3.3
    [PE2] mpls
    [PE2-mpls] quit
    

    # Enable L2VPN and MPLS L2VPN.

    [PE2] l2vpn
    [PE2-l2vpn] mpls l2vpn
    [PE2-l2vpn] quit
    

    # Enable LDP globally.

    [PE2] mpls ldp
    [PE2-mpls-ldp] quit
    

    # Configure PE 2 to establish a remote LDP connection with PE 1.

    [PE2] mpls ldp remote-peer 2
    [PE2-mpls-ldp-remote-2] remote-ip 192.2.2.2
    [PE2-mpls-ldp-remote-2] quit
    

    # Configure the interface connected to the P device and enable LDP on the interface.

    [PE2] interface vlan-interface 26
    [PE2-Vlan-interface26] ip address 26.2.2.1 24
    [PE2-Vlan-interface26] mpls
    [PE2-Vlan-interface26] mpls ldp
    [PE2-Vlan-interface26] quit
    

    # Configure OSPF.

    [PE2] ospf
    [PE2-ospf-1] area 0
    [PE2-ospf-1-area-0.0.0.0] network 192.3.3.3 0.0.0.0
    [PE2-ospf-1-area-0.0.0.0] network 26.2.2.0 0.0.0.255
    [PE2-ospf-1-area-0.0.0.0] quit
    [PE2-ospf-1] quit
    

    # On the interface connected to CE 2, create a service instance and create a VC.

    [PE2] interface gigabitethernet 1/0/1
    [PE2-GigabitEthernet1/0/1] port access vlan 10
    [PE2-GigabitEthernet1/0/1] service-instance 1000
    [PE2-GigabitEthernet1/0/1-srv1000] encapsulation s-vid 10
    [PE2-GigabitEthernet1/0/1-srv1000] xconnect peer 192.2.2.2 pw-id 1000
    [PE2-GigabitEthernet1/0/1-srv1000] quit
    [PE2-GigabitEthernet1/0/1] quit
    
  5. Configure CE 2:

    # Configure an IP address for the interface connected to PE 2.

    <Sysname> system-view
    [Sysname] sysname CE2
    [CE2] interface vlan-interface 10
    [CE2-Vlan-interface10] ip address 100.1.1.2 24
    
  6. Verify the configuration:

    # Display VC information on PE 1. The output shows that a VC has been established.

    [PE1] display mpls l2vc
    Total ldp vc : 1     1 up       0 down      0 blocked
    
    Transport   Client               Service  VC       Local     Remote
    VC ID       Intf                 ID       State    VC Label  VC Label
    1000        GE1/0/1               1000     up       8193      8192
    

    # Display VC information on PE 2. The output shows that a VC has been established.

    [PE2] display mpls l2vc
    Total ldp vc : 1     1 up       0 down      0 blocked
    
    Transport   Client               Service  VC       Local     Remote
    VC ID       Intf                 ID       State    VC Label  VC Label
    1000        GE1/0/1               1000     up       8192      8193
    

    # Ping CE 2 from CE 1. The output shows that CE 1 and CE 2 can ping each other.

    [CE1] ping 100.1.1.2
      PING 100.1.1.2: 56  data bytes, press CTRL_C to break
        Reply from 100.1.1.2: bytes=56 Sequence=1 ttl=255 time=90 ms
        Reply from 100.1.1.2: bytes=56 Sequence=2 ttl=255 time=77 ms
        Reply from 100.1.1.2: bytes=56 Sequence=3 ttl=255 time=34 ms
        Reply from 100.1.1.2: bytes=56 Sequence=4 ttl=255 time=46 ms
        Reply from 100.1.1.2: bytes=56 Sequence=5 ttl=255 time=94 ms
      --- 100.1.1.2 ping statistics ---
        5 packet(s) transmitted
        5 packet(s) received
        0.00% packet loss
        round-trip min/avg/max = 34/68/94 ms