[PE2-ospf-100] import-route bgp
[PE2-ospf-100] domain-id 10
[PE2-ospf-100] area 0
[PE2-ospf-100-area-0.0.0.0] network 120.1.1.0 0.0.0.255
[PE2-ospf-100-area-0.0.0.0] quit
[PE2-ospf-100] quit
[PE2] bgp 100
[PE2-bgp] ipv4-family vpn-instance vpn1
[PE2-bgp-vpn1] import-route direct
[PE2-bgp-vpn1] import-route ospf 100
[PE2-bgp-vpn1] quit
[PE2-bgp] quit
After the configuration, run the display ip routing-table vpn-instance command on the PEs,
and you can see that the routes to the peer CEs are OSPF routes through the backbone network,
not the BGP routes through the user network.
Take PE1 for example.
[PE1] display ip routing-table vpn-instance vpn1
Route Flags: R - relied, D - download to fib
------------------------------------------------------------------------------
Routing Tables: vpn1
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost Flags NextHop Interface
20.1.1.0/24 OSPF 10 2 D 100.1.1.1 Vlanif50
30.1.1.0/24 OSPF 10 3 D 100.1.1.1 Vlanif50
100.1.1.0/24 Direct 0 0 D 100.1.1.2 Vlanif50
100.1.1.2/32 Direct 0 0 D 127.0.0.1 Vlanif50
120.1.1.0/24 OSPF 10 4 D 100.1.1.1 Vlanif50
Step 4 Configure a sham link.
NOTE
To forward VPN traffic through the MPLS backbone, you must configure the cost of the sham link to be
smaller than the cost of the OSPF route through the user network. A commonly used method is to set the
cost of the forwarding interface on the user network to be greater than the cost of the sham link.
# Configure CE1.
[CE1] interface vlanif 20
[CE1-Vlanif20] ospf cost 10
# Configure CE2.
[CE2] interface vlanif 30
[CE2-Vlanif30] ospf cost 10
# Configure PE1.
[PE1] interface loopback 10
[PE1-LoopBack10] ip binding vpn-instance vpn1
[PE1-LoopBack10] ip address 5.5.5.5 32
[PE1-LoopBack10] quit
[PE1] ospf 100
[PE1-ospf-100] area 0
[PE1-ospf-100-area-0.0.0.0] sham-link 5.5.5.5 6.6.6.6 cost 1
[PE1-ospf-100-area-0.0.0.0] quit
[PE1-ospf-100] quit
# Configure PE2.
[PE2] interface loopback 10
[PE2-LoopBack10] ip binding vpn-instance vpn1
[PE2-LoopBack10] ip address 6.6.6.6 32
[PE2-LoopBack10] quit
[PE2] ospf 100
[PE2-ospf-100] area 0
3 BGP/MPLS IP VPN Configuration
Quidway S9300 Terabit Routing Switch
Configuration Guide - VPN
3-120 Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
Issue 03 (2009-08-20)