Configuring the MCE that uses EBGP to advertise VPN routes to the PE

Network requirements

As shown in Figure 80, configure the MCE to advertise the routes of VPNs 1 and 2 to PE 1, so that the sites of each VPN can communicate with each other over the MPLS backbone.

Run OSPF in both VPN 1 and VPN 2. Run EBGP between the MCE and PE 1.

Figure 80: Network diagram

Configuration procedure

  1. Create VPN instances on the MCE and PE 1, and bind the VPN instances to VLAN interfaces. For the configuration procedure, see "Configuring the MCE that uses OSPF to advertise VPN routes to the PE."

  2. Configure routing between the MCE and VPN sites:

    # Enable an OSPF process on the devices in the two VPNs, and advertise the subnets. (Details not shown.)

    # Configure OSPF on the MCE, and bind OSPF process 10 to VPN instance vpn1 to learn the routes of VPN 1.

    <MCE> system-view
    [MCE] ospf 10 router-id 10.10.10.1 vpn-instance vpn1
    [MCE-ospf-10] area 0
    [MCE-ospf-10-area-0.0.0.0] network 10.214.10.0 0.0.0.255
    [MCE-ospf-10-area-0.0.0.0] quit
    [MCE-ospf-10] quit
    

    # Display the routing table of VPN 1 on the MCE.

    [MCE] display ip routing-table vpn-instance vpn1
    
    Destinations : 13        Routes : 13
    
    Destination/Mask   Proto   Pre Cost        NextHop         Interface
    0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0
    10.214.10.0/24     Direct  0   0           10.214.10.3     Vlan10
    10.214.10.0/32     Direct  0   0           10.214.10.3     Vlan10
    10.214.10.3/32     Direct  0   0           127.0.0.1       InLoop0
    10.214.10.255/32   Direct  0   0           10.214.10.3     Vlan10
    127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
    127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0
    127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
    127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
    192.168.0.0/24     O_INTRA 10  2           10.214.10.2     Vlan10
    224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0
    224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0
    255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
    

    The output shows that the MCE has learned the private route of VPN 1 through OSPF process 10.

    # On the MCE, bind OSPF process 20 to VPN instance vpn2 to learn the routes of VPN 2. The configuration procedure is similar to that for OSPF process 10.

    The output shows that the MCE has learned the private route of VPN 2 through OSPF.

    [MCE] display ip routing-table vpn-instance vpn2
    
    Destinations : 13        Routes : 13
    
    Destination/Mask   Proto   Pre Cost        NextHop         Interface
    0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0
    10.214.20.0/24     Direct  0   0           10.214.20.3     Vlan20
    10.214.20.0/32     Direct  0   0           10.214.20.3     Vlan20
    10.214.20.3/32     Direct  0   0           127.0.0.1       InLoop0
    10.214.20.255/32   Direct  0   0           10.214.20.3     Vlan20
    127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
    127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0
    127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
    127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
    192.168.10.0/24    O_INTRA 10  2           10.214.20.2     Vlan20
    224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0
    224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0
    255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
    
  3. Configure routing between the MCE and PE 1:

    # Configure the ports between the MCE and PE 1 as trunk ports. The configuration procedure is similar to that described in "Configuring the MCE that uses OSPF to advertise VPN routes to the PE." (Details not shown.)

    # Enable BGP in AS 100 on the MCE.

    [MCE] bgp 100
    

    # Enter the BGP-VPN instance view of VPN instance vpn1.

    [MCE-bgp-default] ip vpn-instance vpn1
    

    # Specify the EBGP peer PE 1 in AS 200.

    [MCE-bgp-default-vpn1] peer 30.1.1.2 as-number 200
    

    # Activate the EBGP VPNv4 peer PE 1, and redistribute routing information from OSPF process 10 to BGP.

    [MCE-bgp-default-vpn1] address-family ipv4
    [MCE-bgp-default-ipv4-vpn1] peer 30.1.1.2 enable
    [MCE-bgp-default-ipv4-vpn1] import-route ospf 10
    

    # On PE 1, enable BGP in AS 200, and specify the MCE as its EBGP peer.

    [PE1] bgp 200
    [PE1-bgp-default] ip vpn-instance vpn1
    [PE1-bgp-default-vpn1] peer 30.1.1.1 as-number 100
    [PE1-bgp-default-vpn1] address-family ipv4
    [PE1-bgp-default-ipv4-vpn1] peer 30.1.1.1 enable
    [PE1-bgp-default-ipv4-vpn1] quit
    [PE1-bgp-default-vpn1] quit
    [PE1-bgp-default] quit
    

    # Use similar procedures to configure VPN 2 settings on MCE and PE 1. (Details not shown.)

Verifying the configuration

# Verify that PE 1 has learned the OSPF route of VPN 1 through BGP.

[PE1] display ip routing-table vpn-instance vpn1

Destinations : 13        Routes : 13

Destination/Mask   Proto   Pre Cost        NextHop         Interface
0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0
30.1.1.0/24        Direct  0   0           30.1.1.2        Vlan30
30.1.1.0/32        Direct  0   0           30.1.1.2        Vlan30
30.1.1.2/32        Direct  0   0           127.0.0.1       InLoop0
30.1.1.255/32      Direct  0   0           30.1.1.2        Vlan30
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.0.0/24     BGP     255 3           30.1.1.1        Vlan30
224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0
224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

# Verify that PE 1 has learned the OSPF route of VPN 2 through BGP.

[PE1] display ip routing-table vpn-instance vpn2

Destinations : 13        Routes : 13

Destination/Mask   Proto   Pre Cost        NextHop         Interface
0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0
40.1.1.0/24        Direct  0   0           40.1.1.2        Vlan40
40.1.1.0/32        Direct  0   0           40.1.1.2        Vlan40
40.1.1.2/32        Direct  0   0           127.0.0.1       InLoop0
40.1.1.255/32      Direct  0   0           40.1.1.2        Vlan40
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.10.0/24    BGP     255 3           40.1.1.1        Vlan40
224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0
224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

The MCE has redistributed the OSPF routes of the two VPN instances into the EBGP routing tables of PE 1.