01-07 BGP Mpls Ip VPN Configuration
01-07 BGP Mpls Ip VPN Configuration
An enterprise can build its own BGP/MPLS IP VPN network to implement secure
interconnection between its headquarters and branches. The BGP/MPLS IP VPN
network ensures high-quality communication within the enterprise network.
7.1 Overview of BGP/MPLS IP VPN
This section describes the definition, background, and functions of BGP/MPLS IP
VPN.
7.2 Understanding BGP/MPLS IP VPN
This section describes the implementation of BGP/MPLS IP VPN.
7.3 Application Scenarios for BGP/MPLS IP VPN
This section describes the application scenarios for BGP/MPLS IP VPN.
7.4 Summary of BGP/MPLS IP VPN Configuration Tasks
After basic BGP/MPLS IP VPN configurations are complete, a simple VPN network
can be established using MPLS technology. To deploy special BGP/MPLS IP VPN
networking, perform other configuration tasks according to the reference sections
provided in the following table.
7.5 Licensing Requirements and Limitations for BGP/MPLS IP VPN
7.6 Default Settings for BGP/MPLS IP VPN
This section describes the default settings for BGP/MPLS IP VPN.
7.7 Configuring BGP/MPLS IP VPN
This section describes the procedures for configuring BGP/MPLS IP VPN functions.
7.8 Maintaining BGP/MPLS IP VPN
You can check route summary information in a VPN instance, monitor network
connectivity, and reset BGP connections when maintaining a BGP/MPLS IP VPN
network.
7.9 Configuration Examples for BGP/MPLS IP VPN
This section provides several configuration examples of BGP/MPLS IP VPN
networking. In each configuration example, the networking requirements,
configuration roadmap, configuration procedures, and configuration files are
provided.
Definition
A BGP/MPLS IP VPN is a Layer 3 virtual private network (L3VPN). A BGP/MPLS IP
VPN uses the Border Gateway Protocol (BGP) to advertise VPN routes and uses
Multiprotocol Label Switching (MPLS) to forward VPN packets on backbone
networks. Here, IP that Internet Protocol (IP) packets are carried by the VPN.
Figure 7-1 shows the BGP/MPLS IP VPN model.
VPN 2
VPN 1 CE Site
Site IP/MPLS
CE
P Backbone P
PE
PE
PE
VPN 2 P P
VPN 1
Site
CE Site
CE
Purpose
A traditional VPN sets up full-mesh tunnels or permanent virtual circuits (PVCs)
between all sites to forward VPN data. This method makes networks difficult to
maintain and expand. When a new site is added to an established VPN, a network
administrator must modify the configuration of all edge nodes connected to this
site.
A BGP/MPLS IP VPN uses a peer model that enables SPs and customers to
exchange routing information. The SPs are responsible for forwarding data of
customers, without participation of the customers. A BGP/MPLS IP VPN is more
scalable and more easier to manage than a traditional VPN. When a new site is
added, a network administrator only needs to modify the configuration of the
edge nodes serving the new site.
BGP/MPLS IP VPN allows overlapping address spaces and overlapping VPNs so
that VPNs can be flexibly deployed and expanded. In addition, BGP/MPLS IP VPN
supports MPLS Traffic Engineering (TE). Because of these merits, BGP/MPLS IP
VPN becomes an important approach for IP network carriers to provide value-
added services and is now widely used.
7.2.1 Concepts
Site
The site is frequently mentioned in VPN technology. The following describes a site
from different aspects:
● A site is a group of IP systems with IP connectivity, which can be achieved
independent of SP networks.
Figure 7-2 shows an example of sites. On the networks on the left side in
Figure 7-2, the headquarters of company X in city A is a site, and the branch
of company X in city B is another site. IP devices can communicate within
each site without using the carrier network.
Site A Site X
CE
CE
Carrier's Carrier's Headquarters
network Headquarters network
of X company of X company
in City A in City A
Router
CE
Branch of X Branch of X
company in company in
City B City B
Site B
● Sites are configured based on topologies between devices but not their
geographic locations, although devices in a site are geographically adjacent to
each other in most cases. Two geographically separated IP systems can also
compose a site if they are connected through leased lines and can
communicate without the use of the carrier network.
On the right of Figure 7-2, the branch network in city B connects to the
headquarters network in city A through leased lines but not a carrier network.
The branch network and the headquarters network compose a site.
● The devices in a site may belong to multiple VPNs. That is, a site may belong
to more than multiple VPNs.
As shown in Figure 7-3, the decision-making department of company X in city
A (Site A) is allowed to communicate with the R&D department in city B (Site
B) and the financial department in city C (Site C). Site B and Site C are not
allowed to communicate with each other. In this case, two VPNs, VPN1 and
VPN2, can be established. Site A and Site B belong to VPN1; Site A and Site C
belong to VPN2. Site A belongs to two VPNs.
VPN 1
X Company CE X Company
Decision-making R&D
Site A department Site B department
CE
VPN 2
X Company Carrier's
Financial network
department CE
Site C
● A site connects to a carrier network through CE devices. A site may have more
than one CE device, but a CE device belongs to only one site.
CE devices are selected according to sites:
If a site is a host, the host is the CE device of the site.
If a site is a subnet, switches are used as CE devices.
If a site has multiple subnets, routers are used as CE devices.
Sites connected to the same carrier network can be grouped into different
sets using policies. Only sites that belong to the same set can communicate
with each other through the carrier network. Such a set is a VPN.
VPN Instance
In BGP/MPLS IP VPN implementation, routes of different VPNs are isolated by VPN
instances.
A PE device establishes and maintains a VPN instance for each directly connected
site. A VPN instance contains VPN member interfaces and routes of the
Site1 CE
IP/MPLS
VPN1 PE
Backbone
VPN-instance
VPN2 Public
VPN-instance forwarding table
VPN2
Site2 CE
A public routing and forwarding table and a VRF differ in the following aspects:
● A public routing table contains IPv4 routes of all the PE and P devices. The
routes are static routes or dynamic routes generated by routing protocols on
the backbone network.
● A VPN routing table contains routes of all sites that belong to a VPN instance.
The routes are obtained through the exchange of VPN routing information
between PE devices or between CE and PE devices.
● Information in a public forwarding table is extracted from the public routing
table according to route management policies, whereas information in a VPN
forwarding table is extracted from the corresponding VPN routing table.
VPN instances on a PE device are independent of each other and maintain a
VRF independent of the public routing and forwarding table.
Each VPN instance can be considered as a virtual device, which maintains an
independent address space and connects to VPNs through interfaces.
RDs distinguish IPv4 prefixes with the same address space. IPv4 addresses with
RDs are VPN-IPv4 addresses (VPNv4 addresses). After receiving IPv4 routes from a
CE device, a PE device converts the routes into globally unique VPN-IPv4 routes
and advertises the routes on the public network.
SPs can allocate RDs independently because of the RD format. When CE devices
are dual-homed to PE devices, the RD must be globally unique to ensure correct
routing. As shown in Figure 7-6, a CE device is dual-homed to PE1 and PE2. PE1
also functions as a route reflector (RR).
VPN site
PE1
10.1.1.1/8 PE3
IP/MPLS
Backbone
PE2
PE1 is an edge device of the backbone network and advertises a VPN-IPv4 route
with the IPv4 prefix 10.1.1.1/8 to PE3. PE1 also functions as an RR and reflects a
VPN-IPv4 route with the IPv4 prefix 10.1.1.1/8 from PE2 to PE3.
● If the VPN has the same RD on PE1 and PE2, the two VPN-IPv4 routes to
10.1.1.1/8 have the same destination address. Therefore, PE3 receives only one
VPN-IPv4 route (CE -> PE1 -> PE3) to 10.1.1.1/8 from PE1. If the direct link
between PE1 and the CE is faulty, PE3 deletes the VPN-IPv4 route to
10.1.1.1/8. Then another route to 10.1.1.1/8 needs to be established to
forward VPN data to 10.1.1.1/8. The path for the route is PE3 -> PE1 -> PE2 ->
CE. During the route establishment, user services will be interrupted.
● If the VPN has the same RD on PE1 and PE2, the two VPN-IPv4 routes to
10.1.1.1/8 have different destination addresses. Therefore, PE3 receives two
VPN-IPv4 route to 10.1.1.1/8 from PE1. When any link between PE1 and CE
becomes faulty, PE3 deletes the corresponding route and reserves the other
one. Data destined for 10.1.1.1/8 can still be correctly forwarded.
VPN Target
A VPN target, also called the route target (RT), is a BGP extension community
attribute. BGP/MPLS IP VPN uses VPN targets to control VPN routes
advertisement.
A VPN instance is associated with one or more VPN target attributes. VPN target
attributes are classified into the following types:
● Export target: After a PE device learns IPv4 routes from directly connected
sites, it converts the routes to VPN-IPv4 routes and sets the export target
attribute for those routes. The export target attribute is advertised with the
routes as a BGP extended community attribute.
● Import target: After a PE device receives VPN-IPv4 routes from other PE
devices, it checks the export target attribute of the routes. If the export target
is the same as the import target of a VPN instance on the local PE device, the
local PE device adds the route to the VPN routing table.
BGP/MPLS IP VPN uses VPN targets to control advertisement and receiving of VPN
routes between sites. VPN export targets are independent of import targets. An
export target and an import target can be configured with multiple values to
implement flexible VPN access control and VPN networking.
For example, if the import target of a VPN instance contains 100:1, 200:1, and
300:1, any route with the export target of 100:1, 200:1, or 300:1 is added to the
routing table of the VPN instance.
7.2.2 Implementation
This section describes BGP/MPLS IP VPN implementation:
● VPN Label Distribution
● VPN Route Cross
● Public Network Tunnel Iteration
● VPN Route Selection Rules
● Route Advertisement in BGP/MPLS IP VPN
● Packet Forwarding in BGP/MPLS IP VPN
NOTE
MP-BGP can allocate labels to private routes only after MPLS is enabled on the PE device.
NOTE
To correctly forward a packet, a BGP-enabled device must find out a directly reachable
address, through which the packet can be forwarded to the next hop in the routing table.
The route to the directly reachable address is called dependent route, because BGP guides
packet forwarding based on the route. The process of finding a dependent route based on
the next-hop address is called route iteration.
Figure 7-7 shows route advertisement from CE2 to CE1. In this example, BGP runs
between CE and PE devices, and LSPs are used.
Route cross&
tunnel iteration BGP
Update Routing table
Carrying label,RD, and
export RT Message
1. Interior Gateway Protocol (IGP) routes are imported into the BGP IPv4 unicast
address family of CE2.
2. CE2 advertises an EBGP Update message with routing information to the
egress PE device. After receiving the message, the egress PE device converts
the route to a VPN-IPv4 route, and then installs the route to the VPN routing
table.
3. The egress PE device allocates an MPLS label to the route. Then it adds the
label and VPN-IPv4 routing information to the NLRI field and the export
To ensure that CE1 and CE2 can communicate, CE1 also needs to advertise routes
to CE2, of which the process is similar to the preceding process.
If two sites of a VPN connect to the same PE device, the PE device only needs to
know how VPN packets can reach the remote CE device.
Figure 7-8 shows packet forwarding from CE1 to CE2. In Figure 7-8, I-L indicates
an inner label, and O-L indicates an outer label.
IP/MPLS Backbone
CE1 Ingress PE P Egress PE CE2
Out-Label Switch
VPN2
PE P PE VPN1
CE
CE
Site2
VPN2 VPN1 Site3
Import: 200:1 Import: 100:1
Export: 200:1 Export: 100:1
As shown in Figure 7-9, PE devices allocate the VPN target 100:1 to VPN1 and the
target 200:1 to VPN2. The two sites in the same VPN can communicate with each
other, whereas sites in different VPNs cannot communicate.
Extranet VPN
If users in a VPN need to access some sites of another VPN, extranet networking
can be used.
In extranet networking, if a VPN needs to access a shared site, its export target
must be included in the import target of the VPN instance covering the shared
site, and its import target must be included in the export target of the VPN
instance covering the shared site.
CE VPN1
Site1 Import: 100:1
Export: 100:1
VPN1
IP/MPLS
Backbone
CE
PE1 Site3
PE2 PE3
VPN1
VPN2 Import: 100:1, 200:1
VPN2 Export: 100:1, 200:1
CE
Import: 200:1
Site2 Export: 200:1
As shown in Figure 7-10, VPN1 and VPN2 can access Site3 of VPN1.
● PE3 can receive VPN-IPv4 routes advertised by PE1 and PE2.
● PE1 and PE2 can receive VPN-IPv4 routes advertised by PE3.
Site1 and Site3 of VPN1 can communicate with each other. Site2 of VPN2 and
Site3 of VPN1 communicate with each other.
PE3 does not advertise the VPN-IPv4 routes learned from PE1 to PE2 and does not
advertise the VPN-IPv4 routes learned from PE2 to PE1. Therefore, Site1 of VPN1
and Site2 of VPN2 cannot communicate with each other.
Spoke-CE 4
IP/MPLS
Backbone Hub-CE
VPN1 Hub-PE 3 Site3
2
1
Spoke-CE Spoke-PE VPN1-in
Site2 VPN1 Import:Spoke
Import:Hub
Export;Spoke
The VPN targets of a PE device must comply with the following rules:
● The export target and import target of a Spoke-PE device are Spoke and Hub
respectively. The import target of any Spoke-PE device must be different from
the export target of any other Spoke-PE device.
● A Hub-PE device requires two interfaces or sub-interfaces.
– One interface or sub-interface receives routes from Spoke-PE devices. The
import target of the VPN instance on the interface is Spoke.
– The other interface or sub-interface advertises routes to Spoke-PE
devices. The export target of the VPN instance on the interface is Hub.
As shown in Figure 7-11, the Hub site controls communication between Spoke
sites. The arrows show the process of advertising a route from Site2 to Site1:
● The Hub-PE device can receive VPN-IPv4 routes advertised by all the Spoke-PE
devices.
● All the Spoke-PE devices can receive VPN-IPv4 routes advertised by the Hub-
PE.
● The Hub-PE device advertises the routes learned from Spoke-PE devices to the
Hub-CE device, and advertises the routes learned from the Hub-CE device to
all the Spoke-PE devices. By doing this, the Spoke sites can access each other
through the Hub site.
● The import target of any Spoke-PE device is different from the export targets
of other Spoke-PE devices. Therefore, any two Spoke-PE devices do not
directly advertise VPN-IPv4 routes to each other. The Spoke sites cannot
directly communicate with each other.
Generally, MPLS VPN architecture runs within an AS. Routes of any VPN can be
flooded within the AS, and cannot be flooded to other ASs. To implement
exchange of VPN routes between different ASs, the inter-AS MPLS VPN model is
used. The inter-AS MPLS VPN model is an extension to MPLS VPN framework.
Through this model, route prefixes and labels can be advertised over links
between different carrier networks.
PE1 PE3
MP
-IB GP
GP ASBR1 ASBR2 -IB
MP
AS100 AS200
MP
GP Create a VPN instance -IB
-IB GP
MP and logical interface for
each VPN
PE2 PE4
VPN LSP1 IP forwarding VPN LSP2
VPN2-CE1 LSP1 LSP2 VPN2-CE2
● Route advertisement
In Option A, PE and ASBR devices use MP-IBGP to exchange VPN-IPv4 routes.
Two ASBRs can run BGP, IGP multi-instance, or use static routes to exchange
VPN information. EBGP is recommended for inter-AS route exchange.
Figure 7-13 shows the process of advertising the route destined for
10.1.1.1/24 from CE1 to CE2. In Figure 7-13, D indicates the destination
address; NH indicates the next hop; L1 and L2 are private labels. Figure 7-13
does not show advertisement of public IGP routes and distribution of public
network labels.
10.1.1.1/24
● Packet forwarding
Figure 7-14 shows how packets are forwarded over the LSPs, which serve as
the tunnels on the public network. L1 and L2 are inner labels; Lx and Ly are
outer tunnel labels.
10
/2
.1
.1
AS100 AS200
.1
.1
.1
.1
10.1.1.1/24
/2
10
4
CE1 CE2
10.1.1.1/24
● Characteristics
– Simplified configuration: MPLS does not need to run between ASBRs and
no extra configuration is required.
– Low scalability: ASBRs need to manage all VPN routes and create VPN
instances for each VPN. Because IP forwarding is performed between the
ASBRs, the ASBRs must reserve an interface for each inter-AS VPN.
Therefore, the PE devices must have high performance. If a VPN spans
multiple ASs, the intermediate ASs must support the VPN service. The
configuration is complex and intermediate ASs is affected. Option A is
applicable when the number of inter-AS VPNs is small.
PE1 PE3
MP
-IB GP
GP ASBR1 ASBR2 -IB
MP
AS100 AS200
(VPN-v4) MP
GP -IB
-IB GP
MP
PE2 PE4
VPN LSP1 VPN LSP2 VPN LSP2
VPN2-CE1 LSP1 LSP2 VPN2-CE2
In Option B, the ASBRs receive all inter-AS VPN-IPv4 routes within or outside
the local AS and advertise the routes. In basic MPLS VPN implementation, a
PE device stores only the VPN routes that match the VPN target of the local
VPN instance. The ASBRs are configured to store all the received VPN routes,
regardless of whether any local VPN instance matches the routes.
All the traffic is forwarded by the ASBRs. This facilitates traffic control but
increases the load on the ASBRs. BGP routing policies, such as VPN target
filtering policies, can be configured on the ASBRs so that the ASBRs only save
some of VPN-IPv4 routes.
● Route advertisement
Figure 7-16 shows how the route destined for 10.1.1.1/24 is advertised from
CE1 to CE2. D indicates the destination address; NH indicates the next hop;
L1, L2, and L3 are inner labels. Figure 7-16 does not show advertisement of
public IGP routes and distribution of public network labels.
advertises the VPNv4 routes to the RR, and then the RR reflects the
routes to ASBR1.
c. ASBR1 uses MP-EBGP to advertise the labeled VPNv4 routes to ASBR2.
Because MP-EBGP changes the next hop of the routes when advertising
the routes, ASBR1 allocates a new label to the VPNv4 routes.
d. ASBR2 uses MP-IBGP to advertise the labeled VPNv4 routes to PE3 in AS
200. If an RR is deployed on the network, ASBR2 advertises the VPNv4
routes to the RR, and then the RR reflects the routes to PE3. When ASBR2
advertises routes to an MP-IBGP peer in the local AS, it changes the next
hop of the routes to itself.
e. PE3 in AS 200 uses BGP, OSPF, or RIP to advertise the routes to CE2.
Both ASBR1 and ASBR2 swap inner labels of the VPNv4 routes. The inter-AS
labels are carried in BGP messages, so the ASBRs do not need to run signaling
protocols such as Label Distribution Protocol (LDP) or Resource Reservation
Protocol (RSVP).
● Packet forwarding
In Option B, both the ASBRs swap labels during packet forwarding. Figure
7-17 shows how packets are forwarded over the LSPs, which serve as the
tunnels on the public network. L1, L2, and L3 are inner labels; Lx and Ly are
outer tunnel labels.
AS200
AS100
10
1/
(VPN-v4)
.
.1
.1
.1
.1
PE1 L2 10.1.1.1/24
.1
10
PE3
/2
4
CE1
CE2
10.1.1.1/24
● Characteristics
– Unlike Option A, Option B is not limited by the number of links between
ASBRs.
– Information about VPN routes is stored on and advertised by ASBRs.
When a large number of VPN routes exist, the overburdened ASBRs are
likely to encounter bottlenecks. Therefore, in the MP-EBGP solution, the
ASBRs that maintain VPN routes do not perform IP forwarding on the
public network.
To address this issue, PE devices can directly exchange VPN-IPv4 routes, and
ASBRs do not maintain or advertise VPN-IPv4 routes.
– The ASBRs use MP-IBGP to advertise labeled IPv4 routes to PE devices in
their respective ASs. The ASBRs also advertise labeled IPv4 routes
received from PE devices in the local AS to the ASBR peers in other ASs.
The ASBRs in the transit AS also advertise labeled IPv4 routes. A VPN LSP
can be established between the ingress PE and egress PE.
– The PE devices in different ASs establish a multi-hop EBGP connection to
exchange VPN-IPv4 routes.
– The ASBRs do not store or advertise VPN-IPv4 routes to each other.
Figure 7-18 shows the networking of inter-AS VPN Option C. In the figure,
VPN LSPs are private network tunnels, and LSPs are public network tunnels. A
BGP LSP enables two PE devices to exchange loopback interface information,
and it consists of two parts, for example, BGP LSP1 from PE1 to PE3 and BGP
LSP2 from PE3 to PE1.
PE1 PE3
MP GP
-IB -IB
GP ASBR1 ASBR2 MP
AS100 AS200
EBGP
GP MP
-IB -IB
MP GP
PE2 PE4
Multi-Hop MP-BGP
VPN LSP
VPN2-CE1 VPN2-CE2
LSP1 LSP2
BGP LSP2 BGP LSP1
PE1 PE3
MP-IBGP MP-IBGP
EBGP
AS100 AS200
ASBR1 ASBR2
RR1 RR2
● Route advertisement
The key to Option C is establishment of inter-AS tunnels on a public network.
Figure 7-20 shows how the route destined for 10.1.1.1/24 is advertised from
CE1 to CE2. D indicates the destination address; NH indicates the next hop; L3
indicates the inner label. L9 and L10 are BGP LSP labels. Figure 7-20 does not
show advertisement of public IGP routes and distribution of public network
labels.
k1 D: 1.1.1.1/32
ac
o kb /32 NH=ASBR2
Lo 1.1.1 Label=(L10)
1.
PE1 ASBR1 ASBR2 PE3 BGP, OSPF, RIP
BGP, OSPF, RIP 10.1.1.1/24, NH=PE3
10.1.1.1/24, NH=CE1 AS100 AS200
10.1.1.1/24
● Packet forwarding
Figure 7-21 shows how packets are forwarded over the LSPs, which serve as
the tunnels on the public network. L3 is the inner label; L9 and L10 are BGP
LSP labels; Lx and Ly are outer tunnel labels.
24
AS200
AS100
10
1/
1.
1..
1.
1.
PE1 L9 L3 10.1.1.1/24
.
10
1/
PE3
24
CE1
CE2
10.1.1.1/24
Before forwarding a packet to PE1, PE2 adds three labels to the packet: VPN
route label, BGP LSP label, and public LSP label. When the packet reaches
ASBR2, two labels are left: VPN route label and BGP LSP label. When the
packet reaches ASBR1, the BGP LSP label is terminated. Then common MPLS
VPN forwarding is performed.
● Characteristics
– VPN routes are directly exchanged between the ingress PE and the egress
PE. The routes do not need to be stored and forwarded by intermediate
devices.
– Only PE devices need to exchange VPN routes. P devices and ASBRs are
only responsible for packet forwarding. The intermediate devices need to
support only MPLS forwarding, and do not need to support MPLS VPN
services. ASBRs are unlikely to encounter bottlenecks. Option C is suitable
for the VPNs that span multiple ASs.
– MPLS VPN load balancing is easy to carry out in Option C.
– Managing an end-to-end connection between PE devices has high costs.
7.2.5 MCE
Definition
A multi-VPN-instance CE (MCE) device can function as a CE device for multiple
VPN instances in BGP/MPLS IP VPN networking. The MCE function helps reduce
expenses of network devices.
Background
BGP/MPLS IP VPN uses tunnels to transmit data of private networks on a public
network. In the traditional BGP/MPLS IP VPN architecture, each VPN instance
must use a CE device to connect to a PE device, as shown in Figure 7-22.
CE VPN1
Site
PE CE
VPN2
IP/MPLS Site
Backbone
VPN3
CE Site
MCE technology ensures data security between different VPNs while reducing
network construction and maintenance costs. Figure 7-23 shows MCE networking.
VPN1
Site
PE MCE
VPN2
IP/MPLS
Site
Backbone
VPN3
Site
An MCE device has some PE functions. By binding each VPN instance to a different
interface, an MCE device creates and maintains an independent VRF for each VPN.
This application is also called multi-VRF application. The MCE device isolates
forwarding paths of different VPNs on a private network and advertises routes of
each VPN to the peer PE device, ensuring that VPN packets are correctly
transmitted on the public network.
Implementation
An MCE device maintains a VRF for each VPN and binds each VPN instance to an
interface. When the MCE device receives a route, it checks the receiving interface
to determine the origin of the route and adds the route to the VRF of the VPN
instance bound to the interface.
The PE interfaces connected to the MCE device must also be bound to the VPN
instances. The bindings between interfaces and VPN instances on the PE device
must be the same as those on the MCE device. When the PE device receives a
packet, it checks the receiving interface to determine to which VPN the packet
belongs, and then transmits the packet in the corresponding tunnel.
In Figure 7-23:
● The MCE device saves routes learned from VPN1 in VRF1.
● The PE device saves routes of VPN1 learned from the MCE device in VRF1.
● Routes of VPN2 and VPN3 are isolated from routes of VPN1, and are not
saved in VRF1.
The MCE device exchanges routes with VPN sites and PE device in the following
ways:
● Route exchange with VPN sites
Route Implementation
Exchange
Method
Static Static routes are bound to VPN instances on the MCE device.
routes Static routes of different VPNs are isolated even if VPNs use
overlapping address spaces.
Routing Each VPN instance is bound to a RIP process on the MCE device
Informatio so that routes of different VPNs are exchanged between the
n Protocol MCE device and VPN sites using different RIP processes. This
(RIP) isolates routes of different VPNs and ensures security of VPN
routes.
Route Implementation
Exchange
Method
Border Each VPN instance is configured with a BGP peer on the MCE
Gateway device. The MCE imports IGP routes of each VPN to the BGP
Protocol routing table of the VPN.
(BGP)
7.2.6 HoVPN
Definition
Hierarchy of VPN (HoVPN) is a multi-layer VPN architecture that deploys PE
functions on multiple PE devices. In this architecture, multiple PE devices play
different roles and fulfill the functions of one PE. HoVPN is also called hierarchy of
PE (HoPE).
Background
As key devices on a BGP/MPLS IP VPN network, PE devices provide must provide a
large number of interfaces for user access, and provide large-capacity memory
and high forwarding capabilities to manage and advertise VPN routes, and process
user packets.
Most networks use typical hierarchical architecture. For example, a MAN uses a
three-layer architecture consisting of the core, aggregation, and access layers.
From the core layer to the access layer, the requirements for device performance
decreases, but the network scale increases.
BGP/MPLS IP VPN uses a plane model, which has the same performance
requirement for all the PE devices. If some PE devices do not provide high
performance or scalability, the entire network is affected.
Because the plane model of BGP/MPLS IP VPN is different from the typical
hierarchical architecture, deployment of new PE devices at each layer is difficult
due to low scalability. This plane model hinders large-scale VPN deployment. The
HoVPN solution is developed to address this issue.
In the HoVPN model, devices at higher layers must have high routing and
forwarding capabilities, whereas devices at lower layers can have lower
capabilities.
Implementation
● HoVPN architecture
VPN2
Site2 CE
As shown in Figure 7-24, the devices directly connected to user devices are
called underlayer PE or user-end PE (UPE) devices. The device that is deployed
within the backbone network and connected to UPE devices is called a
superstratum PE or service provider-end PE (SPE) device.
Multiple UPE devices and an SPE device form a hierarchy of PE and provide
functions of a traditional PE device.
● Relationship between the UPE and SPE
– The UPE device provides user access. It maintains routes of directly
connected VPN sites, but does not maintain routes of remote VPN sites or
only maintains summarized routes of remote VPN sites. Each UPE device
assigns an inner label to routes of directly connected sites and uses MP-
BGP to advertise the label with the VPN routes to the SPE device.
– The SPE device manages and advertises VPN routes. It maintains all the
routes of the VPN sites connected through the UPE devices, including
routes of local and remote sites. However, the SPE does not advertise
routes of remote sites to the UPE devices. Instead, it advertises only
default routes of VPN instances with labels.
– The UPE and SPE devices use label forwarding. The SPE device uses only
one interface to connect to each UPE device and does not need to
provide many interfaces for access users. An UPE device can connect to
the SPE device through a physical interface, a sub-interface, or a tunnel
interface. If a tunnel interface is used, the UPE and SPE devices can
communicate across an IP or MPLS network. Labeled packets are
transmitted between the UPE and SPE devices through a tunnel. If a GRE
tunnel is used, GRE must support encapsulation of MPLS packets.
As an SPE device and a UPE device play different roles, requirements for
them are different:
Out-
Inner
Inner Data layer
Data SPE label-2 PE
label-1 label
Out-
Inner
UPE Inner Data layer
Data label-1
label-2 label
Data
Swap inner label Data
Data Data
CE1 CE2
▪ After receiving a packet from CE1, the UPE device adds an inner label
to the packet and forwards the packet to the SPE device.
▪ After receiving the labeled packet, the SPE device swaps the inner
label, adds an outer LSP label to the packet, and sends the packet to
the PE device.
▪ After the packet arrives at the previous hop of the PE device, this hop
pops the outer LSP label. The process is called penultimate hop
popping.
▪ After the PE device receives the packet, it pops the inner label.
– CE2 → CE1 (marked by the blue line)
▪ After receiving a packet from CE2, the PE device adds an inner label
and an outer LSP label to the packet, and then forwards the packet
to the SPE device.
▪ After the packet arrives at the previous hop of the SPE device, this
hop pops the outer LSP label.
▪ The SPE device swaps the inner label for a new one and forwards the
packet to the UPE device.
▪ After the UPE device receives the packet, it pops the inner label.
● HoVPN embedding and extension
HoVPN supports HoPE embedding.
– An HoPE can function as a UPE device and compose a new HoPE with an
SPE device.
– An HoPE can function as an SPE device and compose a new HoPE with
multiple UPE devices.
– HoPEs can be embedded multiple times in the preceding two modes.
HoPE embedding can infinitely extend a VPN.
MPE UPE
UPE UPE
CE CE CE CE
Figure 7-26 shows a three-layer HoPE, and the PE device in the middle is
called the middle-level PE (MPE) device. MP-BGP runs between the SPE and
MPE devices, and between the MPE and UPE devices.
NOTE
Actually, the MPE device does not exist in an HoVPN model. The concept is used just
for the convenience of description.
MP-BGP advertises all the VPN routes of the UPE devices to the SPE device,
but advertises only the default VPN routes of the SPE device to the UPE
devices.
The SPE device maintains the routes of all VPN sites connected to the PE
devices, whereas the UPE devices maintain only the VPN routes of the directly
connected VPN sites. The quantities of routes maintained by the SPE, MPE,
and UPE devices are in descending order.
Advantages of HoVPN
The HoVPN model has the following advantages:
● A BGP/MPLS IP VPN network can be divided into different hierarchies. If the
performance of UPE devices does not satisfy service requirements, an SPE
device can be added above UPE devices. When access capabilities of an SPE
device are insufficient, UPE devices can be added below the SPE device.
● Label forwarding is performed between UPE and SPE devices. Therefore, a
UPE device and an SPE device are interconnected through only a pair of
interfaces or sub-interfaces. This saves interface resources.
● If a UPE device and an SPE device are separated by an IP or MPLS network,
they can set up a GRE or LSP tunnel. A layered MPLS VPN has enhanced
scalability.
● The UPE devices maintain only the local VPN routes, and all the remote
routes are represented by a default or summarized route. This reduces loads
on the UPE devices.
● SPE and UPE devices use MP-BGP to exchange routes and advertise labels.
Each UPE device sets up only one MP-BGP peer, reducing the protocol cost
and configuration workload.
The service convergence time is closely related to the number of routes inside an
MPLS VPN and the number of LSP hops on the bearer network. The more VPN
routes, the longer the service convergence time, and the more traffic is lost.
VPN FRR sets in advance on a remote PE device forwarding entries pointing to the
active and standby PE devices, respectively. In collaboration with fast PE fault
detection, VPN FRR can reduce end-to-end service convergence time if a fault
occurs on an MPLS VPN where a CE device is dual-homed to two PE devices. In
VPN FRR, service convergence time depends on only the time required to detect
remote PE device faults and change tunnel status. VPN FRR enables the service
convergence time to be irrelevant to the number of VPN routes on the bearer
network.
Implementation
PE3
As shown in Figure 7-27, normally, CE1 accesses CE2 over Link A. If PE2 is Down,
CE1 accesses CE2 over Link B.
● Based on the traditional BGP/MPLS VPN technology, both PE2 and PE3
advertise routes destined for CE2 to PE1, and assign VPN labels to these
routes. PE1 then selects a preferred VPNv4 route based on the routing policy.
In this example, the preferred route is the one advertised by PE2, and only the
routing information, including the forwarding prefix, inner label, selected LSP,
advertised by PE2 is filled in the forwarding entry of the forwarding engine to
guide packet forwarding.
● When PE2 fails, PE1 detects the fault of PE2 (the BGP peer relationship
becomes Down or the outer LSP is unavailable). Then PE1 selects the route
advertised by PE3 and updates the forwarding entry to complete end-to-end
convergence. Before PE1 delivers the forwarding entry matching the route
advertised by PE3, CE1 cannot communicate with CE2 for a certain period
because the destination of the outer LSP, PE2, is Down. As a result, end-to-
end services are interrupted.
● VPN FRR is an improvement on the traditional reliability technology. VPN FRR
enables PE1 to add the optimal route advertised by PE2 and the secondary
optimal route advertised by PE3 to a forwarding entry. The optimal route is
used for traffic forwarding, and the secondary optimal route is used as a
backup route.
● If a fault occurs on PE2, the MPLS LSP between PE1 and PE2 becomes
unavailable. After detecting the fault, PE1 marks the corresponding entry in
the LSP status table as unavailable, and delivers the setting to the forwarding
table. After selecting a forwarding entry, the forwarding engine examines the
status of the LSP corresponding to the forwarding entry. If the LSP is
unavailable, the forwarding engine uses the second-best route carried in the
forwarding entry to forward packets. After being tagged with the inner labels
assigned by PE3, packets are transmitted to PE3 over the LSP between PE1
and PE3 and then forwarded to CE2. In this manner, fast end-to-end service
convergence is implemented and traffic from CE1 to CE2 is restored.
VPN FRR performs fast switching based on inner labels. Outer tunnels can be LDP
LSPs or RSVP TE tunnels. When the forwarding engine detects that the outer
tunnel is unavailable, it triggers fast switching based on inner labels.
7.2.8 VPN GR
NOTE
The AR3260 can function as both the GR restarter and GR helper, and other devices can
only function as the GR helper.
Definition
VPN GR is an application of GR technology on a VPN. VPN GR ensures
uninterrupted VPN traffic forwarding when an active/standby switchover is
performed on a device transmitting VPN services. The purposes of VPN GR are as
follows:
● Reduce the impact of route flapping on the entire network during the
switchover.
● Reduce the impact on important VPN services.
● Reduce single-point failures on PE or CE devices to improve VPN network
reliability.
Implementation
On a common BGP/MPLS VPN network, active/standby switchovers may occur on
any PE, CE, or P device.
When the P device connected to the PE device detects the restart of the PE
device, the P device acts the same as the GR helper in IGP GR, BGP GR, or
LDP GR and retains all public IPv4 routes in a period.
When other PE devices (including those functioning as ASBRs) and the RR
reflecting VPNv4 routes detect the restart of the PE device, they act the same
as the GR helper in BGP GR, and retain all the public IPv4 routes and VPNv4
routes in a period.
● Active/standby switchover on a P device
The GR process on a P device is the same as that on the GR restarter in IGP
GR, BGP GR, or LDP GR.
When a P or PE device connected to this P device detects the restart, the P or
PE device acts the same as the GR helper in IGP GR, BGP GR or LDP GR and
retains all the public IPv4 routes in a period.
● Active/standby switchover on a CE device
The GR process on a CE device is the same as that on the GR restarter in IGP
GR or BGP GR.
When the PE device connected to the CE device detects the restart of the CE
device, the PE device acts the same as the GR helper in IGP GR or BGP GR and
retains all the private IPv4 routes in a period.
For details about IGP GR and BGP GR, see "GR" in the Huawei AR Series Access
Routers Configuration Guide - IP Routing.
For details about LDP GR and RSVP GR, see "GR" in the Huawei AR Series Access
Routers Configuration Guide - MPLS.
● LSP
An LSP forwards packets through label switching and is often used in BGP/
MPLS IP VPN. If LSPs are used as public network tunnels, only PE devices need
to analyze IP packet headers, and other devices that VPN packets pass do not
need to analyze IP packet headers. This reduces VPN packet processing time
and packet transmission delay. In addition, MPLS labels are supported by all
link layers. An LSP is similar to an ATM virtual circuit (VC) or FR VC in
functions and security. If all the devices on the backbone network support
MPLS, it is recommended that LSP tunnels or MPLS TE tunnels be used as
public network tunnels.
For details about LSPs, see MPLS LDP Configuration in the Huawei AR Series
Access Routers Configuration Guide - MPLS.
● MPLS TE tunnel
As a combination of MPLS and TE technologies, MPLS TE can balance
network traffic by setting up LSPs along specified nodes and steering traffic
away from congested nodes. LSPs in MPLS TE are called MPLS TE tunnels,
which are also widely used in BGP/MPLS IP VPN.
Besides advantages of LSP, MPLS TE tunnels is capable of handling network
congestion. Using MPLS TE tunnels, SPs can fully utilize existing network
resources to provide diversified services. MPLS TE tunnels also allow SPs to
optimize network resources and manage resources.
Usually, carriers are required to provide VPN users with end-to-end QoS for
various services, such as voice, video, key-data services, and Internet access.
MPLS TE tunnels can offer users with QoS guarantee.
Using MPLS TE tunnels, carriers can also provide required QoS guaranteed
services for different VPN users based on policies.
For details about MPLS TE, see MPLS TE Configuration in the Huawei AR
Series Access Routers Configuration Guide - MPLS.
Tunnel Policy
VPN services are transmitted over tunnels. By default, LSPs are preferred in VPN
service transmission, and only one LSP serves one VPN service.
When VPN services need to be transmitted over a specified TE tunnel or when
load balancing needs to be performed among multiple tunnels to fully use
network resources, tunnel policies need to be applied to VPNs. Tunnel policies are
classified into two types, which cannot be configured simultaneously:
● Tunnel type prioritization policy: specifies the sequence in which each type of
tunnel is selected and the number of tunnels participating in load balancing.
Tunnels defined in a tunnel type prioritization policy are selected in sequence:
The tunnels of the type specified first are selected as long as the tunnels are
in Up state, regardless of whether they are in use. The tunnels of the type
specified later are not selected unless load balancing is required or the
tunnels of the type specified first are all Down.
For example, a tunnel policy defines the following rules: Both CR-LSPs and
LSPs can be used, CR-LSPs are prior to LSPs, and the number of tunnels
participating in load balancing is 3. Tunnels are selected as follows:
– CR-LSPs in Up state are preferred. If three or more CR-LSPs are in Up
state, the three CR-LSPs listed earlier are selected.
– If there are less than three CR-LSPs in Up state, LSPs are selected. For
example, if only one CR-LSP is in Up state, two LSP tunnels can be
selected. If only one LSP or none is in Up state, the existing tunnels in Up
state are used. If more than two LSPs are in Up state, only the first two
LSPs are selected.
NOTE
Site4
Site2
CE2 CE4
VPNB VPNB
If you bind VPN A to Tunnel1 and VPN B to Tunnel2, VPN A and VPN B use
different TE tunnels. Tunnel1 serves only VPN A, and Tunnel2 serves only VPN
B. In this manner, services of VPN A and VPN B are isolated from each other
and also from other services. The bandwidth for VPN A and VPN B is ensured.
This facilitates subsequent QoS deployment.
Tunnel Selector
In HoVPN or inter-AS VPN Option B, SPE devices or ASBRs accept VPNv4 routes
from all the UPE or PE devices. Currently, PE devices iterate LSP tunnels for VPNv4
routes. Sometimes, TE tunnels need to be iterated for VPNv4 routes to provide
guaranteed bandwidth; the PE devices cannot provide this function by default.
In inter-AS VPN Option C, PE devices select LSP tunnels for BGP-IPv4 labeled
routes. To provide guaranteed bandwidth, TE tunnels need to be iterated for
VPNv4 routes, which cannot be implemented on the PE devices by default.
Tunnel selector addresses this issue.
The tunnel selector can filter VPNv4 routes or BGP-IPv4 labeled routes and apply a
tunnel policy to the routes that pass the filtering criteria. In this way, expected
tunnels can be selected based on the tunnel policy.
IP/MPLS Backbone
PE1 P1 PE3
CE1 CE2
VPN 1 VPN 1
RR2 Site2
Site1
RR1
PE2 P2
PE4
Networking Description
PE and P devices on the carrier's backbone network must be used to transmit
routes and packets between Site1 and Site2 from the two networks to
communicate. CE devices can be dual-homed to PE devices to ensure high
network availability. Generally, a carrier deploys route reflectors (RRs) on the
backbone network to reflect VPNv4 and VPNv6 routes.
Feature Deployment
In BGP/MPLS IP VPN networking, the following configurations must be performed:
● Configure static routes between CE devices and PE devices or configure RIP,
OSPF, IS-IS, or BGP on CEs and PEs for them to exchange routing information.
● Configure MP-BGP peer relationships between all PE devices and RR1 and
between all PE devices and RR2. Configure all PE devices as the clients of RR1
and RR2 and configure RR1 and RR2 to back up each other. These
configurations ensure network reliability.
● Configure MPLS and an IGP on PE and P devices and establish MPLS tunnels
for traffic forwarding.
● Adjust IGP costs of links to:
– Ensure that the two links between CE1 and CE2 work in active/standby
mode. If one link fails, traffic is switched to the other link for
transmission.
– Adjust the costs of links between RRs and the backbone network. Ensure
that RRs are used only for route reflection, not for traffic forwarding.
● Configure VPN FRR for services that have high requirements on real-time
transmission to enhance network reliability.
Service Overview
Financial enterprises such as banks can use the Hub&Spoke networking mode to
ensure financial data security. Hub&Spoke networking allows branches to
exchange data only through the headquarters. In this manner, data transmission
between branches is under effective supervision.
In Hub&Spoke networking, the site where the access control device of the
headquarters is located is called a Hub site; other sites where branches are located
are called Spoke sites. At the Hub site, a device that connects to the VPN
backbone network is called a Hub-CE device. At a Spoke site, a device that
connects to the VPN backbone network is called a Spoke-CE device. On the VPN
backbone network, a device that connects to the Hub site is called a Hub-PE
device, and a device that connects to a Spoke site is called a Spoke-PE device.
A Spoke site advertises routes to the Hub site. The Hub site then advertises the
routes to other Spoke sites. Spoke sites do not advertise routes to each other. The
Hub site controls communication between all the Spoke sites.
Networking Description
In Hub and Spoke networking, the following solutions can be used:
● EBGP running between the Hub-CE and Hub-PE devices, and between Spoke-
PE and Spoke-CE devices
● IGP running between the Hub-CE and Hub-PE devices, and between Spoke-PE
and Spoke-CE devices
● EBGP running between the Hub-CE and Hub-PE devices, and IGP running
between Spoke-PE and Spoke-CE devices
The following describes these networking solutions in detail:
● EBGP running between the Hub-CE and Hub-PE devices, and between Spoke-
PE and Spoke-CE devices
As shown in Figure 7-30, a route advertised by a Spoke-CE device is
forwarded to the Hub-CE and Hub-PE device before being transmitted to
other Spoke-PE devices. If EBGP runs between the Hub-PE and the Hub-CE
device, the Hub-PE device performs an AS-Loop check on the route. When the
Hub-PE device detects its own AS number in the route, it discards the route.
To implement Hub and Spoke networking, the Hub-PE device must be
configured to allow repeated AS numbers.
Figure 7-30 EBGP running between the Hub-CE and Hub-PE devices, and
between Spoke-PE and Spoke-CE devices
AS65401 Spoke-PE1
EBGP
Spoke-CE1 EBGP
IBGP Hub-CE
VPN_in
IP/MPLS Backbone
AS100
Spoke-CE2 IBGP EBGP
AS65403
EBGP Hub-PE VPN_out
Spoke-PE2
AS65402
● IGP running between the Hub-CE and Hub-PE devices, and between Spoke-PE
and Spoke-CE devices
As shown in Figure 7-31, all PE and CE devices exchange routes using an IGP,
and IGP routes do not contain the AS_Path attribute. Therefore, the AS_Path
field of BGP VPNv4 routes is empty.
Figure 7-31 IGP running between the Hub-CE and Hub-PE devices, and
between Spoke-PE and Spoke-CE devices
AS65401 Spoke-PE1
OSPF100
Spoke-CE1 vpn1 OSPF 100 Hub-CE
IBGP
vpn_in
IP/MPLS Backbone
AS100 OSPF 200
Spoke-CE2 IBGP
OSPF100 vpn_out AS65403
vpn1 Hub-PE
Spoke-PE2
AS65402
● EBGP running between the Hub-CE and Hub-PE devices, and IGP running
between Spoke-PE and Spoke-CE devices
As shown in Figure 7-32, the network topology is similar to that shown in
Figure 7-30. The AS_Path attribute of the routes forwarded by the Hub-CE
device to the Hub-PE device contains the AS number of the Hub-PE device.
Therefore, the Hub-PE device must be configured to allow repeated AS
numbers.
Figure 7-32 EBGP running between the Hub-CE and Hub-PE devices, and IGP
running between Spoke-PE and Spoke-CE devices
AS65401 Spoke-PE1
OSPF100
Spoke-CE1 vpn1 EBGP
IBGP Hub-CE
vpn_in
IP/MPLS Backbone
AS100 EBGP
Spoke-CE2 IBGP
OSPF100 vpn_out AS65403
vpn1 Hub-PE
Spoke-PE2
AS65402
● The devices in the VPN that need to access the Internet have reachable routes
to the Internet.
● Routes are available from the Internet to the devices in the VPN.
● Similar to interconnection between non-VPN users and the Internet, security
mechanisms such as firewalls must be used.
● The PE device sends a default route destined for the Internet to the CE device.
● The PE device adds a default route destined for the Internet gateway to the
VPN routing table.
● To ensure that the Internet has a route to the VPN, the PE device must have a
static route to the CE in the public routing table and advertise this route to
the Internet. The static route is manually added to the public routing table of
the PE device. In the static route, the destination address is the address of the
VPN user, and the outbound interface is the PE interface that connects to the
CE device. The PE uses an IGP to advertise the route to the Internet.
Internet
Internet
Gateway
IP/MPLS
Backbone
VPN site
CE PE
Internet
VPN-instance
Internet
Gateway
IP/MPLS
Backbone
VPN site
CE PE
Internet
IP/MPLS
Backbone
VPN site
CE PE
Internet
CE IP/MPLS
VPN-instance Backbone
VPN site
PE
interface has a public network IP address. Each VPN uses an interface on the
gateway and one public network IP address.
Interconnection implemented on a CE device is simple to deploy. This solution has
high security and reliability because public routes are separated from VPN routes.
However, this solution consumes interface resources and each VPN needs a public
network address.
Configure BGP/ You adjust the basic BGP/ 7.7.1 Configuring Basic BGP/
MPLS IP VPN MPLS IP L3VPN MPLS IP VPN Functions
in various configurations in different 7.7.2 Configuring Hub and
networking networking mode to Spoke
modes implement flexible
communication and isolation
between VPNs:
● Intranet VPN and extranet
VPN networking: The
configurations are same as
the configurations in basic
BGP/MPLS IP VPN
networking except for the
VPN target setting.
● Hub and Spoke
networking: configure the
Hub and Spoke.
License Requirements
BGP/MPLS IP VPN is a basic feature of the device and is not under license control.
Feature Limitations
When configuring BGP/MPLS IP VPN on the router, pay attention to the following
points:
The AR100&AR120&AR150&AR160&AR200 series do not supports BGP/MPLS IP
VPN, only supports MCE.
Context
Perform the following steps on the PE devices.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
Step 3 Run peer ipv4-address as-number as-number
The peer PE is configured as a BGP peer.
Step 4 Run peer ipv4-address connect-interface loopback interface-number
An interface is used to set up a Transmission Control Protocol (TCP) connection
with the BGP peer.
NOTE
A PE must use a loopback interface address with a 32-bit mask to set up an MP-IBGP peer
relationship with the peer PE so that VPN routes can be iterated to tunnels. The route to
the local loopback interface is advertised to the peer PE using an IGP on the MPLS
backbone network.
The ability to exchange VPN IPv4 routes with the BGP peer is enabled.
----End
Related Tasks
When a large number of PE devices on the backbone network need to establish
MP-IBGP peer relationships to exchange VPN routes, configure a route reflector
(RR) to reduce the number of MP-IBGP connections between PE devices. The PE
devices only need to establish MP-IBGP peer relationships with the RR. For
detailed configuration, see 7.7.11 Configuring Route Reflection to Optimize the
VPN Backbone Layer.
Context
In BGP/MPLS IP VPN application, each VPN has an instance to maintain
forwarding information of the local VPN. Such an instance is called a VPN instance
or VPN routing and forwarding table (VRF).
VPN instances isolate VPN routes from routes on the public network and isolate
the routes of different VPN instances. VPN instances must be configured in all
types of BGP/MPLS IP VPN networking.
Perform the following steps on each PE device.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run ip vpn-instance vpn-instance-name
A VPN instance is created, and its view is displayed.
NOTE
A VPN instance name is case sensitive. For example, "vpn1" and "VPN1" are different VPN
instances.
VPN instances support both the IPv4 and IPv6 address families. Configurations in a
VPN instance can be performed only after an address family is enabled for the
VPN instance based on the advertised route and forwarding data type.
Step 6 Run route-distinguisher route-distinguisher
An RD is configured for the VPN instance IPv4 address family.
A VPN instance IPv4 address family takes effect only after being configured with
an RD. The RDs of different VPN instances on a PE must be different.
NOTE
● An RD can be modified or deleted only after the VPN instance is deleted or the VPN
instance IPv4 address family is disabled.
● If you configure an RD for the VPN instance IPv4 address family in the created VPN
instance view, the VPN instance IPv4 address family is enabled and the VPN instance
IPv4 address family is displayed.
The routing-table limit command enables the system to display a message when the
number of routes added to the routing table of VPN instance IPv4 address family
exceeds the limit. If you run the routing-table limit command to increase the
maximum number of routes in the VPN instance IPv4 address family or run the undo
routing-table limit command cancel the limit, the system adds newly received routes
of various protocols to the private network IP routing table.
● To set the maximum number of route prefixes in the VPN instance IPv4
address family, run prefix limit number { alert-percent [ route-unchanged ] |
simply-alert }.
NOTE
If the prefix limit command is run, the system gives a prompt when the number of
route prefixes added to the routing table of the VPN instance IPv4 address family
exceeds the limit. After the prefix limit command is run to increase the allowed
maximum number of route prefixes in a VPN instance IPv4 address family or the undo
prefix limit command is run to cancel the limit, the system adds newly received route
prefixes of various protocols to the private network IP routing table.
After the number of route prefixes exceeds the maximum limit, direct and static routes
can still be added to the IPv4 address family routing table of VPN instances.
The interval for logging the event that the number of routes exceeds the threshold
is set for the VPN instance IPv4 address family.
If the routes or prefixes in the IPv4 address family of a VPN instance reach the
maximum, the system will generate logs at intervals (defaulting to 5 seconds). To
prevent logs from being displayed frequently, run this step to prolong the interval
of log generation.
NOTE
Before applying a routing policy to a VPN instance, create the routing policy. For details
about how to configure a routing policy, see Routing Policy Configuration in the Huawei AR
Series Access Routers Configuration Guide - IP Routing.
Step 11 (Optional) Run one of the following commands to configure the label allocation
mode in the VPN instance IPv4 address family.
● Run apply-label per-instance
MPLS label allocation based on the VPN instance IPv4 address family (known
as label per instance) is configured. One label is assigned to all the routes of
the VPN instance IPv4 address family.
When a large number of VPN routes on the PE exhausts MPLS label resources,
the label per instance mode saves label resources on the PE and lowers the
requirement for the PE capacity.
● Run apply-label per-route
MPLS label allocation based on each route (known as label per route) is
configured. The VPN instance address family assigns a unique label to each
route to be sent to the peer PE.
When only a small number of VPN routes exists on the PE and MPLS label
resources are sufficient, the label per route mode improves system security. In
this way, downstream devices can load balance VPN traffic based on the inner
labels of packets.
By default, the VPN instance IPv4 address family assigns the same label to all
routes to be sent to the peer PE.
----End
Prerequisites
A VPN instance has been created and the IPv4 address family has been enabled
for the VPN instance.
Context
● After configuring a VPN instance on a PE device, bind the VPN instance to the
interface that belongs to the VPN. Otherwise, the interface functions as a
public network interface and cannot forward VPN data.
● An interface becomes a private network interface after a VPN instance is
bound to it. You must configure an IP address for the interface so that the PE
device can exchange routing information with its attached CE device.
● After a VPN instance is bound to an interface, configuration of the Layer 3
features (IPv4 and IPv6 features) including IP addresses and routing protocols
is deleted from the interface.
● When you disable an address family (IPv4 or IPv6 address family) in a VPN
instance, configuration of the address family is deleted from the interface. No
interface is bound to a VPN instance if no address family configuration exists
in the VPN instance.
Perform the following steps on the PE devices.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run ip binding vpn-instance vpn-instance-name
A VPN instance is bound to the interface.
By default, an interface is a public network interface and is not associated with
any VPN instance.
----End
Context
In BGP/MPLS IP VPN, a routing protocol or static routes must be configured
between a PE and a CE to allow them to communicate and allow the CE to obtain
routes to other CEs. The routing protocol can be EBGP (External/Exterior BGP),
IBGP (Internal/Interior BGP), RIP (Routing Information Protocol), OSPF (Open
Shortest Path First), or IS-IS (Intermediate System to Intermediate System).
Choose one of the following configurations as needed:
● Configure EBGP between a PE and a CE
● Configure IBGP between a PE and a CE
● Configure static route between a PE and a CE
● Configure RIP between a PE and a CE
● Configure OSPF between a PE and a CE
● Configure IS-IS between a PE and a CE
NOTICE
Deleting a VPN instance or disabling a VPN instance IPv4 address family will
delete all the RIP processes bound to the VPN instance or the VPN instance IPv4
address family on the PE device.
Return to quit -
system
view.
NOTICE
Deleting a VPN instance or disabling a VPN instance IPv4 address family will
delete all the OSPF processes bound to the VPN instance or the VPN instance IPv4
address family on the PE device.
Return to quit -
the OSPF
view.
Return to quit -
system
view.
NOTICE
Deleting a VPN instance or disabling a VPN instance IPv4 address family will
delete all the IS-IS processes bound to the VPN instance or the VPN instance IPv4
address family on the PE device.
Return to quit -
system
view.
Return to quit -
system
view.
Import IS- import-route isis process-id [ med After this command is run in
IS routes med | route-policy route-policy- the BGP-VPN instance IPv4
into the name ] * address family view, the PE
routing will import the VPN routes
table of learned from the attached
the BGP- CE into the BGP routing
VPN table and advertise VPNv4
instance routes to the remote PE.
IPv4
address
family.
Prerequisites
All configurations for a basic BGP/MPLS IP VPN are complete.
Procedure
● Run the following commands on the PE to check information about the
created VPN instance IPv4 address family, including the RD and other
attributes.
– Run the display ip vpn-instance vpn-instance-name command to check
brief information about a specified VPN instance.
– Run the display ip vpn-instance verbose vpn-instance-name command
to check detailed information about a specified VPN instance.
– Run the display ip vpn-instance import-vt ivt-value command to check
information about the VPN instances with the specified import VPN
target.
– Run the display ip vpn-instance [ vpn-instance-name ] interface
command to view information about the interface bound to a specified
VPN instance.
● Run the following commands on the PE and CE to check information about
the IPv4 VPN routes to the local and remote sites.
– Run the display ip routing-table vpn-instance vpn-instance-name
command on the PE to check the routing information of a specified VPN
instance IPv4 address family.
Pre-configuration Tasks
Before configuring Hub and Spoke, complete the following tasks:
● Configuring IGP on PE devices and P devices in the MPLS backbone network
NOTE
When RIP-1 runs on the backbone network, you need to enable LDP to search for
routes to establish LSPs based on the longest match rule. For details, see Configuring
LDP Extensions for Inter-Area LSPs.
● Configuring basic MPLS capabilities and MPLS LDP (or RSVP-TE) on PE devices
and P devices in the MPLS backbone network
● Configuring the IP addresses, through which the CE devices access the PE
devices, on the CE devices
NOTE
You also need to configure VPN tunnel policies when VPN services need to be transmitted
over TE tunnels or when multiple tunnels need to perform load balancing to fully use
network resources. For detailed configuration, see 7.7.15.1 Configuring and Applying a
Tunnel Policy.
Configuration Procedure
All the following tasks are mandatory. Perform these tasks in this sequence to
complete the Hub and Spoke configuration.
Context
The Hub-PE must set up the MP-IBGP peer with all the Spoke-PE devices. Spoke-
PE devices do not need to set up the MP-IBGP peer between each other.
Perform the following steps on the Hub-PE and Spoke-PE devices.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run bgp { as-number-plain | as-number-dot }
NOTE
A PE must use a loopback interface address with a 32-bit mask to set up an MP-IBGP peer
relationship with the peer PE so that VPN routes can be iterated to tunnels. The route to
the local loopback interface is advertised to the peer PE using an IGP on the MPLS
backbone network.
----End
Context
Configure VPN instances on each Spoke-PE device and the Hub-PE device. This
section provides only the mandatory configuration for a VPN instance. For the
optional configuration of a VPN instance, see 7.7.1.3 Configuring a VPN Instance
on a PE Device.
Procedure
● Configure VPN instances on the Hub-PE device.
Configure the following two VPN instances for the Hub-PE device:
– VPN-in: accepts and maintains all the VPNv4 routes advertised by all the
Spoke-PE devices.
– VPN-out: maintains the routes of the Hub site and all the Spoke sites and
advertises those routes to all the Spoke-PE devices.
a. Run system-view
The system view is displayed.
b. Run ip vpn-instance VPN-in
The VPN-in instance is created and the VPN-in instance view is displayed.
c. Run ipv4-family
The IPv4 address family is enabled for the VPN-in instance, and the VPN-
in instance IPv4 address family view is displayed.
vpn-target2 must be in the export VPN target list configured on the Hub-
PE device.
f. Run vpn-target vpn-target1 &<1-8> export-extcommunity
The VPN target extended community is configured for the VPN instance
IPv4 address family to advertise the routes of Spoke sites.
vpn-target1 must be in the import VPN target list configured on the Hub-
PE device.
----End
Prerequisites
A VPN instance has been created and the IPv4 address family has been enabled
for the VPN instance.
Context
The configuration on the Hub-PE involves two interfaces or sub-interfaces: one is
bound with the VPN-in and receives the routes advertised by the Spoke-PE; the
other is bound with the VPN-out and advertises the routes of the Hub and all the
Spokes.
● After configuring a VPN instance on a PE device, bind the VPN instance to the
interface that belongs to the VPN. Otherwise, the interface functions as a
public network interface and cannot forward VPN data.
● An interface becomes a private network interface after a VPN instance is
bound to it. You must configure an IP address for the interface so that the PE
device can exchange routing information with its attached CE device.
● After a VPN instance is bound to an interface, configuration of the Layer 3
features (IPv4 and IPv6 features) including IP addresses and routing protocols
is deleted from the interface.
● When you disable an address family (IPv4 or IPv6 address family) in a VPN
instance, configuration of the address family is deleted from the interface. No
interface is bound to a VPN instance if no address family configuration exists
in the VPN instance.
Perform the following steps on the Hub-PE and all the Spoke-PE devices.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run interface interface-type interface-number
The interface view is displayed.
Step 3 Run ip binding vpn-instance vpn-instance-name
A VPN instance is bound to the interface.
----End
Context
The Hub-PE and Hub-CE devices can use IGP or EBGP to exchange routing
information. When they use EBGP, you must configure the Hub-PE device to allow
repeated local AS number.
Figure 7-37 EBGP running between the Hub-CE and Hub-PE devices
AS65401 Spoke-PE1
Spoke-CE1 EBGP
IBGP Hub-CE
VPN_in
VPN backbone
AS100
Spoke-CE2 IBGP EBGP
AS65403
Hub-PE VPN_out
Spoke-PE2
AS65402
Procedure
● Configure EBGP between the Hub-PE and Hub-CE devices.
The Spoke-PE and Spoke-CE devices can use EBGP, IGP, or static routes.
To set up an EBGP peer relationship between the Hub-PE and Hub-CE devices
and between a Spoke-PE device and a Spoke-CE device, perform the following
steps on the Hub-PE device:
a. Run system-view
The system view is displayed.
b. Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
c. Run ipv4-family vpn-instance vpn-instance-name
The BGP-VPN instance IPv4 address family view is displayed.
d. Run peer ip-address allow-as-loop [ number ]
The Hub-PE is configured to allow the routing loop. Here the value of
number is set as 1, which means the route with the AS repeated once can
be sent.
● Configure an IGP between the Hub-PE and Hub-CE devices.
For detailed configuration procedures, see Configuring a Routing Protocol
Between PE and CE.
In this way, instead of BGP, IGP or static routes are adopted between the
Spoke-PE and the Spoke-CE. If BGP is used, the source BGP route's AS number
will get lost when the route is transmitted through the IGP running between
the Hub-PE and Hub-CE. The Spoke-PE will receive both the source BGP route
sent by the Spoke-CE and the source BGP route with no AS number forwarded
by the Hub-PE. The source BGP route sent by the Spoke-CE has an AS number
and is therefore not preferred by the Spoke-PE. After the route is withdrawn,
the Spoke-PE prefers the source BGP route received from the Spoke-CE again
and advertises this route again. As this process repeats, route flapping occurs.
● Configure static routes between the Hub-PE and the Hub-CE devices.
For detailed configuration procedures, see Configuring a Routing Protocol
Between PE device and CE.
EBGP, IGP, or static routes can be used between the Spoke-PE and the Spoke-
CE devices.
If the Hub-CE device uses the default route to access the Hub-PE device,
perform the following steps on the Hub-PE device to advertise the default
route to all the Spoke-PE devices:
a. Run system-view
The system view is displayed.
b. Run ip route-static vpn-instance vpn-source-name 0.0.0.0 0.0.0.0
nexthop-address [ preference preference | tag tag ]* [ description text ]
Here, vpn-instance-name refers to the VPN-out. nexthop-address is the IP
address of the Hub-CE interface that is connected with the PE device
interface bound with the VPN-out instance.
c. Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
The default route is advertised to all the Spoke-PE devices through MP-
BGP.
----End
Prerequisites
The configurations of the Hub and Spoke function are complete.
Procedure
● Run the display ip routing-table vpn-instance vpn-instance-name command
to check routing information about the VPN-in and VPN-out on the Hub-PE.
If the VPN-in routing table has routes to all the Spoke stations, and the VPN-
out routing table has routes to the Hub and all the Spoke stations, it means
the configuration is successful.
● Run the display ip routing-table command to check routing information on
the Hub-CE and all the Spoke-CE devices.
The Hub-CE and all the Spoke-CE devices have routes to the Hub and all the
Spoke sites.
----End
Procedure
To implement inter-AS VPN Option A, complete basic BGP/MPLS IP VPN
configuration in each AS and configure the ASBR-PE devices as the CE device of
each other. You need to configure VPN instances for a PE device and an ASBR-PE
device respectively. The PE device connects to CE devices, and the ASBR-PE device
connects to the remote ASBR-PE device. For details about basic BGP/MPLS IP VPN
configuration, see 7.7.1 Configuring Basic BGP/MPLS IP VPN Functions.
NOTE
In inter-AS VPN Option A, the VPN targets of VPN instances on the ASBR and PE devices in
the same AS must match for the same VPN. This is not required for the PE devices in
different ASs.
● Run the display bgp vpnv4 all peer command on the PE or ASBR, and you
can view that the status of the BGP VPNv4 peer relationship between the PE
and ASBR in the same AS is "Established".
● Run the display bgp vpnv4 all routing-table command on the PE or ASBR,
and you can view the VPNv4 routes.
● Run the display ip routing-table vpn-instance vpn-instance-name command
on the PE or ASBR, and you can view that the VPN routing table of the PE or
ASBR has related VPN routes.
Pre-configuration Tasks
Before configuring inter-AS VPN Option B, complete the following tasks:
For details about the configurations, see 7.7.1 Configuring Basic BGP/MPLS IP
VPN Functions.
Configuration Procedure
7.7.4.4 (Optional) Configuring Routing Policies to Control VPN Route
Advertisement and Acceptance and 7.7.4.5 (Optional) Enabling Next-Hop-
based Label Allocation on the ASBR are optional, and other tasks are
mandatory. Perform these tasks in this sequence to complete inter-AS VPN Option
B configuration.
NOTE
In inter-AS VPN Option B, the ASBRs maintain and advertise VPNv4 routes of inter-AS VPNs,
and they can also work as PE devices. When the ASBRs work as PE devices, configure VPN
instances on the ASBRs to enable them to exchange routing information with CE devices.
The configuration is the same as that on common PE devices.
Context
Perform the following steps on the PE and ASBR in the same AS.
Procedure
Step 1 Run system-view
The loopback interface is specified as the outgoing interface of the BGP session.
NOTE
The 32-bit mask IP addresses of the loopback interfaces must be used to establish the MP-
IBGP peer relationship between PEs. This can ensure that the tunnel can be iterated. The
route destined to the loopback interface is advertised to the remote PE based on IGP on the
MPLS backbone network.
The exchange of VPNv4 routes between the PE and ASBR in the same AS is
enabled.
NOTE
When the ASBR sends a VPNv4 route to a PE, the ASBR can automatically change the next
hop in the VPNv4 route to the IP address of itself.
----End
Context
In inter-AS VPN Option B, you need not create VPN instances on ASBRs. The ASBR
does not filter the VPNv4 routes received from the PE in the same AS based on
VPN targets. Instead, it advertises the received VPNv4 routes to the peer ASBR
through MP-EBGP.
In the AR, an ASBR can only change the next-hop address of a VPNv4 route to the
ASBR's address before advertising the route to a PE.
Procedure
Step 1 Run system-view
The view of the interface connected with the ASBR interface is displayed.
Generally, one or multiple directly connected physical links exist between EBGP
peers. If the directly connected physical link(s) is/are not available, run this
command to ensure that the TCP connection can be set up between the EBGP
peers through multiple hops.
The exchange of IPv4 VPN routes with the peer ASBR is enabled.
----End
Context
By default, the PE performs VPN target filtering on the received IPv4 VPN routes.
The routes passing the filter are added to the routing table, and the others are
discarded. If the PE is not configured with VPN instance, or the VPN instance is not
configured with the VPN target, the PE discards all the received VPN IPv4 routes.
In Inter-AS VPN Option B, you do not need to configure VPN instances on the
ASBRs. An ASBR must save all the VPNv4 routes and advertises the VPNv4 routes
to the remote ASBR. In this case, the ASBR must accept all the VPNv4 routing
information without the VPN target filtering.
Procedure
Step 1 Run system-view
The VPN IPv4 routes are not filtered by the VPN target.
----End
Context
The ASBRs accept all VPNv4 routes after they are configured not to filter VPNv4
routes by VPN targets. When there are many VPN routes on the network, the
ASBRs are overburdened.
If only some of VPNs or sites need to communicate across ASs, you can configure
a routing policy on the ASBRs to restrict the VPNv4 routes that can be accepted by
the ASBRs. This reduces loads on the ASBRs.
This section describes how to configure the following filtering policies to control
VPNv4 route advertisement and acceptance:
● Filtering policy based VPN targets
● Filtering policy based on RDs
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run either of the following command to configure a route filter.
1. To configure an extended community filter, run ip extcommunity-filter
extcomm-filter-number { permit | deny } { rt { as-number:nn | ipv4-
address:nn } } &<1-16>.
2. To configure an RD filter, run ip rd-filter rd-filter-number { deny | permit }
route-distinguisher &<1-10>.
Step 3 Run route-policy route-policy-name permit node node
A routing policy is configured.
Step 4 Run either of the following command to configure an if-match clause in the
configured route filter:
1. If you configured an extended community filter in Step 2, run the if-match
extcommunity-filter { { basic-extcomm-filter-num | advanced-extcomm-
filter-num } &<1-16> | advanced-extcomm-filter-name | basic-extcomm-filter-
name } command to configure an if-match clause based on the extended
community filter in the routing policy.
2. If you configured an RD filter in Step 2, run the if-match rd-filter rd-filter-
number command to configure an if-match clause based on the RD filter in
the routing policy.
Step 5 Run quit
Return to the system view.
Step 6 Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
Step 7 Run ipv4-family vpnv4 [ unicast ]
The BGP-VPNv4 address family is displayed.
Step 8 Run peer ipv4-address route-policy route-policy-name { export | import }
The routing policy is applied to controlling the VPN IPv4 routing information.
----End
Context
In an inter-AS VPN Option B scenario, ASBRs can be enabled to allocate labels to
VPN routes based on next hops. This saves labels on the ASBRs.
Next-hop-based label allocation means to allocate the same label for the routes
with the same forwarding behavior. In other words, VPN routes with the same
forwarding path and outbound label are assigned the same label. Different from
VPN1
CE1 VPN1
CE3
BGP/MPLS backbone BGP/MPLS backbone
AS: 100 AS: 200
PE3
MP-EBGP
MP-IBGP
MP-IBGP
PE1 ASBR1 ASBR2
PE4
CE4
CE2
VPN2
VPN2
NOTICE
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
----End
Prerequisites
The configuration of inter-AS VPN Option B is complete.
Procedure
● Run the display bgp vpnv4 all peer command on the PE or ASBR. If the
status of the IBGP peer between the PE and ASBR in the same AS is
"Established", and the status of the EBGP peer between ASBRs in the different
AS is "Established", the configuration is successful.
● Run the display bgp vpnv4 all routing-table command on the ASBR. If the
VPN IPv4 routes are displayed, the configuration is successful.
● Run the display ip routing-table vpn-instance vpn-instance-name command
on the PE device. If the VPN routes are displayed, the configuration is
successful.
● Run the display mpls lsp command on the ASBR. If information about the
LSP and label is displayed, it means that the configuration succeeds. If the
ASBR is enabled with the next-hop-based label allocation, only one label is
allocated for the VPN routes with the same next hop and outgoing label.
● Run the display ip extcommunity-filter command on an ASBR to check the
configured extended community filters.
● Run the display ip rd-filter command on an ASBR to check the configured
RD filters.
----End
Pre-configuration Tasks
Before configuring inter-AS VPN Option C, complete the following tasks:
● Configuring an Interior Gateway Protocol (IGP) for the MPLS backbone
network of each AS to ensure IP connectivity on the backbone network within
each AS
● Configuring the basic MPLS functions and MPLS Label Distribution Protocol
(LDP) or Resource Reservation Protocol-Traffic Engineering (RSVP-TE) for the
MPLS backbone network of each AS
● In each AS, configuring VPN instances on the PE devices connected to CE
devices and associating the VPN instances with PE interfaces connected to CE
devices
● Configuring route exchange between the PE and CE devices in each AS
For details about the configurations, see 7.7.1 Configuring Basic BGP/MPLS IP
VPN Functions.
Context
The following solutions can be used to implement inter-AS VPN Option C:
● Solution 1: After learning the labeled BGP routes of the public network in the
remote AS from the remote ASBR, the local ASBR allocates labels for these
routes, and advertises these routes to the IBGP peer that supports the label
switching capability. In this manner, a complete LSP is set up.
● Solution 2: The IBGP peer relationship between the PE and ASBR is not
needed. In this solution, an ASBR learns the labeled public BGP routes of the
remote AS from the peer ASBR. Then these labeled public BGP routes are
imported to an IGP to trigger the establishment of an LDP LSP. In this manner,
a complete LDP LSP can be established between the two PEs.
Solution 1 is described in this section, and solution 2 is described in 7.7.6
Configuring Inter-AS VPN Option C (Solution 2).
Configuration Procedure
All the following tasks are mandatory. Perform these tasks in this sequence to
complete inter-AS VPN Option C configuration.
When VPN services need to be transmitted over TE tunnels or when multiple
tunnels need to perform load balancing to fully use network resources, you also
need to complete the task of 7.7.15 Configuring Tunnel Policies.
NOTE
In inter-AS VPN Option C mode, do not enable LDP between ASBRs. If LDP is enabled on
the interfaces between ASBRs, LDP sessions are then established between the ASBRs. When
a lot of BGP routes exist, many LDP labels are occupied.
Context
In inter-AS VPN Option C, establish an inter-AS VPN LSP. The related PEs and
ASBRs exchange public network routes with the MPLS labels.
The public network routes with the MPLS labels are advertised by the MP-BGP.
The label mapping information of a route is carried by advertising BGP updates.
This feature is implemented through BGP extension attributes, which requires BGP
peers to process the labeled IPv4 routes.
Procedure
● Configure a PE device.
a. Run system-view
The system view is displayed.
b. Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
c. Run peer ipv4-address as-number as-number
An IBGP peer relationship is established between the local PE and ASBR
in the same AS.
d. Run peer ipv4-address connect-interface loopback interface-number
A loopback interface is specified as the outbound interface of the BGP
session.
e. Run peer ipv4-address label-route-capability
Exchange of the labeled IPv4 routes with the ASBR in the same AS is
enabled.
● Configure an ASBR.
a. Run system-view
The system view is displayed.
b. Run interface interface-type interface-number
The view of the interface connected with the peer ASBR is displayed.
c. Run ip address ip-address { mask | mask-length }
The interface IP address is configured.
d. Run mpls
The MPLS capability is enabled.
e. Run quit
Return to the system view.
f. Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
g. Run peer ipv4-address as-number as-number
An IBGP peer relationship is established between the local PE and the
remote PE in the same AS.
h. Run peer ipv4-address connect-interface loopback interface-number
A loopback interface is specified as the outbound interface of the BGP
session.
i. Run peer ipv4-address label-route-capability
Exchange of the labeled IPv4 routes with the remote PE in the same AS is
enabled.
Context
You need to configure a routing policy to control label allocation for each inter-AS
BGP LSP. If labeled IPv4 routes are advertised to a PE of the local AS, you need to
re-allocate MPLS labels to these routes. If routes sent by a PE of the local AS are
advertised to the peer ASBR, you need to allocate MPLS labels to these routes.
Procedure
Step 1 Create a routing policy.
Perform the following steps on the ASBR.
1. Run system-view
The system view is displayed.
2. Run route-policy policy-name1 permit node node
For the labeled IPv4 routes received from peer ASBRs, and sent to the PEs in
the same AS, this policy ensures that a new MPLS label is allocated.
3. Run if-match mpls-label
For the labeled IPv4 routes received from PE in the local AS, and sent to the
remote ASBR, this policy ensures that a new MPLS label is allocated.
7. Run apply mpls-label
1. Run system-view
The routing policy adopted when the route is advertised to the local PE is
created.
4. Run peer ipv4-address route-policy policy-name2 export
The routing policy adopted when the route is advertised to the peer ASBR is
created.
Step 3 (Optional) Control the creation of ingress LSPs for labeled BGP routes based on
routing policies.
Perform the following steps on each PE.
1. Run system-view
The function to create ingress LSPs for labeled BGP routes based on routing
policies is configured.
On a MAN where the hybrid access mode is used, a large number of labeled
BGP routes are used to establish end-to-end LSPs. On certain intermediate
nodes where VPN services do not need to be supported, excessive ingress LSPs
are created, wasting network resources. In this case, you can run the ingress-
lsp trigger command to create ingress LSPs based on a routing policy to save
network resources.
----End
Context
By introducing extended community attributes into BGP, MP-EBGP can advertise
VPNv4 routes between PEs.
Procedure
● Configure a PE device to advertise its loopback interface IP addresses used for
peer relationship establishment to the ASBRs of other ASs and peer PE
devices. You can also configure an ASBR to send the loopback interface IP
addresses of a PE device used for peer relationship establishment to the
ASBRs of other ASs and peer PE devices.
a. Run system-view
The system view is displayed.
b. Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
c. Run network ip-address [ mask | mask-length ] [ route-policy route-
policy-name ]
The loopback address of the PE in the local AS is advertised to the
remote ASBR.
● (Optional) Disable an ASBR from advertising BGP supernet labeled routes.
In an inter-AS VPN Option C scenario, a PE uses a routing policy to assign a
label to its loopback address route and advertises this route as a BGP labeled
route. When an ASBR receives the route, the route is a BGP supernet labeled
route in which the destination address and next hop address are the same or
the destination address is more detailed than the next hop address. In
V2R3C00 or earlier, the ASBR does not advertise the received BGP supernet
labeled route. After the ASBR is upgraded to a version later than V2R3C00,
the ASBR can advertise the received BGP supernet labeled route to other BGP
peers. This advertisement may change the traffic path on the network before
and after the upgrade. To ensure that the traffic path remains unchanged,
disable the ASBR from advertising BGP supernet labeled routes.
a. Run system-view
The system view is displayed.
b. Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
Related Tasks
To improve scalability, specify an RR in each AS and establish MP-EBGP peer
relationships between the RRs in ASs to save all VPNv4 routes on the RRs. Then
Prerequisites
The configuration of inter-AS VPN Option C (Solution 1) is complete.
Procedure
● Run the display bgp vpnv4 all peer command to check the BGP peers on the
PE device. You can find the status of the EBGP peer between PEs is
"Established".
● Run the display bgp vpnv4 all routing-table command to check the VPN
IPv4 routing table on the PE or ASBR. You can view that the PE has the VPN
IPv4 routes while the ASBR has no VPN IPv4 route.
● Run the display bgp routing-table label command to check information
about the label of the IPv4 route on the ASBR.
● Run the display ip routing-table vpn-instance vpn-instance-name command
to check the VPN routing table on the PE device. The command displays all
VPN routes to all the CE devices in the VPN routing table of the PE device.
----End
Pre-configuration Tasks
Before configuring inter-AS VPN Option C, complete the following tasks:
For details about the configurations, see 7.7.1 Configuring Basic BGP/MPLS IP
VPN Functions.
Context
The following solutions can be used to implement inter-AS VPN-Option C:
● Solution 1: After learning the labeled BGP routes of the public network in the
remote AS from the remote ASBR, the local ASBR allocates labels for these
routes, and advertises these routes to the IBGP peer that supports the label
switching capability. In this manner, a complete LSP is set up.
● Solution 2: The IBGP peer relationship between the PE and ASBR is not
needed. In this solution, an ASBR learns the labeled public BGP routes of the
remote AS from the peer ASBR. Then these labeled public BGP routes are
imported to an IGP to trigger the establishment of an LDP LSP. In this manner,
a complete LDP LSP can be established between the two PEs.
NOTE
In inter-AS VPN Option C mode, do not enable LDP between ASBRs. If LDP is enabled on
the interfaces between ASBRs, LDP sessions are then established between the ASBRs. When
a lot of BGP routes exist, many LDP labels are occupied.
Configuration Procedure
All the following tasks are mandatory. Perform these tasks in this sequence to
complete inter-AS VPN Option C configuration.
Context
An EBGP peer relationship is established between ASBRs to advertise routes
destined for the loopback interfaces on PEs.
Procedure
Step 1 Run system-view
The view of the interface that connects the remote ASBR is displayed.
Generally, one or multiple directly connected physical links exist between EBGP
peers. If the directly connected physical link(s) is/are not available, run the peer
ebgp-max-hop command to ensure that the TCP connection can be set up
between the EBGP peers through multiple hops.
----End
Context
After the routes of the loopback interface on a PE in an AS are advertised to the
remote PE in another AS, the MP-EBGP peer relationship is established between
PEs.
Procedure
● The loopback address of the PE in the local AS is advertised to the remote
ASBR.
Perform the following steps on the local ASBR:
a. Run system-view
The system view is displayed.
b. Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
c. Run network ip-address [ mask | mask-length ]
The loopback address of the PE in the local AS is advertised to the
remote ASBR.
● The BGP routes are imported to IGP.
Perform the following steps on the peer ASBR:
a. Run system-view
The system view is displayed.
b. Run ospf process-id
The OSPF view is displayed.
c. Run import-route bgp [ cost cost ] [ route-policy route-policy-name ]
The BGP routes are imported to IGP.
----End
Context
To establish an inter-AS BGP LSP, you must enable ASBRs to exchange labeled IPv4
routes.
Perform the following steps on ASBRs.
Procedure
● Creating a routing policy.
a. Run system-view
The system view is displayed.
b. Run route-policy route-policy-name permit node node
The routing policy applied to advertise routes to the remote ASBR is
configured.
c. Run apply mpls-label
Labels for IPv4 routes are distributed.
d. Run quit
Return to the system view.
● Applying a Routing Policy
a. Run system-view
The system view is displayed.
The labeled IPv4 route exchange capability with the remote ASBR is
configured.
g. Run quit
----End
7.7.6.4 Establishing an LDP LSP for the Labeled BGP Routes of the Public
Network
Context
By enabling LDP on ASBRs to allocate labels for BGP routes, you can establish LDP
LSPs for labeled BGP routes of the public network that are filtered in the IP prefix
list.
Procedure
Step 1 Run system-view
----End
Prerequisites
By introducing extended community attributes into BGP, MP-IBGP can advertise
VPNv4 routes between PEs. PEs of different ASs are generally not directly
connected. To set up an EBGP connection between the PEs of different ASs, you
must configure the permitted maximum number of hops between PEs.
Perform the following steps on PEs.
Procedure
Step 1 Run system-view
The system view is displayed.
Step 2 Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
Step 3 Run peer ipv4-address as-number as-number
The remote PE is specified as the EBGP peer.
Step 4 Run peer ipv4-address connect-interface interface-type interface-number ipv4-
source-address
The source interface that sends BGP packets is specified.
Step 5 Run peer ipv4-address ebgp-max-hop [ hop-count ]
The maximum number of hops permitted to establish the EBGP peer is specified.
Step 6 (Optional) Run peer { group-name | ipv4-address } mpls-local-ifnet disable
The ability to establish an MPLS local IFNET tunnel between PEs is disabled.
In the Option C scenario, PEs establish an MP-EBGP peer relationship. Therefore,
an MPLS local IFNET tunnel between PEs is established over the MP-EBGP peer
relationship. The MPLS local IFNET tunnel fails to transmit traffic because PEs are
indirectly connected.
If a fault occurs on the BGP LSP between PEs, traffic is iterated to the MPLS local
IFNET tunnel, not an FRR bypass tunnel. As the MPLS local IFNET tunnel cannot
forward traffic, traffic is interrupted. To prevent the traffic interruption, run this
command to disable the establishment of an MPLS local IFNET tunnel between
PEs.
----End
Prerequisites
The configurations of the Inter-AS VPN Option C (Solution 2) function are
complete.
Procedure
● Run the display bgp vpnv4 all peer command to check information about
the specified VPNv4 peer on a PE. You can find that the EBGP peer
relationship between PEs is established.
● Run the display bgp vpnv4 all routing-table command to check information
about the VPN-IPv4 routing table on a PE or an ASBR. You can find that BGP
VPNv4 routes and BGP VPN instance routes are on the PE, rather than on the
ASBR.
● Run the display bgp routing-table label command to check information
about the labels of IPv4 routes on an ASBR.
● Run the display ip routing-table vpn-instance vpn-instance-name command
to check the VPN routing table on a PE device. You can find that the VPN
routing table of the PE has the VPN routes to the CE related to the specified
VPN instance.
● Run the display mpls route-state [ { exclude | include } { idle | ready |
settingup } * | destination-address mask-length ] [ verbose ] command to
check the matching relationship between routes and the LSP on an ASBR. You
can find the routes with the type as L, that is, the labeled BGP routes of the
public network.
● Run the display ip routing-table command to check information about the
routing table on an ASBR. You can find that the routes to the remote PE are
labeled BGP routes of the public network: The routing table is "Public", the
protocol type is "BGP", and the label has a non-zero value.
● Run the display mpls lsp [ vpn-instance vpn-instance-name ] [ protocol
ldp ] [ { exclude | include } ip-address mask-length ] [ outgoing-interface
interface-type interface-number ] [ in-label in-label-value ] [ out-label out-
label-value ] [ lsr-role { egress | ingress | transit } ] [ verbose ] command to
check whether an LDP LSP is established on an ASBR. You can find that an
LDP LSP is established between the ASBR and the remote PE. Besides, the LDP
ingress LSP to the remote PE can be found on the local PE.
----End
Pre-configuration Tasks
Before configuring an MCE device, complete the following tasks:
Configuration Procedure
The following tasks are mandatory and can be performed in a random order.
7.7.7.1 Configure Route Exchange Between an MCE Device and VPN Sites
Context
Routing protocols that can be used between an MCE device and VPN sites are
static route, the Routing Information Protocol (RIP), Open Shortest Path First
(OSPF), Intermediate System to Intermediate System (IS-IS), or Border Gateway
Protocol (BGP). Choose one of the following configurations as needed:
● Configure static routes between an MCE device and a site.
● Configure RIP between an MCE device and a site.
● Configure OSPF between an MCE device and a site.
● Configure IS-IS between an MCE device and a site.
● Configure BGP between an MCE device and a site.
The following configurations are performed on the MCE device. On the devices in
the site, you only need to configure the corresponding routing protocol.
Perform the following configurations on the device connected to the MCE device
in the site.
Context
Routing protocols that can be used between an MCE device and a PE device are
static routing, RIP, OSPF, IS-IS, and BGP. Choose one of the following
configurations as needed:
● Configure static routes between an MCE device and a PE device.
● Configure RIP between an MCE device and a PE device.
The following configurations are performed on the MCE device. The configurations
on the PE device are similar to those on a PE device in the BGP/MPLS IP VPN
networking. For detailed configuration, see Configuring Route Exchange
Between PE and CE Devices.
Return to quit -
system view.
Prerequisites
The configurations of the Multi-VPN-Instance CE function are complete.
Procedure
● Run the display ip routing-table vpn-instance vpn-instance-name
[ verbose ] command to check the VPN routing table on the multi-instance
CE. If there are routes to the LAN and the remote nodes for each service, the
configuration is successful.
----End
Pre-configuration Tasks
Before configuring HoVPN, complete the task of 7.7.1 Configuring Basic BGP/
MPLS IP VPN Functions.
Configuration Procedure
In addition to basic BGP/MPLS IP VPN configuration, you need to specify UPE
devices on the SPE device and advertise default routes of VPN instances to the
UPE devices.
NOTE
The VPN instance status obtained from a management information base (MIB) or schema
is Up only if at least one interface bound to the VPN instance is Up. On an HoVPN, VPN
instances on SPEs are not bound to interfaces. As a result, the VPN instance status obtained
from a MIB or schema is always Down. To solve this problem, run the transit-vpn
command in the VPN instance view or VPN instance IPv4 address family view of an SPE.
Then, the VPN instance status obtained from a MIB or schema is always Up, no matter
whether the VPN instance is bound to interfaces.
Procedure
Step 1 Specify a UPE device.
1. Run system-view
The capability of exchanging BGP VPNv4 routing information with the peer is
enabled.
6. Run peer { ipv4-address | group-name } upe
After running the command, the SPE advertises a default route to the UPE
with its local address as the next hop, regardless of whether there is a default
route in the local routing table.
----End
Context
The AR supports PBR to an LSP for VPN packets, which can be used for VPN data
forwarding.
If VPN packets do not match the PBR rules, they are forwarded according to
common VPN data forwarding process. If VPN packets match the PBR rules, they
are forwarded through the specified LSP.
NOTE
PBR to an LSP for VPN packets requires two or more LSPs. If PBR to an LSP for VPN packets
are used together with LDP FRR, the LSPs must work in active/standby mode. In other
situations, the LSPs can work in active/standby mode or load balancing mode.
Pre-configuration Tasks
Before configuring PBR to an LSP for VPN packets, complete the following tasks:
● Configuring an ACL to filter packets if you want to filter packets based on IP
addresses
● Configuring at least two LSPs from the ingress PE device to the egress PE
device
● Configuring LDP FRR if necessary
Procedure
Step 1 Configure PBR to an LSP for VPN packets.
1. Run system-view
The system view is displayed.
2. Run policy-based-route policy-name { deny | permit } node node-id
A routing policy or a policy node is created.
By default, the interval at which local PBR updates LSPs is 5000 ms.
1. Run system-view
The system view is displayed.
2. Run ip local policy-based-route policy-name
Local PBR is enabled.
Local PBR takes effect only to locally originated packets and only one local
PBR rule can be configured.
----End
NOTE
Before running the tracert lsp command on a CE device to check the packet forwarding
path, run the ttl propagate vpn command on the ingress and egress PE devices directly
connected to the CE device to enable MPLS IP TTL replication.
Pre-configuration Tasks
Before configuring an OSPF sham link, complete the following tasks:
Context
OSPF sham links are IP unnumbered P2P links between two PE devices on an
MPLS VPN backbone network.
Generally, BGP peers use BGP extended community attributes to carry routing
information over the MPLS VPN backbone. OSPF running on a PE device can use
the routing information to generate inter-area routes from the PE to CE devices.
As shown in Figure 7-39, if an intra-area OSPF link exists between the network
segments of local and remote CE devices, this OSPF link is called a backdoor link.
The routes that pass through a backdoor link are intra-area routes and have a
higher preference than the inter-area routes that pass through the MPLS VPN
backbone network. As a result, VPN traffic is always forwarded through the
backdoor routes instead of the backbone network. Generally, backdoor links are
only used as backup links.
To avoid such a problem, an OSPF sham link can be established between the PE
devices. In this way, the routes that pass through the MPLS VPN backbone
network become OSPF intra-area routes and are preferred over the backdoor
routes in VPN traffic forwarding.
Configure an OSPF sham link only when a backdoor link exists between two sites
in the same OSPF area. If no backdoor link exists between sites in the same area,
you do not need to configure any OSPF sham link.
Perform the following steps on the PE devices at both ends of a sham link.
Procedure
Step 1 Configure an endpoint address for the sham link.
Each VPN instance must have an endpoint address of the sham link. The endpoint
address is a loopback interface address with a 32-bit mask in the VPN address
space on a PE device. Multiple sham links of the same OSPF process share an
endpoint address, but sham links of different OSPF processes cannot have the
same endpoint address.
1. Run system-view
The system view is displayed.
2. Run interface loopback interface-number
A loopback interface is created and the loopback interface view is displayed.
3. Run ip binding vpn-instance vpn-instance-name
The loopback interface is bound to a VPN instance.
4. Run ip address ip-address { mask | mask-length }
An IP address is assigned to the loopback interface.
NOTE
The loopback interface address must have a 32-bit mask, 255.255.255.255.
NOTE
The route of the sham link endpoint address cannot be advertised to the peer PE
through an OSPF process bound to a VPN instance.
If the route of the sham link endpoint address is advertised to the peer PE through an
OSPF process bound to a VPN instance, the peer PE has two routes to the sham link
endpoint address. One route is learned from the OSPF process, and the other is
learned from MP-BGP. The OSPF route takes precedence over the BGP route, so the
peer PE uses the OSPF route. As a result, the sham link fails to be established.
NOTE
If plain is selected, the password is saved in the configuration file in plain text. This
brings security risks. It is recommended that you select cipher to save the password in
cipher text.
MD5 and HMAC-MD5 authentication cannot ensure security. Keychain authentication
is recommended.
To forward VPN traffic over the MPLS backbone network, ensure that the cost of the
sham link is smaller than the cost of the OSPF route used for forwarding VPN traffic
over the customer network. A commonly used method is to set the cost of the
forwarding interface on the customer network to be larger than the cost of the sham
link.
----End
through the backbone network but not an OSPF route that passes through
the customer network.
● Run the display ip routing-table and tracert host commands on a CE, and
you can find that the VPN traffic from the local CE to the remote CE is
forwarded through the backbone network.
● Run the display ospf process-id sham-link [ area area-id ] command on the
PE to check whether the sham link is established successfully. You can find
that the OSPF neighbor relationship between the PE and the remote CE is
Full.
● Run the display ospf routing on the CE, and you can find that the route to
the remote CE is an intra-area route.
Pre-configuration Tasks
Before configuring route reflection to optimize the VPN backbone layer, complete
the following tasks:
Configuration Procedure
All the following configuration tasks are mandatory. An RR can be any device such
as P, PE, and ASBR.
Context
Perform the following steps on all Client PEs.
Procedure
Step 1 Run system-view
----End
Context
Choose one of the following schemes to configure the RR.
Procedure
● Configuring the RR to establish MP IBGP connections with the peer group
Add all the client PEs to the peer group and establish MP-IBGP connections
with the peer group.
a. Run system-view
The system view is displayed.
b. Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
c. Run group group-name [ internal ]
An IBGP peer group is created.
d. Run peer group-name connect-interface interface-type interface-
number
The interface is specified as an interface to establish the TCP connection.
e. Run ipv4-family vpnv4
The BGP VPNv4 address family view is displayed.
f. Run peer group-name enable
The capability of exchanging IPv4 VPN routes between the RR and the
peer group is enabled.
By default, only the peer in the BGP IPv4 unicast address family view is
automatically enabled.
g. Run peer ip-address group group-name
The peer is added to the peer group.
The capability of exchanging VPNv4 routes between the RR and the client
PE is enabled.
----End
Context
Perform the following steps on the RR.
Procedure
Step 1 Run system-view
Step 4 Enable route reflection for BGP VPNv4 routes on the RR.
● Run the peer group-name reflect-client command to enable route reflection
if the RR establishes the MP IBGP connection with the peer group consisting
of client PEs.
● Run the peer ipv4-address reflect-client command repeatedly to enable
route reflection if the RR establishes the MP IBGP connection with each PE
rather than peer group.
----End
Prerequisites
The configurations of the reflection to optimize the VPN backbone layer function
are complete.
Procedure
● Run the display bgp vpnv4 all peer [ [ ipv4-address ] verbose ] command to
check information about the BGP VPNv4 peer on the RR or the Client PEs. You
can find that the status of the MP IBGP connections between the RR and all
Client PEs is "Established".
● Run the display bgp vpnv4 all routing-table peer ipv4-address { advertised-
routes | received-routes } command or display bgp vpnv4 all routing-table
statistics command to check information about the routes received from the
peer or the routes advertised to the peer on the RR or the Client PEs. You can
find that the RR and each Client PE can receive and send VPNv4 routing
information between each other.
● Run the display bgp vpnv4 all group [ group-name ] command to check
information about the VPNv4 peer group on the RR. You can view information
about the group members and find that the status of the BGP connections
between the RR and the group members is "Established".
----End
Pre-configuration Tasks
Before configuring IP FRR for VPN routes, complete the following tasks:
Context
IP FRR for VPN routes is used in scenarios where multiple CE devices connect to
one PE device. As shown in Figure 7-40, the PE device forwards data to the site of
vpn1 through Link_A, and Link_B is a backup link. When the PE device detects that
the route to CE1 is unreachable, it immediately switches traffic to Link_B and then
performs other operations to trigger VPN route convergence. This minimizes
impact of the link failure on VPN services.
CE1
VPN1 Site
IP/MPLS
Backbone Link_A
SwitchA
PE Link_B
CE2
Configuration Procedure
The router supports IP FRR for VPN routes.
Procedure
● configuring IP FRR
a. Run system-view
The backup next hop is optional for a P2P link and mandatory for a non-
P2P link.
e. Run quit
----End
Pre-configuration Tasks
Before configuring VPN FRR, complete the following tasks:
Context
VPN FRR is used in PE multi-homing scenarios to enhance network reliability. As
shown in Figure 7-41, if the primary link (Link A) between PE1 and ASBR1 fails,
VPN FRR quickly switches traffic to the backup link (Link B) between PE1 and
ASBR2 to minimize the impact of the link failure on VPN services.
Link B
CE2 ASBR2
NOTE
Procedure
● Configure manual VPN FRR.
a. Run system-view
The system view is displayed.
b. Run route-policy route-policy-name { permit | deny } node node
The routing policy node is created and the routing policy view is
displayed.
c. Run apply backup-nexthop ip-address
The backup next hop is configured.
d. Run quit
Return to the system view.
e. Run ip vpn-instance vpn-instance-name
The VPN instance view is displayed.
f. Run ipv4-family
The VPN instance IPv4 address family view is displayed.
g. Run vpn frr route-policy route-policy-name
The VPN FRR is enabled.
● Enable VPN auto FRR using a routing policy.
a. Run system-view
The system view is displayed.
b. Run route-policy route-policy-name { permit | deny } node node
The routing policy node is created and the routing policy view is
displayed.
c. Run apply backup-nexthop auto
The auto mode is used.
d. Run
quit
Return to the system view.
e. Run ip vpn-instance vpn-instance-name
The VPN instance view is displayed.
f. Run ipv4-family
The VPN instance IPv4 address family view is displayed.
g. Run vpn frr route-policy route-policy-name
The VPN FRR is enabled.
● (Optional) Add multiple VPNv4 routes to the VPN instance with a different
RD from these routes' RDs.
By default, if the RD of the VPN instance on the local PE is different from the
RDs of the VPN instances on multiple remote PEs, and the RDs of the VPN
instances on remote PEs are the same, the local PE adds only the optimal
route to the VPN instance after receiving VPNv4 or VPNv6 routes with the
same destination address from the remote PEs. As a result, load balancing or
VPN FRR does not take effect. To resolve this problem, run the vpn-route
cross multipath command on the local PE.
a. Run system-view
The system view is displayed.
b. Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
c. Run ipv4-family vpn-instance vpn-instance-name
Context
In GR process, two roles are defined according to their functions, that is, GR
restarter and GR helper.
● GR restarter: performs active/standby control board switchover or the system
upgrade.
● GR helper: helps the GR restarter to implement uninterrupted service
forwarding.
NOTE
The AR3260 can function as both the GR restarter and GR helper, and other devices can
only function as the GR helper.
NOTE
The GR capability cannot ensure uninterrupted traffic forwarding when the neighboring
device performs an active/standby switchover at the same time.
Pre-configuration Tasks
Before configuring VPN GR, complete the following tasks:
● 7.7.1 Configuring Basic BGP/MPLS IP VPN Functions
● Enabling GR Helper on all the devices on the network
Procedure
● Configure IS-IS GR or OSPF GR.
– For details about how to configure IS-IS GR, see section "Enabling IS-IS
GR" in Huawei AR Series Access Routers Configuration Guide - IP Routing.
– For details about how to configure OSPF GR, see section "Configuring
OSPF GR" in Huawei AR Series Access Routers Configuration Guide - IP
Routing.
● Configure BGP GR.
– For details about how to configure BGP GR, see section "Configuring the
BGP GR Function" in Huawei AR Series Access Routers Configuration
Guide - IP Routing.
● Configure MPLS LDP GR or MPLS TE GR.
– For details about how to configure MPLS LDP GR, see section
"Configuring LDP GR" in Huawei AR Series Access Routers Configuration
Guide - MPLS.
– For details about how to configure MPLS TE GR, see section "Configuring
RSVP GR" in Huawei AR Series Access Routers Configuration Guide -
MPLS.
----End
Pre-configuration Tasks
Before configuring a tunnel policy, complete the following tasks:
For details on how to create a GRE tunnel, see GRE Configuration in the Huawei AR
Series Access Routers Configuration Guide - VPN.
For details on how to create an LSP tunnel, see MPLS LDP Configuration in the
Huawei AR Series Access Routers Configuration Guide - MPLS.
For details on how to create a TE tunnel, see MPLS TE Configuration in the Huawei AR
Series Access Routers Configuration Guide - MPLS.
● Establishing the basic VPN network (For details about BGP/MPLS IP VPN
configuration, see Configuring Basic BGP/MPLS IP VPN Functions)
Before configuring and applying a tunnel selector, complete the following tasks:
Configuration Procedure
When VPN services need to be transmitted over TE or GRE tunnels, or when
multiple tunnels need to perform load balancing to fully use network resources,
complete the task of 7.7.15.1 Configuring and Applying a Tunnel Policy.
NOTE
By default, if you specify a nonexistent tunnel policy in a command, the command does not
take effect.
If you need the nonexistent tunnel policy can be specified in a command, run the tunnel-
policy nonexistent-config-check command.
Context
VPN data is transmitted over tunnels. By default, LSP tunnels are used to transmit
data, and each service is transmitted by only one LSP tunnel.
If the default tunnel configuration cannot meet VPN service requirements, apply
tunnel policies to VPNs. You can configure either of the following types of tunnel
policies according to service requirements:
● Tunnel type prioritization policy: This policy can change the type of tunnels
selected for VPN data transmission or select multiple tunnels for load
balancing.
● Tunnel binding policy: This policy can bind multiple TE tunnels to provide QoS
guarantee for a VPN.
Perform the following steps on the PE devices that need to use a tunnel policy.
Procedure
Step 1 Configure a tunnel policy.
By default, no tunnel policy is configured. LSP tunnels are used to transmit VPN
data and each VPN service is transmitted over one LSP tunnel.
1. Run system-view
NOTE
– If the PE device has multiple peers, you can run the tunnel binding command
multiple times to specify different destination IP addresses in a tunnel policy.
– If down-switch is specified in the command, the system selects available tunnels
in an order of LSP, CR-LSP, and GRE when the bound tunnels are unavailable.
----End
Context
By configuring a tunnel selector, you can set route filtering conditions to iterate
expected routes to the specified tunnels. A tunnel consists of two parts:
● if-match clause: matches an attribute of routes, for example, RD and next
hop.
If no if-match clause is configured in a tunnel selector, all routes match the
tunnel selector.
● apply clause: applies a tunnel policy to the routes matching the filtering rules.
After a tunnel selector is applied to routes on a PE, ASBR, or SPE device, the device
filters routes using the specified filtering rules and iterates the matching routes to
specified tunnels.
A tunnel selector takes effect for the following routes:
● VPNv4 routes: When a tunnel selector is applied to a BGP-VPNv4 address
family on an SPE device in HoVPN networking or an ASBR in inter-AS VPN
Option B networking, the SPE device or ASBR applies the tunnel policy to
VPNv4 routes and iterates the matching routes to expected tunnels.
● Labeled BGP-IPv4 routes: When a tunnel selector is applied to the BGP-IPv4
unicast address family on a PE device or an ASBR in inter-AS VPN Option C
networking, the PE device or ASBR applies the tunnel policy to labeled BGP-
IPv4 routes.
Procedure
Step 1 Create a tunnel selector.
1. Run system-view
The system view is displayed.
2. Run tunnel-selector tunnel-selector-name { permit | deny } node node
A tunnel selector is created, and tunnel selector view is displayed.
3. (Optional) Configure if-match clauses.
If no if-match clause is configured in a tunnel selector, all routes match the
tunnel selector.
– To configure an if-match clause that filters routes based on router
distinguishers (RDs), run if-match rd-filter rd-filter-number.
– To configure an if-match clause that filters routes based on next-hop
IPv4 addresses, run if-match ip next-hop { acl { acl-number | acl-name }
| ip-prefix ip-prefix-name }.
– To configure an if-match clause that filters routes based on next-hop
IPv6 addresses, run if-match ipv6 next-hop prefix-list ipv6-prefix-name.
4. Run apply tunnel-policy tunnel-policy-name
An apply clause is configured to specify a tunnel policy for the routes
matching the if-match clause.
Step 2 Apply the tunnel selector.
Perform the following steps on an SPE device in HoVPN networking or an ASBR in
inter-AS VPN Option B networking:
1. Run system-view
The system view is displayed.
2. Run bgp { as-number-plain | as-number-dot }
The BGP view is displayed.
3. Run ipv4-family vpnv4
The BGP-VPNv4 address family view is displayed.
----End
Pre-configuration Tasks
● 7.7.1 Configuring Basic BGP/MPLS IP VPN Functions
Configuration Procedure
Step 1, step 2, and step 3 can be performed at any sequence.
Procedure
Step 1 Configure a static route on the CE device.
1. Run system-view
The system view is displayed.
2. Run ip route-static ip-address { mask | mask-length } { interface-type
interface-number [ nexthop-address ] | nexthop-address } [ preference
preference | tag tag ] * [ description text ]
The static route to a public network destination address is configured.
ip-address can be a public network address or 0.0.0.0. If the dest-ip-address is
0.0.0.0, the static route is also called the default route. The mask of a default
route must be 0.0.0.0 or the mask-length of the default route must be 0. The
out-interface must be the interface connected directly with the PE device, and
the next-hop is the IP address of the peer PE interface connected directly with
the CE device.
NOTE
If the CE and PE devices are connected through an Ethernet network, the next-hop
must be specified.
A static route from the VPN to the Internet is configured and the next-hop
address is a public network address.
The static route from the public network to the VPN is configured and the
next-hop address is a private network address.
NOTE
If the CE and PE devices are connected through an Ethernet network, the next-hop
must be specified.
3. Advertise the static route to the Internet.
For detailed configuration, see the Huawei AR Series Access Routers
Configuration Guide - IP Routing. For example, if OSPF is running between
the PE device and the Internet, perform the following steps:
a. Run system-view
The system view is displayed.
b. Run ospf [ process-id ]
The OSPF view is displayed.
c. Run import-route static
Static routes are imported into OSPF.
----End
Prerequisites
L3VPN traffic statistics collection is applicable to the interface traffic at the user
side of a VPN. Before collecting L3VPN traffic statistics, you need to enable the
L3VPN traffic statistics function.
NOTE
● Currently, L3VPN traffic statistics collection can count only unicast packets.
● In L3VPN over MPLS TE scenarios, if the device is enabled to collect L3VPN traffic
statistics and traffic statistics on an MPLS TE tunnel interface simultaneously, packets
received from the interface bound to a VPN instance are not counted as L3VPN traffic.
● Enabling L3VPN traffic statistics function may affect the forwarding performance. For
example, when all interfaces provide line-speed forwarding, some interface may be
unable to forward packets at line speed. Exercise caution when you enable traffic
statistics on a VLANIF interface.
● L3VPN traffic statistics is unavailable for error packets.
Procedure
Step 1 Run the system-view command to enter the system view.
Step 2 Run the ip vpn-instance vpn-instance-name command to enter the VPN instance
view.
Step 3 Run the traffic-statistics enable command to enable the function of collecting
statistics about L3VPN traffic.
----End
Context
This function displays traffic statistics on the interface at the user side of the VPN.
Note that traffic statistics are collected only after the L3VPN traffic statistics
function is enabled.
Procedure
● Run the display traffic-statistics vpn-instance vpn-instance-name command
to check the statistics about L3VPN traffic of a specified VPN instance.
----End
NOTICE
Statistics cannot be restored after being cleared. Therefore, use this command
with caution.
Procedure
● Run the reset traffic-statistics vpn-instance { name vpn-instance-name |
all } command in the user view to clear statistics about L3VPN traffic of a
specified VPN instance or all VPN instances.
----End
Context
In routine maintenance, you can run the following commands in any view to
check the status of BGP/MPLS IP VPN.
Procedure
● Run the display ip vpn-instance [ verbose ] [ vpn-instance-name ] command
to check information about the VPN instance.
● Run the display default-parameter l3vpn command to check the default
configuration of L3VPN during initialization.
● Run the display ip routing-table vpn-instance vpn-instance-name command
to check the IP routing table of a VPN instance.
● Run the display bgp vpnv4 { all | vpn-instance vpn-instance-name }
routing-table [ statistics ] label command to check information about
labeled routes in the BGP routing table.
● Run the display bgp vpnv4 { all | route-distinguisher route-distinguisher |
vpn-instance vpn-instance-name } routing-table ipv4-address [ mask | mask-
length ] command to check information about the BGP VPNv4 routing table.
● Run the display bgp vpnv4 { all | route-distinguisher route-distinguisher |
vpn-instance vpn-instance-name } routing-table statistics command to
check statistics about the BGP VPNv4 routing table.
Context
After completing VPN configuration, you can:
● Run the ping command on the local CE to check whether the local CE and the
remote CE in the same VPN can communicate with each other. If the ping
fails, you can run the tracert command to locate the faulty node.
● Run the ping command with the -vpn-instance vpn-instance-name
parameter on the PE to check whether the PE and the CE in the same VPN as
the PE can communicate with each other. If the ping fails, you can run the
tracert command with the -vpn-instance vpn-instance-name parameter to
locate the faulty node.
If multiple interfaces on the PE are bound to the same VPN, you need to specify
the source IP address, that is, the -a source-ip-address when you ping or tracert
the remote CE that accesses the peer PE. If no source IP address is specified, the
PE selects the smallest IP address from the IP addresses of the interfaces on the PE
bound to this VPN as the source address of the Internet Control Message Protocol
(ICMP) messages. If the CE has no route to the selected IPv4 route, the CE discards
the returned ICMP message.
NOTE
By default, as for the MPLS time to live (MPLS TTL) timeout packet with a single label, the
router returns the ICMP message according to the local IP route (that is, the public network
route). However, no VPN route exists in the public network routing table of the ASBR and
therefore, the ICMP message is discarded when being sent to or returned by the ASBR.
Procedure
● Run the ping [ ip ] [ -a source-ip-address | -c count | -d | -f | -h ttl-value | [ -i
interface-type interface-number | -si source-interface-type source-interface-
number ] | -m time | -n | -name | -p pattern | -q | -r | -s packetsize | -system-
time | -t timeout | -tos tos-value | -v | -vpn-instance vpn-instance-name |
ignore-mtu ] * host [ ip-forwarding ] command to check network
connectivity from the local device to a specified destination IP address.
● Run the tracert [ -a source-ip-address | -f first-ttl | -m max-ttl | -name | -p
port | -q nqueries | -vpn-instance vpn-instance-name | -w timeout | -v ] * host
command to check the gateways that a data packet passes when it is sent
from the local device to the destination.
● Run the ping lsp [ -a source-ip | -c count | -exp exp-value | -h ttl-value | -m
interval | -r reply-mode | -s packet-size | -t time-out | -v ] * ip destination-
address mask-length [ ip-address ] [ nexthop nexthop-address | draft6 ]
command to check connectivity of a Label Switched Path (LSP).
● Run the tracert lsp [ -a source-ip | -exp exp-value | -h ttl-value | -r reply-
mode | -t time-out | -v ] * ip destination-address mask-length [ ip-address ]
[ nexthop nexthop-address | draft6 ] command to check the gateways that a
data packet passes when it is sent from the local device to the destination
along the LSP.
----End
Procedure
● Run the display ip routing-table vpn-instance vpn-instance-name statistics
command to check the integrated route statistics of an IPv4 VPN instance.
● Run the display ip routing-table all-vpn-instance statistics command to
check the integrated route statistics of all IPv4 VPN instances.
----End
Procedure
● Run the reset bgp vpn-instance vpn-instance-name ipv4-family [ ipv4-
address ] flap-info command in the user view to clear statistics of the BGP
peer flap for a specified VPN instance IPv4 address family.
● Run the reset bgp vpn-instance vpn-instance-name ipv4-family dampening
[ ipv4-address [ mask | mask-length ] ] command in the user view to clear
dampening information of the VPN instance IPv4 address family.
----End
Context
NOTICE
VPN services are interrupted after the BGP connection is reset. Exercise caution
when running the commands.
When the BGP configuration changes, you can use the soft reset or reset BGP
connections to let the new configurations take effect. A soft reset requires that the
BGP peers have route refreshment capability (supporting Route-Refresh
messages).
Procedure
● Run the refresh bgp vpn-instance vpn-instance-name ipv4-family { all |
ipv4-address | group group-name | internal | external } import command in
the user view to trigger the inbound soft reset of the VPN instance IPv4
address family's BGP connection.
● Run the refresh bgp vpn-instance vpn-instance-name ipv4-family { all |
ipv4-address | group group-name | internal | external } export command in
the user view to trigger the outbound soft reset of the VPN instance IPv4
address family's BGP connection.
● Run the refresh bgp vpnv4 { all | ipv4-address | group group-name | internal
| external } import command in the user view to trigger the inbound soft
reset of the BGP VPNv4 connection.
● Run the refresh bgp vpnv4 { all | ipv4-address | group group-name | internal
| external } export command in the user view to trigger the outbound soft
reset of the BGP VPNv4 connection.
● Run the reset bgp vpn-instance vpn-instance-name ipv4-family { as-number
| ipv4-address | group group-name | all | internal | external } command in
the user view to reset BGP connections of the VPN instance IPv4 address
family.
● Run the reset bgp vpnv4 { as-number | ipv4-address | group group-name |
all | internal | external } command in the user view to reset BGP VPNv4
connections.
----End
Context
In routine maintenance, run the following commands in any check to check the
tunnel status.
Procedure
● Run the display interface tunnel interface-number command to check
information about a specified tunnel interface.
● Run the display tunnel-info tunnel-id tunnel-id command to check detailed
information about a specified tunnel.
● Run the display tunnel-info all command to check information about all
tunnels.
● Run the display tunnel-policy [ tunnel-policy-name ] command to check the
configuration of a tunnel policy.
● Run the display ip vpn-instance verbose [ vpn-instance-name ] command to
check information about the tunnel policy applied to a VPN instance.
● Run the display ip routing-table vpn-instance vpn-instance-name [ ip-
address ] verbose command to check the tunnel to which VPN routes are
iterated.
----End
Loopback1
GE1/0/0 2.2.2.9/32 GE1/0/0
10.1.1.2/24 10.3.1.2/24
PE1 GE1/0/0 GE2/0/0 PE2
Loopback1 172.1.1.2/24 172.2.1.1/24 Loopback1
1.1.1.9/32 GE3/0/0 GE3/0/0 3.3.3.9/32
172.1.1.1/24 P 172.2.1.2/24
GE2/0/0 GE2/0/0
10.2.1.2/24 AS: 100 10.4.1.2/24
VPN Backbone
GE1/0/0 GE1/0/0
10.2.1.1/24 10.4.1.1/24
CE2 CE4
vpnb vpnb
AS: 65420
AS: 65440
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure OSPF on the MPLS backbone network so that the PEs and Ps can
communicate with each other.
# Configure PE1.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] interface gigabitethernet 3/0/0
[PE1-GigabitEthernet3/0/0] ip address 172.1.1.1 24
[PE1-GigabitEthernet3/0/0] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure P.
<Huawei> system-view
[Huawei] sysname P
[P] interface loopback 1
[P-LoopBack1] ip address 2.2.2.9 32
[P-LoopBack1] quit
[P] interface gigabitethernet 1/0/0
[P-GigabitEthernet1/0/0] ip address 172.1.1.2 24
[P-GigabitEthernet1/0/0] quit
[P] interface gigabitethernet 2/0/0
[P-GigabitEthernet2/0/0] ip address 172.2.1.1 24
[P-GigabitEthernet2/0/0] quit
[P] ospf
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 172.2.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
# Configure PE2.
<Huawei> system-view
[Huawei] sysname PE2
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 3.3.3.9 32
[PE2-LoopBack1] quit
[PE2] interface gigabitethernet 3/0/0
[PE2-GigabitEthernet3/0/0] ip address 172.2.1.2 24
[PE2-GigabitEthernet3/0/0] quit
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 172.2.1.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
Step 2 Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone network
to set up LDP LSPs.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.9
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface gigabitethernet 3/0/0
[PE1-GigabitEthernet3/0/0] mpls
[PE1-GigabitEthernet3/0/0] mpls ldp
[PE1-GigabitEthernet3/0/0] quit
# Configure P.
[P] mpls lsr-id 2.2.2.9
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] interface gigabitethernet 1/0/0
[P-GigabitEthernet1/0/0] mpls
[P-GigabitEthernet1/0/0] mpls ldp
[P-GigabitEthernet1/0/0] quit
[P] interface gigabitethernet 2/0/0
[P-GigabitEthernet2/0/0] mpls
[P-GigabitEthernet2/0/0] mpls ldp
[P-GigabitEthernet2/0/0] quit
# Configure PE2.
[PE2] mpls lsr-id 3.3.3.9
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface gigabitethernet 3/0/0
[PE2-GigabitEthernet3/0/0] mpls
[PE2-GigabitEthernet3/0/0] mpls ldp
[PE2-GigabitEthernet3/0/0] quit
After the configuration is complete, LDP sessions can be set up between PE1 and
the P and between the P and PE2. Run the display mpls ldp session command.
The command output shows that the Status field is Operational. Run the display
mpls ldp lsp command. Information about the established LDP LSPs is displayed.
Step 3 Configure VPN instances on PEs and bind the instances to the interfaces
connected to CEs.
# Configure PE1.
[PE1] ip vpn-instance vpna
[PE1-vpn-instance-vpna] ipv4-family
[PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[PE1-vpn-instance-vpna-af-ipv4] quit
[PE1-vpn-instance-vpna] quit
[PE1] ip vpn-instance vpnb
[PE1-vpn-instance-vpnb] ipv4-family
[PE1-vpn-instance-vpnb-af-ipv4] route-distinguisher 100:2
[PE1-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 both
[PE1-vpn-instance-vpna-af-ipv4] quit
[PE1-vpn-instance-vpnb] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[PE1-GigabitEthernet1/0/0] ip address 10.1.1.2 24
[PE1-GigabitEthernet1/0/0] quit
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] ip binding vpn-instance vpnb
[PE1-GigabitEthernet2/0/0] ip address 10.2.1.2 24
[PE1-GigabitEthernet2/0/0] quit
# Configure PE2.
NOTE
If a PE has multiple interfaces bound to the same VPN instance, specify a source IP
addresses by setting -a source-ip-address in the ping -vpn-instance vpn-instance-name -a
source-ip-address dest-ip-address command to ping the remote CE. If the source IP address
is not specified, the ping operation fails.
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] peer 1.1.1.9 as-number 100
[PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
After the configuration is complete, run the display bgp peer or display bgp
vpnv4 all peer command on the PEs. The command output shows that BGP peer
relationships have been established between the PEs.
[PE1] display bgp peer
Step 5 Set up EBGP peer relationships between the PEs and CEs and import VPN routes
into BGP.
# Configure CE1. The configurations of CE2, CE3, and CE4 are similar to the
configuration of CE1, and are not mentioned here.
[CE1] bgp 65410
[CE1-bgp] peer 10.1.1.2 as-number 100
After the configuration is complete, run the display bgp vpnv4 vpn-instance peer
command on the PEs. The command output shows that BGP peer relationships
have been established between the PEs and CEs.
The peer relationship between PE1 and CE1 is used as an example.
[PE1] display bgp vpnv4 vpn-instance vpna peer
# CEs in the same VPN can ping each other, whereas CEs in different VPNs cannot.
# For example, CE1 can ping CE3 at 10.3.1.1 but cannot ping CE4 at 10.4.1.1.
[CE1] ping 10.3.1.1
PING 10.3.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.3.1.1: bytes=56 Sequence=1 ttl=253 time=72 ms
Reply from 10.3.1.1: bytes=56 Sequence=2 ttl=253 time=34 ms
Reply from 10.3.1.1: bytes=56 Sequence=3 ttl=253 time=50 ms
Reply from 10.3.1.1: bytes=56 Sequence=4 ttl=253 time=50 ms
Reply from 10.3.1.1: bytes=56 Sequence=5 ttl=253 time=34 ms
--- 10.3.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 34/48/72 ms
[CE1] ping 10.4.1.1
PING 10.4.1.1: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 10.4.1.1 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
----End
Configuration Files
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 100:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpna
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpnb
ip address 10.2.1.2 255.255.255.0
#
interface GigabitEthernet3/0/0
ip address 172.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 3.3.3.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.9 enable
#
ipv4-family vpn-instance vpna
import-route direct
peer 10.1.1.1 as-number 65410
#
ipv4-family vpn-instance vpnb
import-route direct
peer 10.2.1.1 as-number 65420
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● P configuration file
#
sysname P
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 172.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 172.2.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 172.1.1.0 0.0.0.255
network 172.2.1.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 200:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 200:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 3.3.3.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpna
ip address 10.3.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpnb
ip address 10.4.1.2 255.255.255.0
#
interface GigabitEthernet3/0/0
ip address 172.2.1.2 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpna
import-route direct
peer 10.3.1.1 as-number 65430
#
ipv4-family vpn-instance vpnb
import-route direct
peer 10.4.1.1 as-number 65440
#
ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 172.2.1.0 0.0.0.255
#
return
#
sysname CE2
#
interface GigabitEthernet1/0/0
ip address 10.2.1.1 255.255.255.0
#
bgp 65420
peer 10.2.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.2.1.2 enable
#
return
Networking Requirements
As shown in Figure 7-43:
● CE1 connects to the headquarters R&D area of a company, and CE2 connects
to the branch R&D area. CE1 and CE2 belong to vpna.
● CE3 connects to the headquarters non-R&D area, and CE4 connects to the
branch non-R&D area. CE3 and CE4 belong to vpnb.
● TheR&D areas and non-R&D areas use overlapping address spaces.
vpna vpna
CE1 CE2
GE1/0/0 GE1/0/0
14.1.1.2/24 34.1.1.2/24
Loopback0
GE2/0/0 2.2.2.9/32 GE1/0/0
14.1.1.1/24 GE1/0/0 PE2 34.1.1.1/24
GE2/0/0
12.1.1.1/24 23.1.1.1/24
Loopback0 Loopback0
1.1.1.9/32 3.3.3.9/32
GE1/0/0 GE2/0/0
GE3/0/0 PE1 12.1.1.2/24 P 23.1.1.2/24 GE3/0/0
14.1.1.1/24 34.1.1.1/24
VPN Backbone
GE1/0/0 GE1/0/0
14.1.1.2/24 34.1.1.2/24
CE3 CE4
vpnb vpnb
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure OSPF between the P and PEs to ensure IP connectivity on the
backbone network.
2. Configure basic MPLS capabilities and MPLS LDP on the P and PEs to set up
MPLS LSP tunnels for VPN data transmission on the backbone network.
3. Configure MP-IBGP on PE1 and PE2 to enable them to exchange VPN routing
information.
4. Configure VPN instances vpna and vpnb on PE1 and PE2. Set the VPN target
of vpna to 100:100 and the VPN target of vpnb to 200:200. This configuration
allows users in the same VPN to communicate with each other and isolates
users in different VPNs. Bind the VPN instance to the PE interfaces connected
to CEs to provide access for VPN users.
5. Configure static routes on the CEs and PEs to exchange VPN routing
information.
Procedure
Step 1 Assign IP addresses to interfaces according to Figure 7-43.
# Configure PE1. The configuration on PE2, P, and CE1 to CE4 is similar to the
configuration on PE1 and is not mentioned here.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface loopback 0
[PE1-LoopBack0] ip address 1.1.1.9 32
[PE1-LoopBack0] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip address 12.1.1.1 24
[PE1-GigabitEthernet1/0/0] quit
Step 2 Configure OSPF on the MPLS backbone network so that the PEs and Ps can
communicate with each other.
# Configure PE1.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 12.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure P.
[P] ospf
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0
[P-ospf-1-area-0.0.0.0] network 12.1.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 23.1.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
# Configure PE2.
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 23.1.1.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
Step 3 Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone network
to set up LDP LSPs.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.9
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] mpls
[PE1-GigabitEthernet1/0/0] mpls ldp
[PE1-GigabitEthernet1/0/0] quit
# Configure P.
[P] mpls lsr-id 2.2.2.9
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] interface gigabitethernet 1/0/0
[P-GigabitEthernet1/0/0] mpls
[P-GigabitEthernet1/0/0] mpls ldp
[P-GigabitEthernet1/0/0] quit
[P] interface gigabitethernet 2/0/0
[P-GigabitEthernet2/0/0] mpls
[P-GigabitEthernet2/0/0] mpls ldp
[P-GigabitEthernet2/0/0] quit
# Configure PE2.
[PE2] mpls lsr-id 3.3.3.9
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface gigabitethernet 2/0/0
[PE2-GigabitEthernet2/0/0] mpls
[PE2-GigabitEthernet2/0/0] mpls ldp
[PE2-GigabitEthernet2/0/0] quit
After the configuration is complete, LDP sessions can be set up between PE1 and
the P and between the P and PE2. Run the display mpls ldp session command.
The command output shows that the Status field is Operational. Run the display
mpls ldp lsp command. Information about the established LDP LSPs is displayed.
The information displayed on PE1 is used as an example.
[PE1] display mpls ldp session
Step 4 Configure VPN instances on PEs and bind the instances to the interfaces
connected to CEs.
# Configure PE1.
[PE1] ip vpn-instance vpna
[PE1-vpn-instance-vpna] ipv4-family
[PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:100
[PE1-vpn-instance-vpna-af-ipv4] vpn-target 100:100 export-extcommunity
[PE1-vpn-instance-vpna-af-ipv4] vpn-target 100:100 import-extcommunity
[PE1-vpn-instance-vpna-af-ipv4] quit
[PE1-vpn-instance-vpna] quit
[PE1] ip vpn-instance vpnb
[PE1-vpn-instance-vpnb] ipv4-family
[PE1-vpn-instance-vpnb-af-ipv4] route-distinguisher 300:300
[PE1-vpn-instance-vpnb-af-ipv4] vpn-target 200:200 export-extcommunity
[PE1-vpn-instance-vpnb-af-ipv4] vpn-target 200:200 import-extcommunity
[PE1-vpn-instance-vpnb-af-ipv4] quit
[PE1-vpn-instance-vpnb] quit
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] ip binding vpn-instance vpna
[PE1-GigabitEthernet2/0/0] ip address 14.1.1.1 255.255.255.0
[PE1-GigabitEthernet2/0/0] quit
[PE1] interface gigabitethernet 3/0/0
[PE1-GigabitEthernet3/0/0] ip binding vpn-instance vpnb
[PE1-GigabitEthernet3/0/0] ip address 14.1.1.1 255.255.255.0
[PE1-GigabitEthernet3/0/0] quit
# Configure PE2.
[PE2] ip vpn-instance vpna
[PE2-vpn-instance-vpna] ipv4-family
[PE2-vpn-instance-vpna-af-ipv4] route-distinguisher 200:200
[PE2-vpn-instance-vpna-af-ipv4] vpn-target 100:100 export-extcommunity
[PE2-vpn-instance-vpna-af-ipv4] vpn-target 100:100 import-extcommunity
[PE2-vpn-instance-vpna-af-ipv4] quit
[PE2-vpn-instance-vpna] quit
[PE2] ip vpn-instance vpnb
[PE2-vpn-instance-vpnb] ipv4-family
[PE2-vpn-instance-vpnb-af-ipv4] route-distinguisher 400:400
[PE2-vpn-instance-vpnb-af-ipv4] vpn-target 200:200 export-extcommunity
[PE2-vpn-instance-vpnb-af-ipv4] vpn-target 200:200 import-extcommunity
[PE2-vpn-instance-vpnb-af-ipv4] quit
[PE2-vpn-instance-vpnb] quit
[PE2] interface gigabitethernet 1/0/0
# Configure CE1. The configurations of CE2, CE3, and CE4 are similar to the
configuration of CE1, and are not mentioned here.
<Huawei> system-view
[Huawei] sysname CE1
[CE1] interface gigabitethernet 1/0/0
[CE1-GigabitEthernet1/0/0] ip address 14.1.1.2 24
[CE1-GigabitEthernet1/0/0] quit
# Configure PE1.
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] peer 1.1.1.9 as-number 100
[PE2-bgp] peer 1.1.1.9 connect-interface loopback 0
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] ipv4-family vpn-instance vpna
[PE2-bgp-vpna] import-route direct
[PE2-bgp-vpna] quit
[PE2-bgp] ipv4-family vpn-instance vpnb
[PE2-bgp-vpnb] import-route direct
[PE2-bgp-vpnb] quit
[PE2-bgp] quit
After the configuration is complete, run the display bgp peer command on the
PEs. The command output shows that a BGP peer relationship has been set up
between the PEs.
[PE1] display bgp peer
BGP local router ID : 1.1.1.9
Local AS number : 100
Total number of peers : 1 Peers in established state : 1
Step 6 On CE1, CE2, CE3, and CE4, configure static routes to their connected PEs.
# Configure CE1. The configurations of CE2, CE3, and CE4 are similar to the
configuration of CE1, and are not mentioned here.
# Run the ping 34.1.1.2 command on CE1, and the ping is successful. Run the
display interface command on PE2 to view traffic statistics on GE1/0/0 and
GE3/0/0. The command output shows that there are packets passing through
GE1/0/0 but no packet passing through GE3/0/0. This indicates that the two VPN
instances have overlapping address spaces but they are isolated from each other.
----End
Configuration Files
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:100
vpn-target 100:100 export-extcommunity
vpn-target 100:100 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 300:300
vpn-target 200:200 export-extcommunity
vpn-target 200:200 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 12.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpna
ip address 14.1.1.1 255.255.255.0
#
interface GigabitEthernet3/0/0
ip binding vpn-instance vpnb
ip address 14.1.1.1 255.255.255.0
#
interface LoopBack0
ip address 1.1.1.9 255.255.255.255
#
bgp 100
#
sysname CE3
#
interface GigabitEthernet1/0/0
ip address 14.1.1.2 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet 1/0/0 14.1.1.1
#
return
A
A vpna
vpna Site2
Site1
CE1 CE3
GE1/0/0 GE1/0/0
GE1/0/0
10.1.1.2/24 10.3.1.2/24 GE1/0/0
10.1.1.1/24
10.3.1.1/24
IP/MPLS
B
vpnb B
vpnb
Site1
Site2
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure VPN instances on PE1 and configure different VPN targets for the
instances to isolate VPNs.
2. On PE1, bind the VPN instances to the interfaces connected to CEs to provide
access for VPN users.
3. Import direct routes to the local CEs into the VPN routing table on PE1. On
each CE connected to PE1, configure a static route to the other local CE to
enable the CEs to communicate with each other.
Procedure
Step 1 # Assign IP addresses to interfaces on CEs according to Figure 7-44.
# Configure CE1. The configuration on CE2 is similar to the configuration on CE1
and is not mentioned here.
<Huawei> system-view
[Huawei] sysname CE1
[CE1] interface gigabitethernet 1/0/0
[CE1-GigabitEthernet1/0/0] ip address 10.1.1.1 24
[CE1-GigabitEthernet1/0/0] quit
Step 2 Configure VPN instances on PEs and bind the instances to the interfaces
connected to CEs.
# Configure PE1.
<Huawei> system-view
[Huawei] sysname PE1
Each PE can ping its connected CE. The information displayed on PE1 and CE1 is
used as an example.
Step 3 Configure BGP and import the direct routes to local CEs to the VPN routing table.
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpna
[PE1–bgp-vpna] import-route direct
[PE1–bgp-vpna] quit
[PE1-bgp] ipv4-family vpn-instance vpnb
[PE1–bgp-vpnb] import-route direct
[PE1–bgp-vpnb] quit
[PE1–bgp] quit
# Configure CE2.
[CE2] ip route-static 10.1.1.0 24 10.2.1.2
----End
Configuration Files
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 222:2 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 100:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 111:1 import-extcommunity
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpna
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpnb
ip address 10.2.1.2 255.255.255.0
#
bgp 100
#
ipv4-family unicast
undo synchronization
#
ipv4-family vpn-instance vpna
import-route direct
#
ipv4-family vpn-instance vpnb
import-route direct
#
return
#
ip route-static 10.4.1.0 255.255.255.0 10.3.1.2
#
return
AS: 65430
Hub-CE
GE1/0/0 GE2/0/0
110.1.1.1/24 110.2.1.1/24
GE3/0/0 GE4/0/0
110.1.1.2/24 110.2.1.2/24
Hub-PE
GE1/0/0 GE2/0/0
10.1.1.2/24 11.1.1.2/24
Loopback1
Loopback1 2.2.2.9/32 Loopback1
1.1.1.9/32 3.3.3.9/32
GE1/0/0 GE1/0/0
100.1.1.1/24 120.1.1.1/24
Spoke-CE1 Spoke-CE2
vpna vpna
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure an IGP protocol on the backbone network to enable the Hub-PE
and Spoke-PEs to communicate with each other.
2. Configure basic MPLS capabilities and MPLS LDP on the backbone network to
set up LDP LSPs.
3. Set up MP-IBGP peer relationships between the Hub-PE and the Spoke-PEs.
The Spoke-PEs do not need to set up an MP-IBGP peer relationship or
exchange VPN routing information.
4. Create two VPN instances on the Hub-PE. One is used to receive routes from
Spoke-PEs, and the other is used to advertise routes to the Spoke-PEs. Set
import target of the first VPN instance to 100:1 and the export target of the
other VPN instance to 200:1.
5. Create a VPN instance on the Spoke-PEs. Set the export target of the VPN
instance to 100:1 and the import target to 200:1.
6. Configure EBGP on the CEs and PEs to enable them to exchange VPN routing
information. Configure Hub-PE to allow Hub-PE to receive the route with the
AS repeated for one time.
Procedure
Step 1 Configure OSPF on the backbone network to enable the Hub-PE and Spoke-PEs to
communicate with each other.
Step 2 Configure basic MPLS capabilities and MPLS LDP on the backbone network to set
up LDP LSPs.
After the configuration is complete, the Hub-PE can set up LDP peer relationships
with the Spoke-PEs. Run the display mpls ldp session command on the PEs. In
the command output, the state is Operational. Run the display mpls ldp lsp
command. Information about the established LDP LSPs is displayed.
Step 3 Configure VPN instances on PEs and bind the instances to the interfaces
connected to CEs.
NOTE
The import target of the VPN instances on the Hub-PE is the export target of the VPN
instance on the Spoke-PEs. The import target and export target on the Hub-PE are
different. The import VPN target on the Spoke-PEs is the export VPN target on the Hub-PE.
# Configure Spoke-PE1.
#Configure Spoke-PE2.
NOTE
If a PE has multiple interfaces bound to the same VPN instance, you need to specify the
source IP addresses by setting -a source-ip-address in the ping -vpn-instance vpn-instance-
name -a source-ip-address dest-ip-address command to ping the remote CE. If the source IP
address is not specified, the ping operation fails.
Step 4 Set up EBGP peer relationships between the PEs and CEs and import VPN routes
into BGP.
NOTE
To accept the routes advertised by Hub-CE, configure the Hub-PE to allow AS number to be
repeated once.
# Configure Spoke-CE1.
[Spoke-CE1] bgp 65410
[Spoke-CE1-bgp] peer 100.1.1.2 as-number 100
[Spoke-CE1-bgp] import-route direct
[Spoke-CE1-bgp] quit
# Configure Spoke-PE1.
[Spoke-PE1] bgp 100
[Spoke-PE1-bgp] ipv4-family vpn-instance vpna
[Spoke-PE1-bgp-vpna] peer 100.1.1.1 as-number 65410
[Spoke-PE1-bgp-vpna] import-route direct
[Spoke-PE1-bgp-vpna] quit
[Spoke-PE1-bgp] quit
# Configure Spoke-CE2.
[Spoke-CE2] bgp 65420
[Spoke-CE2-bgp] peer 120.1.1.2 as-number 100
[Spoke-CE2-bgp] import-route direct
[Spoke-CE2-bgp] quit
#Configure Spoke-PE2.
[Spoke-PE2] bgp 100
[Spoke-PE2-bgp] ipv4-family vpn-instance vpna
[Spoke-PE2-bgp-vpna] peer 120.1.1.1 as-number 65420
[Spoke-PE2-bgp-vpna] import-route direct
[Spoke-PE2-bgp-vpna] quit
[Spoke-PE2-bgp] quit
After the configuration is complete, run the display bgp vpnv4 all peer command
on the PEs. The command output shows that the BGP peer relationships have
been set up between the PEs and CEs and are in Established state.
Step 5 Set up MP-IBGP peer relationships between the Spoke-PEs and Hub-PE.
NOTE
The Spoke-PEs do not need to allow the repeated AS number, because the router does not
check the AS_Path attribute in the routing information advertised by the IBGP peers.
# Configure Spoke-PE1.
[Spoke-PE1] bgp 100
[Spoke-PE1-bgp] peer 2.2.2.9 as-number 100
[Spoke-PE1-bgp] peer 2.2.2.9 connect-interface loopback 1
[Spoke-PE1-bgp] ipv4-family vpnv4
[Spoke-PE1-bgp-af-vpnv4] peer 2.2.2.9 enable
[Spoke-PE1-bgp-af-vpnv4] quit
#Configure Spoke-PE2.
[Spoke-PE2] bgp 100
[Spoke-PE2-bgp] peer 2.2.2.9 as-number 100
[Spoke-PE2-bgp] peer 2.2.2.9 connect-interface loopback 1
[Spoke-PE2-bgp] ipv4-family vpnv4
[Spoke-PE2-bgp-af-vpnv4] peer 2.2.2.9 enable
[Spoke-PE2-bgp-af-vpnv4] quit
After the configuration is complete, run the display bgp peer or display bgp
vpnv4 all peer command on the PEs. The command output shows that the BGP
peer relationships have been set up between the Spoke-PEs and the Hub-PE and
are in Established state.
# After the configuration is complete, the Spoke-CEs can ping each other. Run the
tracert command on the CEs. The command output shows that the traffic
between the Spoke-CEs is forwarded through the Hub-CE. You can also deduce the
number of forwarding devices between the Spoke-CEs based on the TTL in the
ping result.
# Run the display bgp routing-table command on the Spoke-CEs. The command
output shows the repeated AS number in AS paths of the BGP routes to the
remote Spoke-CE.
# The information displayed on Spoke-CE1 is used as an example.
[Spoke-CE1] display bgp routing-table
----End
Configuration Files
● Spoke-CE1 configuration file
#
sysname Spoke-CE1
#
interface GigabitEthernet1/0/0
ip address 100.1.1.1 255.255.255.0
#
bgp 65410
peer 100.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 100.1.1.2 enable
#
return
#
return
● Hub-PE configuration file
#
sysname Hub-PE
#
ip vpn-instance vpn_in
ipv4-family
route-distinguisher 100:21
vpn-target 100:1 import-extcommunity
#
ip vpn-instance vpn_out
ipv4-family
route-distinguisher 100:22
vpn-target 200:1 export-extcommunity
#
mpls lsr-id 2.2.2.9
mpls
label advertise non-null
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 10.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 11.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet3/0/0
ip binding vpn-instance vpn_in
ip address 110.1.1.2 255.255.255.0
#
interface GigabitEthernet4/0/0
ip binding vpn-instance vpn_out
ip address 110.2.1.2 255.255.255.0
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable
peer 3.3.3.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
peer 3.3.3.9 enable
#
ipv4-family vpn-instance vpn_in
peer 110.1.1.1 as-number 65430
import-route direct
#
ipv4-family vpn-instance vpn_out
peer 110.2.1.1 as-number 65430
peer 110.2.1.1 allow-as-loop
import-route direct
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 10.1.1.0 0.0.0.255
network 11.1.1.0 0.0.0.255
#
return
Networking Requirements
The headquarters and branches of a company connect to networks of different
carriers. To enable the headquarters and branches to communicate, Inter-AS BGP/
MPLS IP VPN needs to be implemented. As shown in Figure 7-46, CE1 is located in
the headquarters and connects to PE1 in AS 100. CE2 is located at the branch and
connects to PE2 in AS 200. Both CE1 and CE2 belong to vpn1.
GE1/0/0 GE1/0/0
172.1.1.1/24 ASBR-PE1 ASBR-PE2 162.1.1.1/24
Loopback1 Loopback1
1.1.1.9/32 4.4.4.9/32
GE1/0/0 GE1/0/0
172.1.1.2/24 162.1.1.2/24
PE1 PE2
GE2/0/0 GE2/0/0
10.1.1.2/24 10.2.1.2/24
GE1/0/0 GE1/0/0
CE1 CE2
10.1.1.1/24 10.2.1.1/24
vpn1 vpn1
AS 65001 AS 65002
Configuration Roadmap
Inter-AS Option A can be deployed to meet the company's requirement. The
configuration roadmap is as follows:
1. On the MPLS backbone network in AS 100 and AS 200, configure an IGP
protocol to enable the PE and ASBR-PEs to communicate with each other.
2. Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone
network to set up LDP LSPs.
3. Set up an MP-IBGP peer relationship between the PE and ASBR-PEs in each
AS to exchange VPN routing information.
4. Create a VPN instance on the PE in each AS and bind the VPN instance to the
interface connected to the CE.
5. Set up an EBGP peer relationship between the PEs and CEs in each AS to
exchange VPN routing information.
6. Create a VPN instance on each ASBR-PE and bind the instance to the interface
connected to the other ASBR-PE (regarding the ASBR-PE as its CE). Set up an
EBGP peer relationship between the ASBR-PEs to exchange VPN routing
information.
Procedure
Step 1 Assign IP addresses to interfaces according to Figure 7-46.
# Configure PE1. The configuration on PE2, CE1, CE2, ASBR-PE1, and ASBR-PE2 is
similar to the configuration on PE1 and is not mentioned here.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip address 172.1.1.2 24
[PE1-GigabitEthernet1/0/0] quit
Step 2 On the MPLS backbone network in AS 100 and AS 200, configure OSPF to enable
the PEs and the ASBR-PEs to communicate with each other.
# Configure PE1. The configuration on PE2 and ASBR-PEs is similar to the
configuration on PE1 and is not mentioned here.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
NOTE
The 32-bit loopback interface address used as LSR ID should be advertised by the PEs and
ASBR-PEs using OSPF.
After the configuration is complete, the ASBR-PEs and PEs in the same AS can set
up an OSPF neighbor relationship. Run the display ospf peer command to verify
that the status of the neighbor relationship is Full. Run the display ip routing-
table command. The command output shows that the ASBR and PEs in the same
AS have learned the routes to Loopback1 of each other.
Step 3 Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone network
of AS 100 and AS 200 to set up LDP LSPs.
# Configure basic MPLS capabilities on PE1 and enable LDP on the interface
connected to ASBR-PE1.
[PE1] mpls
[PE1-mpls] label advertise non-null
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] mpls
[PE1-GigabitEthernet1/0/0] mpls ldp
[PE1-GigabitEthernet1/0/0] quit
# Configure basic MPLS capabilities on ASBR-PE1 and enable LDP on the interface
connected to PE1.
# Configure basic MPLS capabilities on ASBR-PE2 and enable LDP on the interface
connected to PE2.
# Configure basic MPLS capabilities on PE2 and enable LDP on the interface
connected to ASBR-PE2.
After the configuration is complete, the PE and ASBR-PEs in the same AS can set
up an LDP peer relationship. Run the display mpls ldp session command on the
PE and ASBR-PEs to verify that the state is Operational.
The information displayed on PE1 is used as an example.
[PE1] display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
Step 4 Set up an MP-IBGP peer relationship between the PE and ASBR-PEs in each AS to
exchange VPN routing information.
Step 5 On the PEs, create a VPN instance, enable the IPv4 address family in the instance,
and bind the instance to the interfaces connected to CEs.
NOTE
The VPN targets of the VPN instances on the ASBR-PE and PEs in an AS must match. In
different ASs, the VPN targets of the PEs do not need to match.
Step 6 Set up EBGP peer relationships between the PEs and CEs to exchange VPN routing
information.
After the configuration is complete, run the display bgp vpnv4 vpn-instance vpn-
instanc-ename peer command on the PEs. The command output shows that the
BGP peer relationships have been set up between the PEs and CEs and are in
Established state. Run the display bgp vpnv4 all peer command on the PEs. The
command output shows that each PE has set up a BGP peer relationship with the
CE and ASBR-PEs in the same AS, and the BGP peer relationships are in
Established state.
The information displayed on PE1 is used as an example.
[PE1] display bgp vpnv4 vpn-instance vpn1 peer
# On ASBR-PE2, create a VPN instance and bind the VPN instance to the interface
connected to ASBR-PE1 (ASBR-PE2 considers ASBR-PE1 as its CE).
[ASBR-PE2] ip vpn-instance vpn1
[ASBR-PE2-vpn-instance-vpn1] ipv4-family
Run the display bgp vpnv4 vpn-instance vpn1 peer command on the ASBR-PEs.
The command output shows that a BGP peer relationship has been established
between the ASBR-PEs and is in Established state.
Step 8 Verify the configuration.
# After the configuration is complete, CE1 and CE2 learn routes to interfaces on
each other and can ping each other successfully.
# The information displayed on CE1 is used as an example.
[CE1] display ip routing-table
Route Flags:
R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.1.1.0/24 Direct 0 0 D 10.1.1.1 GigabitEthernet1/0/0
10.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
10.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
10.2.1.0/24 EBGP 255 0 D 10.1.1.2 GigabitEthernet1/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.1.1.0/24 EBGP 255 0 D 10.1.1.2 GigabitEthernet1/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[CE1] ping 10.2.1.1
PING 10.2.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.2.1.1: bytes=56 Sequence=1 ttl=251 time=119 ms
Reply from 10.2.1.1: bytes=56 Sequence=2 ttl=251 time=141 ms
Reply from 10.2.1.1: bytes=56 Sequence=3 ttl=251 time=136 ms
Reply from 10.2.1.1: bytes=56 Sequence=4 ttl=251 time=113 ms
Reply from 10.2.1.1: bytes=56 Sequence=5 ttl=251 time=78 ms
--- 10.2.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 78/117/141 ms
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
bgp 65001
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
return
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:1
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
label advertise non-null
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 172.16.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 10.1.1.2 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 2.2.2.9 as-number 100
peer 2.2.2.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.9 enable
#
ipv4-family vpn-instance vpn1
peer 10.1.1.1 as-number 65001
import-route direct
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● ASBR-PE1 configuration file
#
sysname ASBR-PE1
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:2
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 2.2.2.9
mpls
label advertise non-null
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 172.16.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 192.1.1.1 255.255.255.0
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
import-route direct
peer 1.1.1.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpn1
peer 192.1.1.2 as-number 200
import-route direct
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● ASBR-PE2 configuration file
#
sysname ASBR-PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 200:2
vpn-target 2:2 export-extcommunity
vpn-target 2:2 import-extcommunity
#
mpls lsr-id 3.3.3.9
mpls
label advertise non-null
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 162.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 192.1.1.2 255.255.255.0
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
bgp 200
peer 4.4.4.9 as-number 200
peer 4.4.4.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 4.4.4.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 4.4.4.9 enable
#
ipv4-family vpn-instance vpn1
peer 192.1.1.1 as-number 100
import-route direct
#
ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 162.1.1.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 200:1
vpn-target 2:2 export-extcommunity
vpn-target 2:2 import-extcommunity
#
mpls lsr-id 4.4.4.9
mpls
label advertise non-null
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 162.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 10.2.1.2 255.255.255.0
#
interface LoopBack1
ip address 4.4.4.9 255.255.255.255
#
bgp 200
peer 3.3.3.9 as-number 200
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 3.3.3.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.9 enable
#
ipv4-family vpn-instance vpn1
peer 10.2.1.1 as-number 65002
import-route direct
#
ospf 1
area 0.0.0.0
Networking Requirements
The headquarters and branches of a company connect to networks of different
carriers. To enable the headquarters and branches to communicate, Inter-AS BGP/
MPLS IP VPN needs to be implemented. As shown in Figure 7-47, CE1 is located in
the headquarters and connects to PE1 in AS 100. CE2 is located at the branch and
connects to PE2 in AS 200. Both CE1 and CE2 belong to vpn1.
GE1/0/0 GE1/0/0
172.1.1.1/24 ASBR-PE1 ASBR-PE2 162.1.1.1/24
Loopback1 Loopback1
1.1.1.9/32 4.4.4.9/32
GE1/0/0 GE1/0/0
172.1.1.2/24 162.1.1.2/24
PE1 PE2
GE2/0/0 GE2/0/0
10.1.1.2/24 10.2.1.2/24
GE1/0/0 GE1/0/0
CE1 CE2
10.1.1.1/24 10.2.1.1/24
vpn1 vpn1
AS 65001 AS 65002
Configuration Roadmap
Inter-AS Option B can be deployed to meet the company's requirement. The
configuration roadmap is as follows:
1. On the MPLS backbone network in AS 100 and AS 200, configure an IGP
protocol to enable the PE and ASBR-PEs to communicate with each other.
2. Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone
network to set up LDP LSPs.
3. Set up an MP-IBGP peer relationship between the PE and ASBR-PEs in each
AS to exchange VPN routing information.
4. Create a VPN instance on the PE in each AS and bind the VPN instance to the
interface connected to the CE.
5. Set up an EBGP peer relationship between the PEs and CEs between the ASs
to exchange VPN routing information.
6. Enable MPLS on the interfaces connecting the ASBRs and set up an MP-EBGP
peer relationship between the ASBRs. Configure the ASBRs not to filter
received VPNv4 routes based on VPN targets.
Procedure
Step 1 Assign IP addresses to interfaces according to Figure 7-47.
# Configure PE1. The configuration on PE2, CE1, CE2, ASBR-PE1, and ASBR-PE2 is
similar to the configuration on PE1 and is not mentioned here.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip address 172.1.1.2 24
[PE1-GigabitEthernet1/0/0] quit
Step 2 On the MPLS backbone network in AS 100 and AS 200, configure OSPF to enable
the PEs and the ASBR-PEs to communicate with each other.
# Configure PE1. The configuration on PE2 and ASBR-PEs is similar to the
configuration on PE1 and is not mentioned here.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
NOTE
The 32-bit loopback interface address used as LSR ID should be advertised by the PEs and
ASBR-PEs using OSPF.
After the configuration is complete, the ASBR and PEs in the same AS can set up
an OSPF neighbor relationship. Run the display ospf peer command to verify that
the status of the neighbor relationship is Full. Run the display ip routing-table
command. The command output shows that the ASBR and PEs in the same AS
have learned the routes to Loopback1 of each other.
Step 3 Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone network
of AS 100 and AS 200 to set up LDP LSPs.
# Configure basic MPLS capabilities on PE1 and enable LDP on the interface
connected to ASBR-PE1.
# Configure basic MPLS capabilities on ASBR-PE1 and enable LDP on the interface
connected to PE1.
[ASBR-PE1-mpls-ldp] quit
[ASBR-PE1] interface gigabitethernet 1/0/0
[ASBR-PE1-GigabitEthernet1/0/0] mpls
[ASBR-PE1-GigabitEthernet1/0/0] mpls ldp
[ASBR-PE1-GigabitEthernet1/0/0] quit
# Configure basic MPLS capabilities on ASBR-PE2 and enable LDP on the interface
connected to PE2.
# Configure basic MPLS capabilities on PE2 and enable LDP on the interface
connected to ASBR-PE2.
After the configuration is complete, the PE and ASBR-PEs in the same AS can set
up an LDP peer relationship. Run the display mpls ldp session command on the
PE and ASBR-PEs to verify that the state is Operational.
The information displayed on PE1 is used as an example.
[PE1] display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.9:0 Operational DU Active 0002:23:46 17225/17224
------------------------------------------------------------------------------
TOTAL: 1 session(s) Found.
Step 4 Set up an MP-IBGP peer relationship between the PE and ASBR-PEs in each AS to
exchange VPN routing information.
# On PE1: set up an MP-IBGP peer relationship with ASBR-PE1. The configuration
on PE2 is similar to the configuration on PE1 and is not mentioned here.
[PE1] bgp 100
[PE1-bgp] peer 2.2.2.9 as-number 100
[PE1-bgp] peer 2.2.2.9 connect-interface loopback 1
[PE1-bgp] ipv4-family vpnv4
[PE1-bgp-af-vpnv4] peer 2.2.2.9 enable
[PE1-bgp-af-vpnv4] quit
[PE1-bgp] quit
Step 5 On the PEs, create a VPN instance, enable the IPv4 address family in the instance,
and bind the instance to the interfaces connected to CEs.
NOTE
The VPN targets of the VPN instances on the ASBR-PE and PEs in an AS must match. In
different ASs, the VPN targets of the PEs do not need to match.
Step 6 Set up EBGP peer relationships between the PEs and CEs to exchange VPN routing
information.
# Configure CE1. The configuration on CE2 is similar to the configuration on CE1
and is not mentioned here.
# Configure PE1. The configuration on PE2 is similar to the configuration PE1 and
is not mentioned here.
After the configuration is complete, run the display bgp vpnv4 vpn-instance vpn-
instancename peer command on the PEs. The command output shows that the
BGP peer relationships have been set up between the PEs and CEs and are in
Established state. Run the display bgp vpnv4 all peer command on the PEs. The
command output shows that each PE has set up a BGP peer relationship with the
CE and ASBR-PEs in the same AS, and the BGP peer relationships are in
Established state.
The information displayed on PE1 is used as an example.
[PE1] display bgp vpnv4 vpn-instance vpn1 peer
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
bgp 65001
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
return
route-distinguisher 100:1
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 172.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 10.1.1.2 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 2.2.2.9 as-number 100
peer 2.2.2.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.9 enable
#
ipv4-family vpn-instance vpn1
peer 10.1.1.1 as-number 65001
import-route direct
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● ASBR-PE1 configuration file
#
sysname ASBR-PE1
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 172.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 192.1.1.1 255.255.255.0
mpls
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
bgp 100
peer 192.1.1.2 as-number 200
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 192.1.1.2 enable
peer 1.1.1.9 enable
#
ipv4-family vpnv4
undo policy vpn-target
apply-label per-nexthop
peer 1.1.1.9 enable
peer 192.1.1.2 enable
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● ASBR-PE2 configuration file
#
sysname ASBR-PE2
#
mpls lsr-id 3.3.3.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 162.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 192.1.1.2 255.255.255.0
mpls
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
bgp 200
peer 192.1.1.1 as-number 100
peer 4.4.4.9 as-number 200
peer 4.4.4.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 192.1.1.1 enable
peer 4.4.4.9 enable
#
ipv4-family vpnv4
undo policy vpn-target
apply-label per-nexthop
peer 4.4.4.9 enable
peer 192.1.1.1 enable
#
ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 172.17.1.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 200:1
vpn-target 1:1 export-extcommunity
Networking Requirements
The headquarters and branches of a company connect to networks of different
carriers. To enable the headquarters and branches to communicate, Inter-AS BGP/
GE1/0/0 GE1/0/0
172.1.1.1/24 ASBR-PE1 ASBR-PE2 162.1.1.1/24
Loopback1 Loopback1
1.1.1.9/32 4.4.4.9/32
GE1/0/0 GE1/0/0
172.1.1.2/24 162.1.1.2/24
PE1 PE2
GE2/0/0 GE2/0/0
10.1.1.2/24 10.2.1.2/24
GE1/0/0 GE1/0/0
CE1 CE2
10.1.1.1/24 10.2.1.1/24
vpn1 vpn1
AS 65001 AS 65002
Configuration Roadmap
Inter-AS Option C can be deployed to meet the company's requirement. The
configuration roadmap is as follows:
1. On the MPLS backbone network in AS 100 and AS 200, configure an IGP
protocol to enable the PE and ASBR-PEs to communicate with each other.
2. Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone
network to set up LDP LSPs.
3. Set up an MP-IBGP peer relationship between the PE and ASBR-PEs in each
AS to exchange the labeled IPv4 routes.
4. Create a VPN instance on the PE in each AS and bind the VPN instance to the
interface connected to the CE.
5. Set up an EBGP peer relationship between the PEs and CEs in each AS to
exchange VPN routing information.
6. Enable the capability of exchanging labeled IPv4 routes between the local
ASBR-PE and the remote ASBR-PE.
7. Set up an MP-EBGP relationship between PEs in different ASs and set the
maximum hops between the PEs.
8. Configure a routing policy on the ASBR-PE: Assign MPLS labels to the routes
advertised to the emote ASBR-PE; assign new MPLS labels to the labeled IPv4
routes advertised to the PE in the local AS.
Procedure
Step 1 Assign IP addresses to interfaces according to Figure 7-48.
# Configure PE1. The configuration on PE2, CE1, CE2, ASBR-PE1, and ASBR-PE2 is
similar to the configuration on PE1 and is not mentioned here.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip address 172.1.1.2 24
[PE1-GigabitEthernet1/0/0] quit
Step 2 On the MPLS backbone network in AS 100 and AS 200, configure OSPF to enable
the PEs and the ASBR-PEs to communicate with each other.
NOTE
The 32-bit loopback interface address used as LSR ID should be advertised by the PEs and
ASBR-PEs using OSPF.
After the configuration is complete, the ASBR and PEs in the same AS can set up
an OSPF neighbor relationship. Run the display ospf peer command to verify that
the status of the neighbor relationship is Full. Run the display ip routing-table
command. The command output shows that the ASBR and PEs in the same AS
have learned the routes to Loopback1 of each other.
Step 3 Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone network
of AS 100 and AS 200 to set up LDP LSPs.
# Configure basic MPLS capabilities on PE1 and enable LDP on the interface
connected to ASBR-PE1.
# Configure basic MPLS capabilities on ASBR-PE1 and enable LDP on the interface
connected to PE1.
# Configure basic MPLS capabilities on ASBR-PE2 and enable LDP on the interface
connected to PE2.
# Configure basic MPLS capabilities on PE2 and enable LDP on the interface
connected to ASBR-PE2.
After the configuration is complete, the PE and ASBR-PEs in the same AS can set
up an LDP peer relationship. Run the display mpls ldp session command on the
PE and ASBR-PEs to verify that the state is Operational.
The information displayed on PE1 is used as an example.
[PE1] display mpls ldp session
LDP Session(s) in Public Network
Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
A '*' before a session means the session is being deleted.
------------------------------------------------------------------------------
PeerID Status LAM SsnRole SsnAge KASent/Rcv
------------------------------------------------------------------------------
2.2.2.9:0 Operational DU Active 0002:23:46 17225/17224
------------------------------------------------------------------------------
TOTAL: 1 session(s) Found.
Step 5 On the PEs, create a VPN instance, enable the IPv4 address family in the instance,
and bind the instance to the interfaces connected to CEs.
NOTE
The VPN targets of the VPN instances on the ASBR-PE and PEs in an AS must match. In
different ASs, the VPN targets of the PEs do not need to match.
Step 6 Set up EBGP peer relationships between the PEs and CEs to exchange VPN routing
information.
# Configure CE1. The configuration on CE2 is similar to the configuration on CE1
and is not mentioned here.
After the configuration is complete, run the display bgp vpnv4 vpn-instance vpn-
instancename peer command on the PEs. The command output shows that the
BGP peer relationships have been set up between the PEs and CEs and are in
Established state. Run the display bgp vpnv4 all peer command on the PEs. The
command output shows that each PE has set up a BGP peer relationship with the
CE and ASBR-PEs in the same AS, and the BGP peer relationships are in
Established state.
The information displayed on PE1 is used as an example.
[PE1] display bgp vpnv4 vpn-instance vpn1 peer
# On ASBR-PE1: Apply a routing policy to the routes advertised to PE1, and enable
the capability of exchanging labeled IPv4 routes with PE1. The configuration on
ASBR-PE2 is similar to the configuration on ASBR-PE1 and is not mentioned here.
# Configure PE2.
[PE2] bgp 200
[PE2-bgp] peer 1.1.1.9 as-number 100
[PE2-bgp] peer 1.1.1.9 connect-interface LoopBack 1
[PE2-bgp] peer 1.1.1.9 ebgp-max-hop 10
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
# No VPNv4 route exists on ASBR-PEs. Run the display bgp routing-table label
command on an ASBR-PE to check information about labels of routes.
# ASBR-PE1 is used as an example.
[ASBR-PE1] display bgp routing-table label
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
bgp 65001
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
return
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:1
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 172.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 10.1.1.2 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 2.2.2.9 as-number 100
peer 2.2.2.9 connect-interface LoopBack1
peer 4.4.4.9 as-number 200
peer 4.4.4.9 ebgp-max-hop 10
peer 4.4.4.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.9 enable
peer 2.2.2.9 label-route-capability
peer 4.4.4.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.9 enable
peer 4.4.4.9 enable
#
ipv4-family vpn-instance vpn1
peer 10.1.1.1 as-number 65001
import-route direct
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● ASBR-PE1 configuration file
#
sysname ASBR-PE1
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 172.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 192.1.1.1 255.255.255.0
mpls
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
bgp 100
peer 192.1.1.2 as-number 200
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
network 1.1.1.9 255.255.255.255
apply mpls-label
route-policy policy2 permit node 1
if-match mpls-label
apply mpls-label
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 200:1
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 4.4.4.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 162.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 10.2.1.2 255.255.255.0
#
interface LoopBack1
ip address 4.4.4.9 255.255.255.255
#
bgp 200
peer 1.1.1.9 as-number 100
peer 1.1.1.9 ebgp-max-hop 10
peer 1.1.1.9 connect-interface LoopBack1
peer 3.3.3.9 as-number 200
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable
peer 3.3.3.9 enable
peer 3.3.3.9 label-route-capability
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
peer 3.3.3.9 enable
#
ipv4-family vpn-instance vpn1
peer 10.2.1.1 as-number 65002
import-route direct
#
ospf 1
area 0.0.0.0
network 4.4.4.9 0.0.0.0
network 162.1.1.0 0.0.0.255
#
return
● CE2 configuration file
#
sysname CE2
#
interface GigabitEthernet1/0/0
ip address 10.2.1.1 255.255.255.0
#
bgp 65002
peer 10.2.1.2 as-number 200
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.2.1.2 enable
#
return
GE1/0/0 GE1/0/0
172.1.1.1/24 ASBR-PE1 ASBR-PE2 162.1.1.1/24
Loopback1 Loopback1
1.1.1.9/32 4.4.4.9/32
GE1/0/0 GE1/0/0
172.1.1.2/24 162.1.1.2/24
PE1 PE2
GE2/0/0 GE2/0/0
10.1.1.2/24 10.2.1.2/24
GE1/0/0 GE1/0/0
CE1 CE2
10.1.1.1/24 10.2.1.1/24
vpn1 vpn1
AS 65001 AS 65002
No IBGP peer relationship is required between the PE and ASBR-PEs. The ASBR-PE
learns the labeled BGP routes of the public network at the remote AS from the
remote ASBR-PE. Then these BGP routes are imported to IGP. In this manner, LDP
can distribute labels for these routes and establish an inter-AS LDP LSP. The inter-
AS BGP/MPLS IP VPN Option C can then be implemented.
Configuration Roadmap
Inter-AS Option C can be deployed to meet the company's requirement. The
configuration roadmap is as follows:
1. On the MPLS backbone network in AS 100 and AS 200, configure an IGP
protocol to enable the PE and ASBR-PEs to communicate with each other.
2. Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone
network to set up LDP LSPs.
3. Create a VPN instance on the PE in each AS and bind the VPN instance to the
interface connected to the CE.
4. Set up an EBGP peer relationship between the PEs and CEs in each AS to
exchange VPN routing information.
5. Advertise routes of the PE in an AS to the remote PE: First on the local ASBR-
PE, advertise the routes of the PE in an AS to the remote ASBR-PE through
BGP; then on the remote ASBR-PE, import these BGP routes to IGP. Then the
remote PE learns routes of the PE in the local AS through IGP.
6. Configure a routing policy on the ASBR-PE: Assign MPLS labels to the routes
advertised to the emote ASBR-PE.
7. Enable the capability of exchanging labeled IPv4 routes between the local
ASBR-PE and the remote ASBR-PE.
8. Configure LDP LSPs for the labeled BGP routes of the public network on
ASBR-PEs.
9. Set up MP-EBGP peer relationships between PEs of different ASs. In most
cases, these PEs are not directly connected, and the maximum hops between
them must be specified.
Procedure
Step 1 Assign IP addresses to interfaces according to Figure 7-49.
# Configure PE1. The configuration on PE2, CE1, CE2, ASBR-PE1, and ASBR-PE2 is
similar to the configuration on PE1 and is not mentioned here.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip address 172.1.1.2 24
[PE1-GigabitEthernet1/0/0] quit
Step 2 On the MPLS backbone network in AS 100 and AS 200, configure OSPF to enable
the PEs and the ASBR-PEs to communicate with each other.
# Configure PE1. The configuration on PE2 and ASBR-PEs is similar to the
configuration on PE1 and is not mentioned here.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
NOTE
The 32-bit loopback interface address used as LSR ID should be advertised by the PEs and
ASBR-PEs using OSPF.
After the configuration is complete, the ASBR and PEs in the same AS can set up
an OSPF neighbor relationship. Run the display ospf peer command to verify that
the status of the neighbor relationship is Full. Run the display ip routing-table
command. The command output shows that the ASBR and PEs in the same AS
have learned the routes to Loopback1 of each other.
The ASBR-PE and PEs in the same AS have obtained the IP address of Loopback1
interface of each other and can ping Loopback1 interface address of each other.
# Configure ASBR-PE1.
[ASBR-PE1] bgp 100
[ASBR-PE1-bgp] peer 192.1.1.2 as-number 200
[ASBR-PE1-bgp] quit
# Configure ASBR-PE2.
[ASBR-PE2] bgp 200
[ASBR-PE2-bgp] peer 192.1.1.1 as-number 100
[ASBR-PE2-bgp] quit
After the configuration is complete, run the display bgp peer command on ASBR-
PEs. The command output shows that the statue of neighbors is Established.
# On ASBR-PE1: Import BGP routes to OSPF, and advertise the routes of PE2 to
PE1 according to OSPF.
[ASBR-PE1] ospf 1
[ASBR-PE1-ospf-1] import-route bgp
# On ASBR-PE2: Import BGP routes to OSPF, and advertise the routes of PE1 to
PE2 according to OSPF.
[ASBR-PE2] ospf 1
[ASBR-PE2-ospf-1] import-route bgp
Step 5 Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone network
of AS 100 and AS 200 to set up LDP LSPs.
# Configure basic MPLS capabilities on PE1 and enable LDP on the interface
connected to ASBR-PE1.
[PE1] mpls lsr-id 1.1.1.9
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] mpls
[PE1-GigabitEthernet1/0/0] mpls ldp
[PE1-GigabitEthernet1/0/0] quit
# Configure basic MPLS capabilities on ASBR-PE1 and enable LDP on the interface
connected to PE1.
[ASBR-PE1] mpls lsr-id 2.2.2.9
[ASBR-PE1] mpls
[ASBR-PE1-mpls] quit
[ASBR-PE1] mpls ldp
[ASBR-PE1-mpls-ldp] quit
[ASBR-PE1] interface gigabitethernet 1/0/0
[ASBR-PE1-GigabitEthernet1/0/0] mpls
[ASBR-PE1-GigabitEthernet1/0/0] mpls ldp
[ASBR-PE1-GigabitEthernet1/0/0] quit
# Configure basic MPLS capabilities on ASBR-PE2 and enable LDP on the interface
connected to PE2.
[ASBR-PE2] mpls lsr-id 3.3.3.9
[ASBR-PE2] mpls
[ASBR-PE2-mpls] quit
[ASBR-PE2] mpls ldp
[ASBR-PE2-mpls-ldp] quit
[ASBR-PE2] interface gigabitethernet 1/0/0
[ASBR-PE2-GigabitEthernet1/0/0] mpls
[ASBR-PE2-GigabitEthernet1/0/0] mpls ldp
[ASBR-PE2-GigabitEthernet1/0/0] quit
# Configure basic MPLS capabilities on PE2 and enable LDP on the interface
connected to ASBR-PE2.
[PE2] mpls lsr-id 4.4.4.9
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface gigabitethernet 1/0/0
[PE2-GigabitEthernet1/0/0] mpls
[PE2-GigabitEthernet1/0/0] mpls ldp
[PE2-GigabitEthernet1/0/0] quit
After the configuration is complete, the LDP sessions between PE1 and the ASBR-
PE1, and between PE2 and ASBR-PE2 are set up. Run the display mpls ldp session
command. The command output shows that the status is "Operational". Run the
display mpls ldp lsp command. Information about the established LDP LSPs is
displayed.
The information displayed on PE1 is used as an example.
[PE1] display mpls ldp session
Step 7 Configure LDP LSPs for the labeled BGP routes of the public network on ASBR
devices.
# Configure ASBR-PE1.
[ASBR-PE1] mpls
[ASBR-PE1-mpls] lsp-trigger bgp-label-route
[ASBR-PE1-mpls] quit
# Configure ASBR-PE2.
[ASBR-PE2] mpls
[ASBR-PE2-mpls] lsp-trigger bgp-label-route
[ASBR-PE2-mpls] quit
# Configure PE2.
[PE2] ip vpn-instance vpn1
[PE2-vpn-instance-vpn1] ipv4-family
[PE2-vpn-instance-vpn1-af-ipv4] route-distinguisher 200:1
[PE2-vpn-instance-vpn1-af-ipv4] vpn-target 1:1 export-extcommunity
# Configure PE2.
[PE2] bgp 200
[PE2-bgp] peer 1.1.1.9 as-number 100
[PE2-bgp] peer 1.1.1.9 connect-interface LoopBack 1
[PE2-bgp] peer 1.1.1.9 ebgp-max-hop 10
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
Step 10 Set up EBGP peer relationships between the PEs and CEs and import VPN routes
into BGP.
# Configure CE1.
[CE1] bgp 65001
[CE1-bgp] peer 10.1.1.2 as-number 100
[CE1-bgp] import-route direct
[CE1-bgp] quit
# Configure CE2.
[CE2] bgp 65002
[CE2-bgp] peer 10.2.1.2 as-number 200
[CE2-bgp] import-route direct
[CE2-bgp] quit
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpn1
[PE1-bgp-vpn1] peer 10.1.1.1 as-number 65001
[PE1-bgp-vpn1] import-route direct
[PE1-bgp-vpn1] quit
[PE1-bgp] quit
# Configure PE2.
[PE2] bgp 200
[PE2-bgp] ipv4-family vpn-instance vpn1
[PE2-bgp-vpn1] peer 10.2.1.1 as-number 65002
[PE2-bgp-vpn1] import-route direct
[PE2-bgp-vpn1] quit
[PE2-bgp] quit
After the configuration is complete, run the display bgp vpnv4 vpn-instance peer
command on the PEs. The command output shows that BGP peer relationships
have been established between the PEs and CEs.
The peer relationship between PE1 and CE1 is used as an example.
[PE1] display bgp vpnv4 vpn-instance vpn1 peer
Destination : 4.4.4.9/32
Protocol : BGP Process ID : 0
Preference : 255 Cost : 1
NextHop : 192.1.1.2 Neighbour : 192.1.1.2
State : Active Adv Age : 00h12m53s
Tag : 0 Priority : 0
Label : 15360 QoSInfo : 0x0
IndirectID : 0x0
RelayNextHop : 192.1.1.2 Interface : GigabitEthernet2/0/0
TunnelID : 0x6002006 Flags : D
# Run the display mpls lsp protocol ldp include dest-ip-address verbose on
ASBR-PE1 and PE2 respectively. The command output shows that an LDP LSP is
established between ASBR-PE1 and PE2. Besides, you can find an LDP Ingress LSP
on a PE to the remote PE.
[ASBR-PE1] display mpls lsp protocol ldp include 4.4.4.9 32 verbose
----------------------------------------------------------------------
LSP Information: LDP LSP
----------------------------------------------------------------------
No : 1
VrfIndex :
Fec : 4.4.4.9/32
Nexthop : 192.1.1.2
In-Label : 1024
Out-Label : NULL
In-Interface : ----------
Out-Interface : ----------
LspIndex : 13313
Token : 0x0
FrrToken : 0x0
LsrType : Egress
Outgoing token : 0x6002006
Label Operation : SWAPPUSH
Mpls-Mtu : ------
TimeStamp : 15829sec
Bfd-State : ---
BGPKey : 0x24
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
bgp 65001
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
return
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● ASBR-PE1 configuration file
#
sysname ASBR-PE1
#
mpls lsr-id 2.2.2.9
mpls
lsp-trigger bgp-label-route
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 172.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 192.1.1.1 255.255.255.0
mpls
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
bgp 100
peer 192.1.1.2 as-number 200
#
ipv4-family unicast
undo synchronization
network 1.1.1.9 255.255.255.255
peer 192.1.1.2 enable
peer 192.1.1.2 route-policy policy1 export
peer 192.1.1.2 label-route-capability
#
ospf 1
import-route bgp
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
route-policy policy1 permit node 1
apply mpls-label
#
return
● ASBR-PE2 configuration file
#
sysname ASBR-PE2
#
mpls lsr-id 3.3.3.9
mpls
lsp-trigger bgp-label-route
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 162.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 192.1.1.2 255.255.255.0
mpls
#
interface LoopBack1
CE1 CE3
GE1/0/0 GE1/0/0
10.1.1.1/24 Loopback1 10.3.1.1/24
2.2.2.9/32 GE3/0/0
GE1/0/0
10.1.1.2/24 GE2/0/0.1 GE1/0/0.1 10.3.1.2/24
GE3/0/0
192.1.1.1/24 192.1.1.2/24 vpna
Loopback1 172.1.1.1/24
MCE
1.1.1.9/32 GE1/0/0 GE2/0/0.2 GE1/0/0.2 vpnb
GE2/0/0 PE1 172.1.1.2/24 PE2 192.2.1.1/24 192.2.1.2/24 GE4/0/0
10.2.1.2/24 10.4.1.2/24
GE1/0/0 GE1/0/0
10.2.1.1/24 10.4.1.1/24
CE2 CE4
vpnb vpnb
Configuration Roadmap
The configuration roadmap is as follows:
Procedure
Step 1 Configure OSPF on PEs of the backbone network.
After the configuration is complete, PEs can learn Loopback1 address of each
other.
Step 2 Configure basic MPLS capabilities and MPLS LDP on the PEs to set up LDP LSPs.
After the configuration is complete, run the display mpls ldp session command
on the PEs. The command output shows that the MPLS LDP session between the
PEs is in Operational state.
The information displayed on PE2 is used as an example.
[PE2] display mpls ldp session
Step 3 Configure VPN instances on the PEs. On PE1, bind the VPN instances to the
interfaces connected to CE1 and CE2 respectively. On PE2, bind the VPN instances
to the interfaces connected to the MCE.
# Configure PE1.
[PE1] ip vpn-instance vpna
[PE1-vpn-instance-vpna] ipv4-family
[PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[PE1-vpn-instance-vpna-af-ipv4] quit
[PE1-vpn-instance-vpna] quit
[PE1] ip vpn-instance vpnb
[PE1-vpn-instance-vpnb] ipv4-family
[PE1-vpn-instance-vpnb-af-ipv4] route-distinguisher 100:2
[PE1-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 both
[PE1-vpn-instance-vpnb-af-ipv4] quit
[PE1-vpn-instance-vpnb] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[PE1-GigabitEthernet1/0/0] ip address 10.1.1.2 24
[PE1-GigabitEthernet1/0/0] quit
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] ip binding vpn-instance vpnb
[PE1-GigabitEthernet2/0/0] ip address 10.2.1.2 24
[PE1-GigabitEthernet2/0/0] quit
# Configure PE2.
[PE2] ip vpn-instance vpna
[PE2-vpn-instance-vpna] ipv4-family
[PE2-vpn-instance-vpna-af-ipv4] route-distinguisher 200:1
[PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[PE2-vpn-instance-vpna-af-ipv4] quit
[PE2-vpn-instance-vpna] quit
[PE2] ip vpn-instance vpnb
[PE2-vpn-instance-vpnb] ipv4-family
Step 4 Configure VPN instances on the MCE, and bind the VPN instances to the interfaces
connected to CE3, CE4, and PE2.
<Huawei> system-view
[Huawei] sysname MCE
[MCE] ip vpn-instance vpna
[MCE-vpn-instance-vpna] ipv4-family
[MCE-vpn-instance-vpna-af-ipv4] route-distinguisher 300:1
[MCE-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[MCE-vpn-instance-vpna-af-ipv4] quit
[MCE-vpn-instance-vpna] quit
[MCE] ip vpn-instance vpnb
[MCE-vpn-instance-vpnb] ipv4-family
[MCE-vpn-instance-vpnb-af-ipv4] route-distinguisher 300:2
[MCE-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 both
[MCE-vpn-instance-vpnb-af-ipv4] quit
[MCE-vpn-instance-vpnb] quit
[MCE] interface gigabitethernet 3/0/0
[MCE-GigabitEthernet3/0/0] ip binding vpn-instance vpna
[MCE-GigabitEthernet3/0/0] ip address 10.3.1.2 24
[MCE-GigabitEthernet3/0/0] quit
[MCE] interface gigabitethernet 4/0/0
[MCE-GigabitEthernet4/0/0] ip binding vpn-instance vpnb
[MCE-GigabitEthernet4/0/0] ip address 10.4.1.2 24
[MCE-GigabitEthernet4/0/0] quit
[MCE] interface gigabitethernet 1/0/0.1
[MCE-GigabitEthernet1/0/0.1] dot1q termination vid 10
[MCE-GigabitEthernet1/0/0.1] ip binding vpn-instance vpna
[MCE-GigabitEthernet1/0/0.1] ip address 192.1.1.2 24
[MCE-GigabitEthernet1/0/0.1] arp broadcast enable
[MCE-GigabitEthernet1/0/0.1] quit
[MCE] interface gigabitethernet 1/0/0.2
[MCE-GigabitEthernet1/0/0.2] dot1q termination vid 20
[MCE-GigabitEthernet1/0/0.2] ip binding vpn-instance vpnb
[MCE-GigabitEthernet1/0/0.2] ip address 192.2.1.2 24
[MCE-GigabitEthernet1/0/0.2] arp broadcast enable
[MCE-GigabitEthernet1/0/0.2] quit
Step 5 Set up an MP-IBGP peer relationship between PEs. Set up EBGP peer relationships
between PE1 and CE1, and between PE1 and CE2.
# Configure CE1. The configuration on other PE1 and PE2 is similar to the
configuration on CE1 and is not mentioned here.
<Huawei> system-view
[Huawei] sysname CE1
[CE1] bgp 65410
[CE1-bgp] peer 10.1.1.2 as-number 100
[CE1-bgp] ipv4-family unicast
[CE1-bgp-af-ipv4] import-route direct
[CE1-bgp-af-ipv4] quit
[CE1-bgp] quit
After the configuration is complete, run the display bgp vpnv4 all peer command
on PE1. The command output shows that the PE1 has set up an IBGP peer
relationship with PE2 and EBGP peer relationships with CE1 and CE2. The peer
relationships are in Established state.
[PE1] display bgp vpnv4 all peer
Step 7 Configure RIPv2 between the MCE and CE3, and between the MCE and CE4.
# Configure the MCE.
[MCE] rip 100 vpn-instance vpna
[MCE-rip-100] version 2
[MCE-rip-100] network 10.0.0.0
[MCE-rip-100] import-route ospf 100
[MCE-rip-100] quit
[MCE] rip 200 vpn-instance vpnb
[MCE-rip-200] version 2
[MCE-rip-200] network 10.0.0.0
[MCE-rip-200] import-route ospf 200
[MCE-rip-200] quit
# Configure CE3.
<Huawei> system-view
[Huawei] sysname CE3
[CE3] rip 100
[CE3-rip-100] version 2
[CE3-rip-100] network 10.0.0.0
[CE3-rip-100] import-route direct
# Configure CE4.
<Huawei> system-view
[Huawei] sysname CE4
[CE4] rip 200
[CE4-rip-200] version 2
[CE4-rip-200] network 10.0.0.0
[CE4-rip-200] import-route direct
Step 8 Disable loop detection on the MCE device and import RIP routes.
[MCE] ospf 100 vpn-instance vpna
[MCE-ospf-100] vpn-instance-capability simple
[MCE-ospf-100] import-route rip 100
[MCE-ospf-100] quit
[MCE] ospf 200 vpn-instance vpnb
[MCE-ospf-200] vpn-instance-capability simple
[MCE-ospf-200] import-route rip 200
[MCE-ospf-200] quit
------------------------------------------------------------------------------
Routing Tables: vpna
Destinations : 6 Routes : 6
# CE1 and CE3 can ping each other, and CE2 and CE4 can ping each other.
# The ping from CE1 to CE3 is used as an example.
[CE1] ping 10.3.1.1
PING 10.3.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.3.1.1: bytes=56 Sequence=1 ttl=252 time=125 ms
Reply from 10.3.1.1: bytes=56 Sequence=2 ttl=252 time=125 ms
Reply from 10.3.1.1: bytes=56 Sequence=3 ttl=252 time=125 ms
Reply from 10.3.1.1: bytes=56 Sequence=4 ttl=252 time=125 ms
Reply from 10.3.1.1: bytes=56 Sequence=5 ttl=252 time=125 ms
--- 10.3.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 125/125/125 ms
# CE1 cannot ping CE2 or CE4. CE3 cannot ping CE2 or CE4.
# For example, if you ping CE4 from CE1, the following information is displayed:
[CE1] ping 10.4.1.1
PING 10.4.1.1: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
return
#
ipv4-family vpn-instance vpnb
peer 10.2.1.1 as-number 65420
import-route direct
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 200:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 200:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 172.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0.1
dot1q termination vid 10
ip binding vpn-instance vpna
ip address 192.1.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0.2
dot1q termination vid 20
ip binding vpn-instance vpnb
ip address 192.2.1.1 255.255.255.0
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpna
import-route ospf 100
#
ipv4-family vpn-instance vpnb
import-route ospf 200
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
ospf 100 vpn-instance vpna
import-route bgp
area 0.0.0.0
network 192.1.1.0 0.0.0.255
#
ospf 200 vpn-instance vpnb
import-route bgp
area 0.0.0.0
network 192.2.1.0 0.0.0.255
#
return
● MCE configuration file
#
sysname MCE
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 300:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 300:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
interface GigabitEthernet1/0/0.1
dot1q termination vid 10
ip binding vpn-instance vpna
ip address 192.1.1.2 255.255.255.0
#
interface GigabitEthernet1/0/0.2
dot1q termination vid 20
ip binding vpn-instance vpnb
ip address 192.2.1.2 255.255.255.0
#
interface GigabitEthernet3/0/0
ip binding vpn-instance vpna
ip address 10.3.1.2 255.255.255.0
#
interface GigabitEthernet4/0/0
ip binding vpn-instance vpnb
ip address 10.4.1.2 255.255.255.0
#
ospf 100 vpn-instance vpna
import-route rip 100
vpn-instance-capability simple
area 0.0.0.0
network 192.1.1.0 0.0.0.255
#
ospf 200 vpn-instance vpnb
import-route rip 200
vpn-instance-capability simple
area 0.0.0.0
network 192.2.1.0 0.0.0.255
#
rip 100 vpn-instance vpna
version 2
network 10.0.0.0
import-route ospf 100
#
rip 200 vpn-instance vpnb
version 2
network 10.0.0.0
Figure 7-51 Networking diagram for configuring the PBR to an LSP for VPN
packets
Loopback1
AS 100
2.2.2.9/32
GE1/0/0 GE2/0/0
172.1.1.2/24 172.2.1.1/24
P1
Loopback1 Loopback1
1.1.1.9/32 3.3.3.9/32
GE1/0/0 GE1/0/0
172.1.1.1/24 172.2.1.2/24
PE1 MPLS Backbone PE2
GE2/0/0 GE2/0/0
172.3.1.1/24 172.4.1.2/24
GE3/0/0 Loopback1 GE3/0/0
10.1.1.2/24 4.4.4.9/32 10.3.1.2/24
GE1/0/0 GE2/0/0
172.3.1.2/24 172.4.1.1/24
P2
GE1/0/0 GE1/0/0
10.1.1.1/24 10.3.1.1/24
vpna vpna
AS:65410 CE1 CE2 AS:65430
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure BGP/MPLS VPN according to 7.9.1 Example for Configuring BGP/
MPLS IP VPN.
2. Configure the PBR and policy node on the PE that requires the configuration
of the PBR to an LSP. Set a matching rule of IP packet length and specify an
LSP for forwarding VPN instance packets that meet the matching rule in the
policy-based route view.
3. Apply the PBR to the outbound interface bound to the VPN instance on the
PE.
Procedure
Step 1 Configure BGP/MPLS VPN.
For the configuration procedure, refer to 7.9.1 Example for Configuring BGP/
MPLS IP VPN.
After the configuration is complete, run the display mpls lsp command to check
LSPs on PE1.
The LSPs to PE2 have two outbound interfaces: GE1/0/0 and GE2/0/0.
Step 2 Configure the PBR to an LSP on PE1.
[PE1] policy-based-route policy1 permit node 10
[PE1-policy-based-route-policy1-10] if-match packet-length 10 1000
[PE1-policy-based-route-policy1-10] apply lsp vpn vpna 10.3.1.1 3.3.3.9 172.3.1.2
[PE1-policy-based-route-policy1-10] quit
CRC: 0, Giants: 0
Jabbers: 0, Throttles: 0
Runts: 0, Symbols: 0
Ignoreds: 0, Frames: 0
Collisions: 0, ExcessiveCollisions: 0
Late Collisions: 0, Deferreds: 0
----End
Configuration Files
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface GigabitEthernet3/0/0
ip binding vpn-instance vpna
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet1/0/0
ip address 172.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 172.3.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 3.3.3.9 enable
#
ipv4-family vpnv4
policy vpn-target
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
import-route direct
undo synchronization
peer 10.1.1.2 enable
#
return
Loopback1 Loopback1
AS: 100 2.2.2.9./32 3.3.3.9./32
GE2/0/0
GE1/0/0
172.2.1.1/24
172.1.1.2/24 PE
Loopback1
GE2/0/0
1.1.1.9./32 172.2.1.2/24
SPE GE1/0/0
UPE
10.2.1.2/24
GE2/0/0
172.1.1.1/24 VPN Backbone
GE1/0/0
10.1.1.2/24
GE1/0/0 GE1/0/0
10.1.1.1/24 10.2.1.1/24
CE1 CE2
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure an IGP on the backbone network to implement IP interworking.
2. Configure basic MPLS capabilities and MPLS LDP on the backbone network to
set up MPLS LSPs.
3. Set up MP-IBGP peer relationships between the UPE and SPE and between
the PE and SPE to exchange VPN routing information.
4. On the UPE and PEs, create VPN instances and set up EBGP peer relationships
with CEs to exchange VPN routing information.
5. On the SPE, create a VPN instance and specify the UPE as its underlayer PE
(or user-end PE). Advertise the default route of the VPN instance to the UPE
to reduce the loads on the UPE.
Procedure
Step 1 Configure OSPF on the backbone network to implement IP interworking.
# Configure the UPE.
<Huawei> system-view
[Huawei] sysname UPE
[UPE] interface loopback 1
[UPE-LoopBack1] ip address 1.1.1.9 32
[UPE-LoopBack1] quit
[UPE] interface gigabitethernet 2/0/0
The configuration on the SPE and PEs is similar to the configuration on the UPE
and is not mentioned here.
After the configuration is complete, OSPF neighbor relationships are set up
between the UPE, SPE, and PE. Run the display ospf peer command on these
devices. The command output shows that the neighbor relationships are in Full
state. Run the display ip routing-table command on these devices. The command
output shows that they have learned the route to the loopback interface of each
other.
Step 2 Configure basic MPLS capabilities and MPLS LDP on the backbone network to set
up LDP LSPs.
# Configure the UPE.
The configuration on the SPE and PEs is similar to the configuration on the UPE
and is not mentioned here.
After the configuration is complete, LDP sessions are established between UPE
and SPE, and between SPE and PE. Run the display mpls ldp session command
on these devices. The command output shows that the status is Operational. Run
the display mpls ldp lsp command. Information about the established LDP LSPs is
displayed.
Step 3 Set up MP-IBGP peer relationships between the UPE and SPE and between the PE
and SPE.
# Configure the UPE.
Step 4 On the UPE and PEs, create a VPN instance and set up EBGP peer relationships
with the CEs.
# Configure the UPE.
# Configure CE1.
<Huawei> system-view
[Huawei] sysname CE1
[CE1] interface gigabitethernet 1/0/0
[CE1-GigabitEthernet1/0/0] ip address 10.1.1.1 24
[CE1-GigabitEthernet1/0/0] quit
[CE1] bgp 65410
[CE1-bgp] peer 10.1.1.2 as-number 100
[CE1-bgp] import-route direct
[CE1-bgp] quit
[PE-bgp-vpna] quit
[PE-bgp] quit
# Configure CE2.
<Huawei> system-view
[Huawei] sysname CE2
[CE2] interface gigabitethernet 1/0/0
[CE2-GigabitEthernet1/0/0] ip address 10.2.1.1 24
[CE2-GigabitEthernet1/0/0] quit
[CE2] bgp 65420
[CE2-bgp] peer 10.2.1.2 as-number 100
[CE2-bgp] import-route direct
[CE2-bgp] quit
NOTE
If a PE has multiple interfaces bound to the same VPN instance, you need to specify the
source IP addresses by setting -a source-ip-address in the ping -vpn-instance vpn-instance-
name -a source-ip-address dest-ip-address command to ping the remote CE. If the source IP
address is not specified, the ping operation fails.
Step 5 On the SPE, create a VPN instance, specify the UPE as its underlayer PE, and
advertise the default route of the VPN instance to the UPE.
# After the configuration is complete, CE1 has no route to the network segment
of the interface on CE2, but CE1 has a default route with the next hop as UPE. CE2
has a BGP route to the network segment of the interface on CE1. CE1 and CE2 can
ping each other.
[CE1] display ip routing-table
Route Flags:
R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 8
# Run the display bgp vpnv4 all routing-table command on the UPE. The
command output shows a default route of vpna with the next hop as SPE.
[UPE] display bgp vpnv4 all routing-table
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
return
#
interface GigabitEthernet2/0/0
ip address 172.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 2.2.2.9 as-number 100
peer 2.2.2.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.9 enable
#
ipv4-family vpn-instance vpna
peer 10.1.1.1 as-number 65410
import-route direct
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● SPE configuration file
#
sysname SPE
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 200:1
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 172.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 172.2.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 3.3.3.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable
peer 3.3.3.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
peer 1.1.1.9 upe
peer 1.1.1.9 default-originate vpn-instance vpna
peer 3.3.3.9 enable
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 172.1.1.0 0.0.0.255
network 172.2.1.0 0.0.0.255
#
return
● PE configuration file
#
sysname PE
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:2
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 3.3.3.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpna
ip address 10.2.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.2.1.2 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
bgp 100
peer 2.2.2.9 as-number 100
peer 2.2.2.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.9 enable
#
ipv4-family vpn-instance vpna
peer 10.2.1.1 as-number 65420
import-route direct
#
ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 172.2.1.0 0.0.0.255
#
return
● CE2 configuration file
#
sysname CE2
#
interface GigabitEthernet1/0/0
ip address 10.2.1.1 255.255.255.0
#
bgp 65420
peer 10.2.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.2.1.2 enable
#
return
PE1 PE2
GE2/0/0 GE1/0/0 GE2/0/0 GE2/0/0
10.1.1.1/24 10.1.1.2/24 40.1.1.1/24 40.1.1.2/24
GE1/0/0 0 P Lo GE1/0/0
100.1.1.2/24 ck1 o
6.6 pba 120.1.1.2/24
pba /32 sham link .6. ck1
o
Lo .5.5.5 6/3 0
2
5
GE1/0/0 GE1/0/0
100.1.1.1/24 120.1.1.1/24
GE2/0/0 GE1/0/0 GE2/0/0 GE2/0/0
20.1.1.1/24 20.1.1.2/24 30.1.1.1/24 30.1.1.2/24
Configuration Roadmap
The configuration roadmap is as follows:
1. Set up an ME-IBGP peer relationship between the PEs and configure OSPF
between the PEs and CEs.
2. Create a VPN instance on the PEs and bind it to the interfaces connected to
CEs.
Procedure
Step 1 Configure OSPF on the customer network.
Configure OSPF on CE1, RTA, and CE2 and advertise the network segment of each
interface.
# Configure CE1.
<Huawei> system-view
[Huawei] sysname CE1
[CE1] interface gigabitethernet2/0/0
[CE1-GigabitEthernet2/0/0] ip address 20.1.1.1 24
[CE1-GigabitEthernet2/0/0] quit
[CE1] interface gigabitethernet1/0/0
[CE1-GigabitEthernet1/0/0] ip address 100.1.1.1 24
[CE1-GigabitEthernet1/0/0] quit
[CE1] ospf
[CE1-ospf-1] area 0
[CE1-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255
[CE1-ospf-1-area-0.0.0.0] network 100.1.1.0 0.0.0.255
[CE1-ospf-1-area-0.0.0.0] quit
[CE1-ospf-1] quit
# Configure RTA.
<Huawei> system-view
[Huawei] sysname RTA
[RTA] interface gigabitethernet 1/0/0
[RTA-GigabitEthernet1/0/0] ip address 20.1.1.2 24
[RTA-GigabitEthernet1/0/0] quit
[RTA] interface gigabitethernet 2/0/0
[RTA-GigabitEthernet2/0/0] ip address 30.1.1.1 24
[RTA-GigabitEthernet2/0/0] quit
[RTA] ospf
[RTA-ospf-1] area 0
[RTA-ospf-1-area-0.0.0.0] network 20.1.1.0 0.0.0.255
[RTA-ospf-1-area-0.0.0.0] network 30.1.1.0 0.0.0.255
[RTA-ospf-1-area-0.0.0.0] quit
[RTA-ospf-1] quit
# Configure CE2.
<Huawei> system-view
[Huawei] sysname CE2
[CE2] interface gigabitethernet 2/0/0
[CE2-GigabitEthernet2/0/0] ip address 30.1.1.2 24
[CE2-GigabitEthernet2/0/0] quit
[CE2] interface gigabitethernet 1/0/0
[CE2-GigabitEthernet1/0/0] ip address 120.1.1.2 24
[CE2-GigabitEthernet1/0/0] quit
[CE2] ospf
[CE2-ospf-1] area 0
[CE2-ospf-1-area-0.0.0.0] network 30.1.1.0 0.0.0.255
[CE2-ospf-1-area-0.0.0.0] network 120.1.1.0 0.0.0.255
[CE2-ospf-1-area-0.0.0.0] quit
[CE2-ospf-1] quit
# Configure PE1.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] ip address 10.1.1.1 24
[PE1-GigabitEthernet2/0/0] quit
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] mpls lsr-id 1.1.1.9
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] mpls
[PE1-GigabitEthernet2/0/0] mpls ldp
[PE1-GigabitEthernet2/0/0] quit
[PE1] ospf 1 router-id 1.1.1.9
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
[PE1] bgp 100
[PE1-bgp] peer 3.3.3.9 as-number 100
[PE1-bgp] peer 3.3.3.9 connect-interface loopback 1
[PE1-bgp] ipv4-family vpnv4
[PE1-bgp-af-vpnv4] peer 3.3.3.9 enable
[PE1-bgp-af-vpnv4] quit
[PE1-bgp] quit
# Configure P.
<Huawei> system-view
[Huawei] sysname P
[P] interface gigabitethernet 1/0/0
[P-GigabitEthernet1/0/0] ip address 10.1.1.2 24
[P-GigabitEthernet1/0/0] quit
[P] interface gigabitethernet 2/0/0
[P-GigabitEthernet2/0/0] ip address 40.1.1.1 24
[P-GigabitEthernet2/0/0] quit
[P] interface loopback 1
[P-LoopBack1] ip address 2.2.2.9 32
[P-LoopBack1] quit
[P] mpls lsr-id 2.2.2.9
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] interface gigabitethernet 1/0/0
[P-GigabitEthernet1/0/0] mpls
[P-GigabitEthernet1/0/0] mpls ldp
[P-GigabitEthernet1/0/0] quit
[P] interface gigabitethernet 2/0/0
[P-GigabitEthernet2/0/0] mpls
[P-GigabitEthernet2/0/0] mpls ldp
[P-GigabitEthernet2/0/0] quit
[P] ospf 1 router-id 2.2.2.9
[P-ospf-1] area 0
[P-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0
[P-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0] network 40.1.1.0 0.0.0.255
[P-ospf-1-area-0.0.0.0] quit
[P-ospf-1] quit
# Configure PE2.
<Huawei> system-view
[Huawei] sysname PE2
[PE2] interface gigabitethernet 2/0/0
[PE2-GigabitEthernet2/0/0] ip address 40.1.1.2 24
[PE2-GigabitEthernet2/0/0] quit
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 3.3.3.9 32
[PE2-LoopBack1] quit
[PE2] mpls lsr-id 3.3.3.9
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface gigabitethernet 2/0/0
[PE2-GigabitEthernet2/0/0] mpls
[PE2-GigabitEthernet2/0/0] mpls ldp
[PE2-GigabitEthernet2/0/0] quit
[PE2] ospf 1 router-id 3.3.3.9
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 3.3.3.9 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 40.1.1.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
[PE2] bgp 100
[PE2-bgp] peer 1.1.1.9 as-number 100
[PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
After the configuration is complete, PE1 and PE2 can learn the route to the
loopback interface of each other and set up an MP-IBGP peer relationship.
# Configure PE1.
[PE1] ip vpn-instance vpn1
[PE1-vpn-instance-vpn1] ipv4-family
[PE1-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpn1-af-ipv4] vpn-target 1:1
[PE1-vpn-instance-vpn1-af-ipv4] quit
[PE1-vpn-instance-vpn1] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpn1
[PE1-GigabitEthernet1/0/0] ip address 100.1.1.2 24
[PE1-GigabitEthernet1/0/0] quit
[PE1] ospf 100 router-id 5.5.5.5 vpn-instance vpn1
[PE1-ospf-100] domain-id 10
[PE1-ospf-100] import-route bgp
[PE1-ospf-100] area 0
[PE1-ospf-100-area-0.0.0.0] network 100.1.1.0 0.0.0.255
[PE1-ospf-100-area-0.0.0.0] quit
[PE1-ospf-100] quit
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpn1
[PE1-bgp-vpn1] import-route direct
[PE1-bgp-vpn1] import-route ospf 100
[PE1-bgp-vpn1] quit
[PE1-bgp] quit
# Configure PE2.
[PE2] ip vpn-instance vpn1
[PE2-vpn-instance-vpn1] ipv4-family
[PE2-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:2
[PE2-vpn-instance-vpn1-af-ipv4] vpn-target 1:1
[PE2-vpn-instance-vpn1-af-ipv4] quit
[PE2-vpn-instance-vpn1] quit
[PE2] interface gigabitethernet 1/0/0
[PE2-GigabitEthernet1/0/0] ip binding vpn-instance vpn1
[PE2-GigabitEthernet1/0/0] ip address 120.1.1.1 24
[PE2-GigabitEthernet1/0/0] quit
[PE2] ospf 100 router-id 6.6.6.6 vpn-instance vpn1
[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
To forward VPN traffic through the MPLS backbone network, ensure that the cost of the
sham link is smaller than the cost of the OSPF route used for forwarding VPN traffic over
the customer network. A commonly used method is to set the cost of the forwarding
interface on the customer network to be larger than the cost of the sham link.
# Configure CE1.
[CE1] interface gigabitethernet 2/0/0
[CE1-GigabitEthernet2/0/0] ospf cost 10
[CE1-GigabitEthernet2/0/0] quit
# Configure CE2.
[CE2] interface gigabitethernet 2/0/0
[CE2-GigabitEthernet2/0/0] ospf cost 10
[CE2-GigabitEthernet2/0/0] quit
# 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
# 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
[PE2-ospf-100-area-0.0.0.0] sham-link 6.6.6.6 5.5.5.5 cost 1
[PE2-ospf-100-area-0.0.0.0] quit
[PE2-ospf-100] quit
# Run the display ip routing-table command on the CEs. The command output
shows that the cost of the OSPF route to the remote CE has changed to 3, and the
next hop has changed to the interface connected to PE. That is, VPN traffic to the
remote CE is forwarded through the backbone network.
# The information displayed on CE1 is used as an example.
[CE1] display ip routing-table
Route Flags:
R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 14 Routes : 14
Destination/Mask Proto Pre Cost Flags NextHop Interface
5.5.5.5/32 O_ASE 150 1 D 100.1.1.2 GigabitEthernet1/0/0
6.6.6.6/32 O_ASE 150 1 D 100.1.1.2 GigabitEthernet1/0/0
20.1.1.0/24 Direct 0 0 D 20.1.1.1 GigabitEthernet2/0/0
20.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet2/0/0
20.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet2/0/0
30.1.1.0/24 OSPF 10 11 D 20.1.1.2 GigabitEthernet2/0/0
100.1.1.0/24 Direct 0 0 D 100.1.1.1 GigabitEthernet1/0/0
100.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
100.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
120.1.1.0/24 OSPF 10 3 D 100.1.1.2 GigabitEthernet1/0/0
NOTE
Cost of the OSPF route from CE1 to CE2 = Cost of the path from CE1 to PE1 + Cost of the
sham link + Cost of the path from PE2 to CE2 = 1 + 1 + 1 = 3
# Run the tracert command on CE1. The command output shows that the data
sent from CE1 to CE2 passes through the interface connected to PE1. That is, VPN
traffic is transmitted through the backbone network.
[CE1] tracert 120.1.1.1
traceroute to 120.1.1.1(120.1.1.1), max hops: 30 ,packet length: 40,press CTRL_C to break
1 100.1.1.2 10 ms 1 ms 1 ms
2 10.1.1.2 10 ms 1 ms 1 ms
3 120.1.1.1 10 ms 2 ms 1 ms
[CE1] tracert 30.1.1.2
traceroute to 30.1.1.2(30.1.1.2), max hops: 30 ,packet length: 40,press CTRL_C to break
1 20.1.1.2 10 ms 1 ms 1 ms
2 30.1.1.2 10 ms 2 ms 1 ms
# Run the display ospf 100 sham-link command on the PEs to check information
about the sham link.
# The information displayed on PE1 is used as an example.
[PE1] display ospf 100 sham-link
# Run the display ospf sham-link area command. The command output shows
that the neighbor relationship is in Full state.
[PE1] display ospf sham-link area 0
# Run the display ospf routing command on the CEs. The command output
shows that the route to the remote CE is learned as an intra-area route.
[CE1] display ospf routing
OSPF Process 1 with Router ID 100.1.1.1
Routing Tables
Routing for Network
Destination Cost Type NextHop AdvRouter Area
120.1.1.0/24 3 Transit 100.1.1.2 6.6.6.6 0.0.0.0
20.1.1.0/24 10 Transit 20.1.1.1 100.1.1.1 0.0.0.0
30.1.1.0/24 11 Transit 20.1.1.2 30.1.1.1 0.0.0.0
100.1.1.0/24 1 Transit 100.1.1.1 100.1.1.1 0.0.0.0
Routing for ASEs
Destination Cost Type Tag NextHop AdvRouter
6.6.6.6/32 1 Type2 3489661028 100.1.1.2 5.5.5.5
5.5.5.5/32 1 Type2 3489661028 100.1.1.2 6.6.6.6
Total Nets: 6
Intra Area: 4 Inter Area: 0 ASE: 2 NSSA: 0
----End
Configuration Files
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:1
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpn1
ip address 100.1.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 10.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
interface LoopBack10
ip binding vpn-instance vpn1
ip address 5.5.5.5 255.255.255.255
#
bgp 100
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 3.3.3.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.9 enable
#
ipv4-family vpn-instance vpn1
import-route direct
import-route ospf 100
#
ospf 1 router-id 1.1.1.9
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 10.1.1.0 0.0.0.255
#
ospf 100 router-id 5.5.5.5 vpn-instance vpn1
import-route bgp
domain-id 0.0.0.10
area 0.0.0.0
network 100.1.1.0 0.0.0.255
sham-link 5.5.5.5 6.6.6.6
#
return
● P configuration file
#
sysname P
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 10.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 40.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
ospf 1 router-id 2.2.2.9
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 10.1.1.0 0.0.0.255
network 40.1.1.0 0.0.0.255
#
return
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpn1
import-route direct
import-route ospf 100
#
ospf 1 router-id 3.3.3.9
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 40.1.1.0 0.0.0.255
#
ospf 100 router-id 6.6.6.6 vpn-instance vpn1
import-route bgp
domain-id 0.0.0.10
area 0.0.0.0
network 120.1.1.0 0.0.0.255
sham-link 6.6.6.6 5.5.5.5
#
return
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 100.1.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 20.1.1.1 255.255.255.0
ospf cost 10
#
ospf 1
area 0.0.0.0
network 100.1.1.0 0.0.0.255
network 20.1.1.0 0.0.0.255
#
return
● CE2 configuration file
#
sysname CE2
#
interface GigabitEthernet1/0/0
ip address 120.1.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 30.1.1.2 255.255.255.0
ospf cost 10
#
ospf 1
area 0.0.0.0
network 30.1.1.0 0.0.0.255
network 120.1.1.0 0.0.0.255
#
return
● RTA configuration file
#
sysname RTA
#
interface GigabitEthernet1/0/0
ip address 20.1.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 30.1.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
GE2/0/0 GE2/0/0
20.1.1.1/24 30.1.1.1/24
PE1
PE2
GE1/0/0 GE2/0/0
20.1.1.2/24 P 30.1.1.1/24
GE1/0/0 GE1/0/0
10.1.1.2/24 10.2.1.2/24
VPN Backbone
AS 100
GE1/0/0 GE1/0/0
10.1.1.1/24 10.2.1.1/24
CE2
CE1
GE2/0/0 GE2/0/0
10.3.1.1/24 10.4.1.1/24
vpn1 vpn1
AS 600 AS 600
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure OSPF between the P and PEs to ensure IP connectivity on the
backbone network.
2. Configure basic MPLS capabilities and MPLS LDP on the P and PEs to set up
MPLS LSP tunnels for VPN data transmission on the backbone network.
3. Set up an MP-IBGP peer relationship between PEs to exchange VPNv4 routes.
4. Configure a VPN instance and set the VPN target to 1:1 on PE1 and PE2 so
that users in the VPN can communicate with each other. Bind the VPN
Procedure
Step 1 Configure basic BGP/MPLS IP VPN functions.
● Configure OSPF on the MPLS backbone network so that the PEs and P can
learn the routes to the loopback interface of each other.
● Configure basic MPLS capabilities and MPLS LDP on the backbone network to
set up MPLS LSPs.
● Set up an MP-IBGP peer relationship between PEs to exchange VPNv4 routes.
● Configure the VPN instance of VPN1 on PE2 and bind the VPN instance to the
interface connected to CE2.
● Configure the VPN instance of VPN1 on PE1 and bind the VPN instance to the
interface connected to CE1.
● Set up BGP peer relationships between PE1 and CE1 and between PE2 and
CE2 to import routes of CEs to PEs.
Run the display ip routing-table vpn-instance command on the PEs to check the
routing table of the VPN instance. The VPN routing table has routes to the VPN of
the CEs.
Run the display bgp routing-table peer received-routes command on CE2. The
command output shows that CE2 did not accept the route to 10.3.1.0/24.
[CE2] display bgp routing-table peer 10.2.1.2 received-routes
Check the routing information accepted by CE2 and routing table on CE2.
[CE2] display bgp routing-table peer 10.2.1.2 received-routes
After configuring BGP AS number substitution on PE1, you can find that CE1 and
CE2 can successfully ping each other.
[CE1] ping –a 10.3.1.1 10.4.1.1
PING 10.4.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.4.1.1: bytes=56 Sequence=1 ttl=252 time=2 ms
Reply from 10.4.1.1: bytes=56 Sequence=2 ttl=252 time=1 ms
Reply from 10.4.1.1: bytes=56 Sequence=3 ttl=252 time=2 ms
Reply from 10.4.1.1: bytes=56 Sequence=4 ttl=252 time=2 ms
Reply from 10.4.1.1: bytes=56 Sequence=5 ttl=252 time=2 ms
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 10.3.1.1 255.255.255.0
#
bgp 600
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
return
interface GigabitEthernet1/0/0
ip binding vpn-instance vpn1
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 20.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 3.3.3.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.9 enable
#
ipv4-family vpn-instance vpn1
peer 10.1.1.1 as-number 600
peer 10.1.1.1 substitute-as
import-route direct
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 20.1.1.0 0.0.0.255
#
return
● P configuration file
#
sysname P
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address ip address 20.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address ip address 30.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 20.1.1.0 0.0.0.255
network 30.1.1.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:2
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 3.3.3.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpn1
ip address 10.2.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 30.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpn1
peer 10.2.1.1 as-number 600
peer 10.2.1.1 substitute-as
import-route direct
#
ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 30.1.1.0 0.0.0.255
#
return
Networking Requirements
When multiple CEs in a VPN site connect to different PEs, VPN routes advertised
from the CEs to the PEs may be sent back to the VPN site after the routes traverse
the backbone network. This may cause routing loops in the VPN site.
As shown in Figure 7-55, CE1 and CE2 belong to site 1; CE2 and CE3 connect to
PE2. Site 1 and site 2 have the same AS number. The PEs and CEs run EBGP. PE1
uses MP-IGBP to advertise the routes learned from CE1 to PE2. Then PE2
advertises these routes to CE2 and CE3. However, CE2 has learned the routes
through IGP in site 1. As a result, a routing loop may occur in site 1.
To prevent routing loops in site 1, configure the BGP Site of Origin (SoO) attribute
on the PEs. When PE2 advertises routes to CE2, PE2 checks whether the SoO
attribute of the routes is the same as the locally configured SoO attribute. If so,
PE2 does not advertise these routes to CE2. PE2 can advertise the routes to CE3.
Figure 7-55 Networking diagram for configuring the BGP SoO attribute
Loopback 1
1.1.1.1/32
Loopback 1
11.11.11.11/32 GE1/0/0 PE1
192.168.1.1/30
CE1
GE1/0/0
GE2/0/0
192.168.1.2/30
GE2/0/0 10.1.1.1/30
192.168.4.1/30
AS 65410
AS 100
GE2/0/0
192.168.4.2/30
site1 GE3/0/0
GE1/0/0 Loopback 1
10.1.1.2/30
192.168.2.2/30 33.33.33.33/32
CE2 GE1/0/0
Loopback 1 GE1/0/0 192.168.3.2/30
22.22.22.22/32 192.168.2.1/30 site2
PE2 GE2/0/0 CE3
192.168.3.1/30 AS 65410
Loopback 1
2.2.2.2/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure an IP address for each interface and an IGP on the backbone
network so that PEs can communicate.
2. Enable MPLS and MPLS LDP on the backbone network so that LDP LSPs can
be established between the PEs.
3. Set up an MP-IBGP peer relationship between the PEs.
4. Configure VPN instances on PEs and bind the instances to the interfaces
connected to CEs.
5. Set up EBGP peer relationships between the PEs and CEs and enable AS
number substitution on the PEs.
6. Configure the BGP SoO attribute for the connected CEs on the PEs.
Procedure
Step 1 Configure an IP address for each interface and an IGP on the backbone network
so that PEs can learn routes to loopback interfaces of each other.
In this example, OSPF is configured.
# Configure PE1.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.1 32
[PE1-LoopBack1] quit
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] ip address 10.1.1.1 30
[PE1-GigabitEthernet2/0/0] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.3
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
The configuration on PE2 and CEs is similar to the configuration on PE1 and is not
mentioned here.
After the configuration is complete, run the display ip routing-table command
on the PEs. The command output shows that the PEs have learned the route to
loopback interfaces of each other.
The information displayed on PE1 is used as an example.
[PE1] display ip routing-table
Route Flags:
R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 9
Step 2 Enable MPLS and MPLS LDP on the backbone network to set up LDP LSPs.
Enable MPLS and MPLS LDP globally and on interfaces of the PE.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.1
[PE1] mpls
[PE1-mpls] quit
After the configuration is complete, run the display mpls ldp lsp command on
the PEs. The command output shows the labels assigned to the routes to loopback
interfaces on the peer PEs. The information displayed on PE1 is used as an
example.
[PE1] display mpls ldp lsp
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] peer 2.2.2.2 as-number 100
[PE1-bgp] peer 2.2.2.2 connect-interface loopback1
[PE1-bgp] ipv4-family vpnv4
[PE1-bgp-af-vpnv4] peer 2.2.2.2 enable
[PE1-bgp-af-vpnv4] quit
[PE1-bgp] quit
After the configuration is complete, run the display bgp peer or display bgp
vpnv4 all peer command on the PEs. The command output shows that BGP peer
relationships have been established between the PEs. The information displayed
on PE1 is used as an example.
[PE1] display bgp peer
Step 4 On each PE, configure a VPN instance, enable the IPv4 address family in the
instance, and bind the instance to the interfaces connected to the CEs.
# Configure PE1.
[PE1] ip vpn-instance vpna
[PE1-vpn-instance-vpna] ipv4-family
[PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpna-af-ipv4] vpn-target 100:100
[PE1-vpn-instance-vpna-af-ipv4] quit
[PE1-vpn-instance-vpna] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[PE1-GigabitEthernet1/0/0] ip address 192.168.1.1 30
[PE1-GigabitEthernet1/0/0] quit
# Configure PE2.
[PE2] ip vpn-instance vpna
[PE2-vpn-instance-vpna] ipv4-family
[PE2-vpn-instance-vpna-af-ipv4] route-distinguisher 100:2
[PE2-vpn-instance-vpna-af-ipv4] vpn-target 100:100
[PE2-vpn-instance-vpna-af-ipv4] quit
[PE2-vpn-instance-vpna] quit
[PE2] interface gigabitethernet 1/0/0
[PE2-GigabitEthernet1/0/0] ip binding vpn-instance vpna
[PE2-GigabitEthernet1/0/0] ip address 192.168.2.1 30
[PE2-GigabitEthernet1/0/0] quit
[PE2] interface gigabitethernet 2/0/0
[PE2-GigabitEthernet2/0/0] ip binding vpn-instance vpna
[PE2-GigabitEthernet2/0/0] ip address 192.168.3.1 30
[PE2-GigabitEthernet2/0/0] quit
Step 5 Set up EBGP peer relationships between PEs and CEs, enable AS number
substitution on the PEs, and configure PEs to import routes from CEs.
In this configuration example, the two VPN sites have the same AS number.
Therefore, AS number substitution needs to be enabled on PE1 and PE2.
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpna
[PE1-bgp-vpna] peer 192.168.1.2 as-number 65410
[PE1-bgp-vpna] peer 192.168.1.2 substitute-as
[PE1-bgp-vpna] import-route direct
[PE1-bgp-vpna] quit
[PE1-bgp] quit
# Configure CE1.
[CE1] bgp 65410
[CE1-bgp] peer 192.168.1.1 as-number 100
[CE1-bgp] network 11.11.11.11 32
[CE1-bgp] network 192.168.4.0 30
[CE1-bgp] quit
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] ipv4-family vpn-instance vpna
[PE2-bgp-vpna] peer 192.168.2.2 as-number 65410
[PE2-bgp-vpna] peer 192.168.3.2 as-number 65410
[PE2-bgp-vpna] peer 192.168.2.2 substitute-as
[PE2-bgp-vpna] peer 192.168.3.2 substitute-as
[PE2-bgp-vpna] import-route direct
[PE2-bgp-vpna] quit
[PE2-bgp] quit
# Configure CE2.
[CE2] bgp 65410
[CE2-bgp] peer 192.168.2.1 as-number 100
[CE2-bgp] network 22.22.22.22 32
[CE2-bgp] network 192.168.4.0 30
[CE2-bgp] quit
# Configure CE3.
[CE3] bgp 65410
[CE3-bgp] peer 192.168.3.1 as-number 100
[CE3-bgp] network 33.33.33.33 32
[CE3-bgp] quit
After the configuration is complete, run the display bgp vpnv4 vpn-instance peer
command on the PEs. The command output shows that the status of EBGP peer
relationships between PEs and CEs is Established. This indicates that EBGP peer
relationships have been established between PEs and CEs. The information
displayed on PE1 is used as an example.
[PE1] display bgp vpnv4 vpn-instance vpna peer
Run the display bgp vpnv4 routing-table command on the PEs. The command
output shows the routes sent from the PEs to the PEs. The following shows the
routes sent from PE2 to CE2.
[PE2] display bgp vpnv4 vpn-instance vpna routing-table peer 192.168.2.2 advertised-routes
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] ipv4-family vpn-instance vpna
[PE2-bgp-vpna] peer 192.168.2.2 soo 100:101
[PE2-bgp-vpna] peer 192.168.3.2 soo 100:102
[PE2-bgp-vpna] quit
[PE2-bgp] quit
# Run the display bgp vpnv4 routing-table command on PE2. The command
output shows the SoO attribute carried in the routes sent from PE2 to CE3.
[PE2] display bgp vpnv4 vpn-instance vpna routing-table 11.11.11.11 32
# The preceding command output shows that after the BGP SoO attribute is
configured, the VPN routes received from CEs carry the SoO attribute, and PE2
does not send any route to CE2. This indicates that the configuration of the BGP
SoO attribute has taken effect.
----End
Configuration Files
● CE1 configuration file
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 192.168.1.2 255.255.255.252
#
interface GigabitEthernet2/0/0
ip address 192.168.4.1 255.255.255.252
#
interface LoopBack1
ip address 11.11.11.11 255.255.255.255
#
bgp 65410
peer 192.168.1.1 as-number 100
#
ipv4-family unicast
undo synchronization
network 11.11.11.11 255.255.255.255
network 192.168.4.0 255.255.255.252
peer 192.168.1.1 enable
#
return
● CE2 configuration file
#
sysname CE2
#
interface GigabitEthernet1/0/0
ip address 192.168.2.2 255.255.255.252
#
interface GigabitEthernet2/0/0
ip address 192.168.4.2 255.255.255.252
#
interface LoopBack1
ip address 22.22.22.22 255.255.255.255
#
bgp 65410
peer 192.168.2.1 as-number 100
#
ipv4-family unicast
undo synchronization
network 22.22.22.22 255.255.255.255
network 192.168.4.0 255.255.255.252
peer 192.168.2.1 enable
#
return
#
sysname PE1
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
vpn-target 100:100 export-extcommunity
vpn-target 100:100 import-extcommunity
#
mpls lsr-id 1.1.1.1
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpna
ip address 192.168.1.1 255.255.255.252
#
interface GigabitEthernet2/0/0
ip address 10.1.1.1 255.255.255.252
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.2 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.2 enable
#
ipv4-family vpn-instance vpna
import-route direct
peer 192.168.1.2 as-number 65410
peer 192.168.1.2 substitute-as
peer 192.168.1.2 soo 100:101
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 10.1.1.0 0.0.0.3
#
return
#
sysname PE2
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:2
vpn-target 100:100 export-extcommunity
vpn-target 100:100 import-extcommunity
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpna
ip address 192.168.2.1 255.255.255.252
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpna
ip address 192.168.3.1 255.255.255.252
#
interface GigabitEthernet3/0/0
ip address 10.1.1.2 255.255.255.252
mpls
mpls ldp
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.1 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.1 enable
#
ipv4-family vpn-instance vpna
import-route direct
peer 192.168.2.2 as-number 65410
peer 192.168.2.2 substitute-as
peer 192.168.2.2 soo 100:101
peer 192.168.3.2 as-number 65410
peer 192.168.3.2 substitute-as
peer 192.168.3.2 soo 100:102
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 10.1.1.0 0.0.0.3
#
return
#
sysname CE3
#
interface GigabitEthernet1/0/0
ip address 192.168.3.2 255.255.255.252
#
interface LoopBack1
ip address 33.33.33.33 255.255.255.255
#
bgp 65410
peer 192.168.3.1 as-number 100
#
ipv4-family unicast
undo synchronization
network 33.33.33.33 255.255.255.255
peer 192.168.3.1 enable
#
return
VPN backbone
AS 100
CE1 CE2 0 GE
0/ 10 1
CE1 1/ /3
0 .3. /0/0
GE .1.1 1.2
/3
CE2
.1 0
GE3/0/0 10
GE3/0/0
10.5.1.1/24 /0 10.6.1.1/24
2/0 /30
G
G E
E2
1.2
10
.4.
/0
.2
10
/0
.1
.
1/
30
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure basic BGP/MPLS IP VPN functions.
2. In the BGP view of CE1, configure load balancing for traffic sent to CE2.
3. Increase the MED value of the BGP-VPN route on PE3 to ensure that the next
hop of the route selected by CE2 to the customer network connected to CE1 is
PE4.
Procedure
Step 1 Configure an IGP on the MPLS backbone network so that PEs and Ps can
communicate with each other.
# Configure PE1.
# Set IP addresses of interfaces. The IP addresses of the loopback interfaces must
use a 32-bit mask.
The configuration on PE2, PE3, PE4, P1, and P2 is similar to the configuration on
PE1 and is not mentioned here.
After the configuration is complete, run the display ip routing-table command.
The command output shows that PE1 and PE3 can learn the routes of Loopback1
interface of each other; PE2 and PE4 can learn routes of Loopback1 interface of
each other.
Step 2 Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone network
to set up LDP LSPs.
# Configure PE1.
# Enable MPLS and LDP in the system view, set the LSR ID to the IP address of the
loopback interface, and trigger the LSP.
[PE1] mpls lsr-id 1.1.1.1
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
# Enable MPLS and LDP on the interface connected to the backbone network.
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] mpls
[PE1-GigabitEthernet2/0/0] mpls ldp
[PE1-GigabitEthernet2/0/0] quit
# The configuration on PE2, PE3, PE4, P1, and P2 is similar to the configuration on
PE1 and is not mentioned here.
After the configuration is complete, LDP sessions can be set up between PE1 and
P1, and between PE3 and P1. Run the display mpls ldp session command. The
command output shows that the status of the sessions is Operational. Run the
display mpls ldp lsp command. Information about the established LDP LSPs is
displayed.
The information displayed on PE1 is used as an example.
[PE1] display mpls ldp session
Step 3 Configure VPN instances on PEs and bind the instances to the interfaces
connected to CEs.
# Configure PE1.
# Create a VPN instance and set the RD and VPN target of the VPN instance. The
VPN target set on the local PE must match the VPN target of the MP-BGP peer PE
so that the sites of the same VPN can communicate with each other.
# Bind the VPN instance to the interface connected to the CE and set the IP
address of the interface.
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpn1
[PE1-GigabitEthernet1/0/0] ip address 10.1.1.2 255.255.255.252
[PE1-GigabitEthernet1/0/0] quit
# Configure PE2.
# Create a VPN instance and set the RD and VPN target of the VPN instance. The
VPN target set on the local PE must match the VPN target of the MP-BGP peer PE
so that the sites of the same VPN can communicate with each other.
[PE2] ip vpn-instance vpn1
[PE2-vpn-instance-vpn1] ipv4-family
[PE2-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:2
[PE2-vpn-instance-vpn1-af-ipv4] vpn-target 1:1 both
[PE2-vpn-instance-vpn1-af-ipv4] quit
[PE2-vpn-instance-vpn1] quit
# Bind the VPN instance to the interface connected to the CE and set the IP
address of the interface.
# Configure PE3.
# Create a VPN instance and set the RD and VPN target of the VPN instance. The
VPN target set on the local PE must match the VPN target of the MP-BGP peer PE
so that the sites of the same VPN can communicate with each other.
[PE3] ip vpn-instance vpn1
[PE3-vpn-instance-vpn1] ipv4-family
[PE3-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:3
[PE3-vpn-instance-vpn1-af-ipv4] vpn-target 1:1 both
[PE3-vpn-instance-vpn1-af-ipv4] quit
[PE3-vpn-instance-vpn1] quit
# Bind the VPN instance to the interface connected to the CE and set the IP
address of the interface.
[PE3] interface gigabitethernet 2/0/0
[PE3-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[PE3-GigabitEthernet2/0/0] ip address 10.3.1.1 255.255.255.252
[PE3-GigabitEthernet2/0/0] quit
# Configure PE4.
# Create a VPN instance and set the RD and VPN target of the VPN instance. The
VPN target set on the local PE must match the VPN target of the MP-BGP peer PE
so that the sites of the same VPN can communicate with each other.
[PE4] ip vpn-instance vpn1
[PE4-vpn-instance-vpn1] ipv4-family
[PE4-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:4
[PE4-vpn-instance-vpn1-af-ipv4] vpn-target 1:1 both
[PE4-vpn-instance-vpn1-af-ipv4] quit
[PE4-vpn-instance-vpn1] quit
# Bind the VPN instance to the interface connected to the CE and set the IP
address of the interface.
[PE4]interface gigabitethernet 2/0/0
[PE4-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[PE4-GigabitEthernet2/0/0] ip address 10.4.1.1 255.255.255.252
[PE4-GigabitEthernet2/0/0] quit
# Enter the VPNv4 address family view and enable the local PE to exchange VPN
routing information with the IGBP peer.
[PE1-bgp] ipv4-family vpnv4
[PE1-bgp-af-vpnv4] peer 3.3.3.3 enable
[PE1-bgp-af-vpnv4] quit
[PE1-bgp] quit
# Configure PE3.
# Specify PE1 as the IGBP peer and use the IP address of the loopback interface to
set up an IBGP connection with the peer.
[PE3] bgp 100
[PE3-bgp] peer 1.1.1.1 as-number 100
[PE3-bgp] peer 1.1.1.1 connect-interface loopback 1
# Enter the VPNv4 address family view and enable the local PE to exchange VPN
routing information with the IGBP peer.
[PE3-bgp] ipv4-family vpnv4
[PE3-bgp-af-vpnv4] peer 1.1.1.1 enable
[PE3-bgp-af-vpnv4] quit
[PE3-bgp] quit
# Configure PE2.
# Specify PE4 as the IGBP peer and use the IP address of the loopback interface to
set up an IBGP connection with the peer.
[PE2] bgp 100
[PE2-bgp] peer 4.4.4.4 as-number 100
[PE2-bgp] peer 4.4.4.4 connect-interface loopback 1
# Enter the VPNv4 address family view and enable the local PE to exchange VPN
routing information with the IGBP peer.
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 4.4.4.4 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
# Configure PE4.
# Specify PE2 as the IGBP peer and use the IP address of the loopback interface to
set up an IBGP connection with the peer.
[PE4] bgp 100
[PE4-bgp] peer 2.2.2.2 as-number 100
[PE4-bgp] peer 2.2.2.2 connect-interface loopback 1
# Enter the VPNv4 address family view and enable the local PE to exchange VPN
routing information with the IGBP peer.
[PE4-bgp] ipv4-family vpnv4
[PE4-bgp-af-vpnv4] peer 2.2.2.2 enable
[PE4-bgp-af-vpnv4] quit
[PE4-bgp] quit
After the configuration is complete, run the display bgp vpnv4 all peer command
on the PEs. The command output shows that the BGP peer relationships have
been set up between the PEs and are in Established state.
The information displayed on PE1 is used as an example.
[PE1] display bgp vpnv4 all peer
BGP local router ID : 1.1.1.1
Local AS number : 100
Total number of peers : 1 Peers in established state : 1
Step 5 Configure EBGP between the PE and the CEs to import the VPN routes.
# Configure CE1.
# Enable BGP, specify PE1 and PE2 as EBGP peers, and import direct routes.
[CE1] bgp 65410
[CE1-bgp] peer 10.1.1.2 as-number 100
[CE1-bgp] peer 10.2.1.2 as-number 100
[CE1-bgp] import-route direct
[CE1-bgp] quit
# Configure PE1.
# Enable BGP, specify CE1 as the EBGP peer, and import direct routes.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpn1
[PE1-bgp-vpn1] peer 10.1.1.1 as-number 65410
[PE1-bgp-vpn1] import-route direct
[PE1-bgp-vpn1] quit
[PE1-bgp] quit
# Configure PE2.
# Enable BGP, specify CE1 as the EBGP peer, and import direct routes.
[PE2] bgp 100
[PE2-bgp] ipv4-family vpn-instance vpn1
[PE2-bgp-vpn1] peer 10.2.1.1 as-number 65410
[PE2-bgp-vpn1] import-route direct
[PE2-bgp-vpn1] quit
[PE2-bgp] quit
# Configure CE2.
# Enable BGP, specify PE3 and PE4 as EBGP peers, and import direct routes.
[CE2] bgp 65420
[CE2-bgp] peer 10.3.1.1 as-number 100
[CE2-bgp] peer 10.4.1.1 as-number 100
[CE2-bgp] import-route direct
[CE2-bgp] quit
# Configure PE3.
# Enable BGP, specify CE2 as the EBGP peer, and import direct routes.
[PE3] bgp 100
[PE3-bgp] ipv4-family vpn-instance vpn1
[PE3-bgp-vpn1] peer 10.3.1.2 as-number 65420
[PE3-bgp-vpn1] import-route direct
[PE3-bgp-vpn1] quit
[PE3-bgp] quit
# Configure PE4.
# Enable BGP, specify CE2 as the EBGP peer, and import direct routes.
[PE4] bgp 100
[PE4-bgp] ipv4-family vpn-instance vpn1
[PE4-bgp-vpn1] peer 10.4.1.2 as-number 65420
[PE4-bgp-vpn1] import-route direct
[PE4-bgp-vpn1] quit
[PE4-bgp] quit
After the configuration is complete, run the display bgp vpnv4 vpn-instance vpn-
instancename peer command on the PEs. The command output shows that the
BGP peer relationships have been set up between the PEs and CEs and are in
Established state. Each PE can ping its connected CE.
The information displayed on PE1 is used as an example.
[PE1] display bgp vpnv4 vpn-instance vpn1 peer
Step 6 On CE1, configure load balancing for the traffic sent from CE1 to CE2.
[CE1] bgp 65410
[CE1-bgp] ipv4-family unicast
Step 7 Configure a routing policy on PE3 to increase the MED value of the BGP routes
advertised to CE2. Then the traffic sent from CE2 to CE1 is forwarded by PE4, and
PE3 is a backup of PE4.
[PE3] route-policy policy1 permit node 10
[PE3-route-policy] apply cost 120
[PE3-route-policy] quit
[PE3] bgp 100
[PE3-bgp] ipv4-family vpn-instance vpn1
[PE3-bgp-vpn1] peer 10.3.1.2 route-policy policy1 export
[PE3-bgp-vpn1] quit
[PE3-bgp] quit
Check the BGP routing table on CE2. In the routing table, the route to 10.5.1.0/30
advertised by PE3 has a MED value of 120, larger than the MED value of the route
advertised by PE4 (the default MED value is 0). Therefore, CE2 selects the route
advertised by PE4.
[CE2] display bgp routing-table
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.252
#
interface GigabitEthernet2/0/0
ip address 10.2.1.1 255.255.255.252
#
interface GigabitEthernet3/0/0
ip address 10.5.1.1 255.255.255.0
#
bgp 65410
peer 10.1.1.2 as-number 100
peer 10.2.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
maximum load-balancing 2
peer 10.1.1.2 enable
peer 10.2.1.2 enable
#
return
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:1
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 1.1.1.1
mpls
#
mpls ldp
#
isis 1
network-entity 10.0000.0000.0001.00
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpn1
ip address 10.1.1.2 255.255.255.252
#
interface GigabitEthernet2/0/0
ip address 100.1.1.1 255.255.255.252
isis enable 1
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
isis enable 1
#
bgp 100
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 3.3.3.3 enable
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.3 enable
#
ipv4-family vpn-instance vpn1
peer 10.1.1.1 as-number 65410
import-route direct
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:2
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
isis 1
network-entity 10.0000.0000.0002.00
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpn1
ip address 10.2.1.2 255.255.255.252
#
interface GigabitEthernet2/0/0
ip address 100.2.1.1 255.255.255.252
isis enable 1
mpls
mpls ldp
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
isis enable 1
#
bgp 100
peer 4.4.4.4 as-number 100
peer 4.4.4.4 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 4.4.4.4 enable
#
ipv4-family vpnv4
policy vpn-target
peer 4.4.4.4 enable
#
ipv4-family vpn-instance vpn1
peer 10.2.1.1 as-number 65410
import-route direct
#
return
● P1 configuration file
#
sysname P1
#
mpls lsr-id 5.5.5.5
mpls
#
mpls ldp
#
isis 1
network-entity 10.0000.0000.0005.00
#
interface GigabitEthernet1/0/0
ip address 100.1.1.2 255.255.255.252
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 100.3.1.1 255.255.255.252
isis enable 1
mpls
mpls ldp
#
interface LoopBack1
ip address 5.5.5.5 255.255.255.255
isis enable 1
#
return
● P2 configuration file
#
sysname P2
#
mpls lsr-id 6.6.6.6
mpls
#
mpls ldp
#
isis 1
network-entity 10.0000.0000.0006.00
#
interface GigabitEthernet1/0/0
ip address 100.2.1.2 255.255.255.252
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 100.4.1.1 255.255.255.252
isis enable 1
mpls
mpls ldp
#
interface LoopBack1
ip address 6.6.6.6 255.255.255.255
isis enable 1
#
return
● PE3 configuration file
#
sysname PE3
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:3
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 3.3.3.3
mpls
#
mpls ldp
#
isis 1
network-entity 10.0000.0000.0003.00
#
interface GigabitEthernet1/0/0
ip address 100.3.1.2 255.255.255.252
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 10.3.1.1 255.255.255.252
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
isis enable 1
#
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.1 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.1 enable
#
ipv4-family vpn-instance vpn1
peer 10.3.1.2 as-number 65420
peer 10.3.1.2 route-policy policy1 export
import-route direct
#
route-policy policy1 permit node 10
apply cost 120
#
return
● PE4 configuration file
#
sysname PE4
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:4
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 4.4.4.4
mpls
#
mpls ldp
#
isis 1
network-entity 10.0000.0000.0004.00
#
interface GigabitEthernet1/0/0
ip address 100.4.1.2 255.255.255.252
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 10.4.1.1 255.255.255.252
#
interface LoopBack1
ip address 4.4.4.4 255.255.255.255
isis enable 1
#
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.2 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.2 enable
#
ipv4-family vpn-instance vpn1
peer 10.4.1.2 as-number 65420
import-route direct
#
return
● CE2 configuration file
#
sysname CE2
#
interface GigabitEthernet1/0/0
ip address 10.3.1.2 255.255.255.252
#
interface GigabitEthernet2/0/0
ip address 10.4.1.2 255.255.255.252
#
interface GigabitEthernet3/0/0
ip address 10.6.1.1 255.255.255.0
#
bgp 65420
peer 10.3.1.1 as-number 100
peer 10.4.1.1 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.3.1.1 enable
peer 10.4.1.1 enable
#
return
GE1/0/0 GE2/0/0
100.1.1.2/30 10.1.1.2/30
GE1/0/0 GE2/0/0
op .1
1
Loopback1
3.3.3.3/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure OSPF on PE1, PE2, and PE3 to implement interworking on the
backbone network.
2. Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone
network to set up LDP LSPs.
3. Configure a VPN instance on PE1, PE2, and PE3. On PE2 and PE3, bind the
VPN instance to the interfaces connected to CE1.
4. Set up EBGP peer relationships between PE2 and CE1 and between PE3 and
CE1. Set up MP-IBGP peer relationships between the PEs.
5. On PE1, configure a routing policy for VPN FRR, configure the backup next
hop, and enable VPN FRR. When VPN FRR is not required, run the undo vpn
frr command to disable this function.
6. Configure multi-hop BFD on PE1 and PE2.
Procedure
Step 1 Assign IP addresses to interfaces according to Figure 7-57.
# Configure PE1.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.1 32
[PE1-LoopBack1] quit
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] ip address 100.1.1.1 30
[PE1-GigabitEthernet2/0/0] quit
[PE1] interface gigabitethernet 3/0/0
[PE1-GigabitEthernet3/0/0] ip address 100.2.1.1 30
[PE1-GigabitEthernet3/0/0] quit
The configuration on PE2, PE3, and CE1 is similar to the configuration on PE1 and
is not mentioned here.
Step 2 Configure OSPF on the MPLS backbone network for IP connectivity between the
PEs on the backbone network.
# Configure PE1.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 100.1.1.0 0.0.0.3
[PE1-ospf-1-area-0.0.0.0] network 100.2.1.0 0.0.0.3
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
The configuration on PE2 and PE3 is similar to the configuration on PE1 and is not
mentioned here.
Step 3 Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone network
to set up LDP LSPs.
# Configure PE1.
# Configure PE2.
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] interface gigabitethernet 1/0/0
[PE2-GigabitEthernet1/0/0] mpls
[PE2-GigabitEthernet1/0/0] mpls ldp
[PE2-GigabitEthernet1/0/0] quit
# Configure PE3.
Run the display mpls lsp command on the PEs. The command output shows that
LSPs are established between PE1 and PE2 and between PE1 and PE3. The
information displayed on PE1 is used as an example.
[PE1] display mpls lsp
----------------------------------------------------------------------
LSP Information: LDP LSP
----------------------------------------------------------------------
FEC In/Out Label In/Out IF Vrf Name
1.1.1.1/32 3/NULL -/-
3.3.3.3/32 NULL/3 -/GE3/0/0
3.3.3.3/32 1025/3 -/GE3/0/0
2.2.2.2/32 NULL/3 -/GE2/0/0
2.2.2.2/32 1024/3 -/GE2/0/0
Step 4 Configure VPN instances on PEs and bind the instances to the interfaces
connected to CE1.
# Configure PE1.
[PE1] ip vpn-instance vpn1
[PE1-vpn-instance-vpn1] ipv4-family
[PE1-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpn1-af-ipv4] vpn-target 111:1
[PE1-vpn-instance-vpn1-af-ipv4] quit
[PE1-vpn-instance-vpn1] quit
# Configure PE2.
[PE2] ip vpn-instance vpn1
[PE2-vpn-instance-vpn1] ipv4-family
[PE2-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:2
[PE2-vpn-instance-vpn1-af-ipv4] vpn-target 111:1
[PE2-vpn-instance-vpn1-af-ipv4] quit
[PE2] interface gigabitethernet 2/0/0
[PE2-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[PE2-GigabitEthernet2/0/0] ip address 10.1.1.2 30
[PE2-GigabitEthernet2/0/0] quit
# Configure PE3.
[PE3] ip vpn-instance vpn1
[PE3-vpn-instance-vpn1] ipv4-family
[PE3-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:3
[PE3-vpn-instance-vpn1-af-ipv4] vpn-target 111:1
[PE3-vpn-instance-vpn1-af-ipv4] quit
[PE3-vpn-instance-vpn1] quit
Step 5 Import direct VPN routes to PE1. Set up EBGP peer relationships between PE2 and
CE1 and between PE3 and CE1 to import VPN routes.
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpn1
[PE1-bgp-vpn1] import-route direct
[PE1-bgp-vpn1] quit
[PE1-bgp] quit
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] ipv4-family vpn-instance vpn1
[PE2-bgp-vpn1] peer 10.1.1.1 as-number 65410
[PE2-bgp-vpn1] import-route direct
[PE2-bgp-vpn1] quit
[PE2-bgp] quit
# Configure PE3.
[PE3] bgp 100
[PE3-bgp] ipv4-family vpn-instance vpn1
[PE3-bgp-vpn1] peer 10.2.1.1 as-number 65410
[PE3-bgp-vpn1] import-route direct
[PE3-bgp-vpn1] quit
[PE3-bgp] quit
# Configure CE1.
[CE1] bgp 65410
[CE1-bgp] peer 10.1.1.2 as-number 100
[CE1-bgp] peer 10.2.1.2 as-number 100
[CE1-bgp] import-route direct
[CE1-bgp] network 10.3.1.0 24
[CE1-bgp] quit
After the configuration is complete, run the display bgp vpnv4 all peer command
on PE2 and PE3. The command output shows that PE2 and PE3 have set up EBGP
peer relationships with CE1. The peer relationships are in Established state.
The information displayed on PE2 is used as an example.
[PE2] display bgp vpnv4 all peer
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] peer 1.1.1.1 as-number 100
[PE2-bgp] peer 1.1.1.1 connect-interface loopback 1
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 1.1.1.1 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
# Configure PE3.
[PE3] bgp 100
[PE3-bgp] peer 1.1.1.1 as-number 100
[PE3-bgp] peer 1.1.1.1 connect-interface loopback 1
[PE3-bgp] ipv4-family vpnv4
[PE3-bgp-af-vpnv4] peer 1.1.1.1 enable
[PE3-bgp-af-vpnv4] quit
[PE3-bgp] quit
Run the display bgp vpnv4 all peer command on the PEs. The command output
shows that an MP-IBGP peer relationship has been set up between the PEs and is
in Established state.
The information displayed on PE1 is used as an example.
[PE1] display bgp vpnv4 all peer
After the configuration is complete, run the display bfd session all verbose
command on PE1 and PE2. The command output shows that a multi-hop BFD
session is established and the status of the BFD session is Up.
Step 9 Enable VPN FRR.
# Enable VPN FRR on PE1.
[PE1] ip vpn-instance vpn1
[PE1-vpn-instance-vpn1] ipv4-family
[PE1-vpn-instance-vpn1-af-ipv4] vpn frr route-policy vpn_frr_rp
[PE1-vpn-instance-vpn1-af-ipv4] quit
[PE1-vpn-instance-vpn1] quit
Destination: 10.3.1.0/24
Protocol: IBGP Process ID: 0
Preference: 255 Cost: 0
NextHop: 2.2.2.2 Neighbour: 2.2.2.2
State: Active Adv Relied Age: 00h15m06s
Tag: 0 Priority: low
Label: 15361 QoSInfo: 0x0
IndirectID: 0x13
RelayNextHop: 100.1.1.2 Interface: GigabitEthernet2/0/0
TunnelID: 0x31 Flags: RD
BkNextHop: 3.3.3.3 BkInterface:GigabitEthernet3/0/0
BkLabel: 15362 SecTunnelID: 0x0
BkPETunnelID: 0x32 BkPESecTunnelID: 0x0
BkIndirectID: 0x15
Destination: 10.3.1.0/24
Protocol: IBGP Process ID: 0
----End
Configuration Files
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:1
vpn frr route-policy vpn_frr_rp
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
mpls lsr-id 1.1.1.1
mpls
#
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 100.1.1.1 255.255.255.252
mpls
mpls ldp
#
interface GigabitEthernet3/0/0
ip address 100.2.1.1 255.255.255.252
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
bfd for_vpn_frr bind peer-ip 2.2.2.2
discriminator local 10
discriminator remote 20
min-tx-interval 100
min-rx-interval 100
commit
#
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack1
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.2 enable
peer 3.3.3.3 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.2 enable
peer 3.3.3.3 enable
#
ipv4-family vpn-instance vpn1
import-route direct
#
ospf 1
area 0.0.0.0
network 100.1.1.0 0.0.0.3
network 100.2.1.0 0.0.0.3
network 1.1.1.1 0.0.0.0
#
ip ip-prefix vpn_frr_list index 10 permit 2.2.2.2 32
#
route-policy vpn_frr_rp permit node 10
if-match ip next-hop ip-prefix vpn_frr_list
apply backup-nexthop 3.3.3.3
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:2
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 100.1.1.2 255.255.255.252
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 10.1.1.2 255.255.255.252
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
bfd for_vpn_frr bind peer-ip 1.1.1.1
discriminator local 20
discriminator remote 10
min-tx-interval 100
min-rx-interval 100
commit
#
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.1 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.1 enable
#
ipv4-family vpn-instance vpn1
peer 10.1.1.1 as-number 65410
import-route direct
#
ospf 1
area 0.0.0.0
network 100.1.1.0 0.0.0.3
network 2.2.2.2 0.0.0.0
#
return
Networking Requirements
When multiple CEs in a site connect to the same PE, the PE learns multiple IP VPN
routes with the same VPN prefix. To use one of IP VPN routes as the primary route
and the other as backup routes, configure IP FRR for VPN routes. Then the PE
generates primary and backup routes to the VPN prefix. When the link of the
primary route fails, IP traffic on the VPN is quickly switched to the link of a
backup route.
As shown in Figure 7-58, the PE has two OSPF routes to RTA. The route on Link_A
is the optimal route, and the route on Link_B is the suboptimal route. IP FRR for
VPN routes needs to be configured on the PE to quickly switch IP traffic on the
VPN to Link_B when Link_A fails.
Figure 7-58 Networking diagram for configuring IP FRR for VPN routes
CE1
vpn1 site
GE1/0/0 GE2/0/0
10.1.1.2/30 10.3.1.1/30
GE1/0/0 GE1/0/0
10.1.1.1/30 10.3.1.2/30 GE3/0/0
Link_A 10.5.1.1/24
VPN PE RTA
backbone Link_B
GE2/0/0 GE2/0/0
10.2.1.1/30 GE2/0/010.4.1.2/30
GE1/0/0
10.2.1.2/30 10.4.1.1/30
CE2
Configuration Roadmap
The configuration roadmap is as follows:
1. Enable basic OSPF functions on each router so that routes to RTA can be
advertised to CE1 and CE2.
2. On the PE, configure VPN instance vpn1, bind GE1/0/0 and GE2/0/0 to vpn1,
and configure OSPF multi-instance.
3. Set the cost on GE2/0/0 of the PE and RTA both to a large value so that OSPF
preferentially selects Link_A.
4. Configure IP FRR for VPN routes on the PE.
5. Configure BFD to detect the link status.
Procedure
Step 1 Assign IP addresses to interfaces.
# Assign IP addresses to the interfaces on RTA.
<Huawei> system-view
[Huawei] sysname RTA
[RTA] interface gigabitethernet 1/0/0
[RTA-GigabitEthernet1/0/0] ip address 10.3.1.2 30
[RTA-GigabitEthernet1/0/0] quit
[RTA] interface gigabitethernet 2/0/0
[RTA-GigabitEthernet2/0/0] ip address 10.4.1.2 30
[RTA-GigabitEthernet2/0/0] quit
[RTA] interface gigabitethernet 3/0/0
[RTA-GigabitEthernet3/0/0] ip address 10.5.1.1 30
[RTA-GigabitEthernet3/0/0] quit
The configuration on PE, CE1, and CE2 is similar to the configuration on RTA and
is not mentioned here.
Step 2 Configure OSPF on CE1, CE2, and RTA.
# Configure CE1.
[CE1] ospf 1
[CE1-ospf] area 0
[CE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.3
[CE1-ospf-1-area-0.0.0.0] network 10.3.1.0 0.0.0.3
[CE1-ospf-1-area-0.0.0.0] quit
[CE1-ospf-1] quit
The configuration on CE2 and RTA is similar to the configuration on CE1 and is
not mentioned here.
After the configuration is complete, CE1, CE2, and RTA can learn interface
addresses from each other. The information displayed on CE1 is used as an
example.
[CE1] display ip routing-table
Route Flags:
R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
# Set the cost on GE2/0/0 of RTA to 100 so that OSPF preferentially selects Link_A.
[RTA] interface gigabitethernet 2/0/0
[RTA-GigabitEthernet2/0/0] ospf cost 100
[RTA-GigabitEthernet2/0/0] quit
# Configure CE1.
[CE1] bfd
[CE1-bfd] quit
[CE1] bfd for_ip_frr bind peer-ip 10.1.1.1 interface gigabitethernet 1/0/0
[CE1-bfd-session-for_ip_frr] discriminator local 20
# Run the display bfd session all verbose command on the PE and CE1. The
command output shows that the BFD session status is Up.
Step 7 Enable IP FRR for VPN routes.
[PE] ip vpn-instance vpn1
[PE-vpn-instance-vpn1] ipv4-family
[PE-vpn-instance-vpn1-af-ipv4] ip frr route-policy ip_frr_rp
[PE-vpn-instance-vpn1-af-ipv4] quit
[PE-vpn-instance-vpn1] quit
----End
Configuration Files
● PE configuration file
#
sysname PE
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:1
ip frr route-policy ip_frr_rp
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
bfd
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpn1
ip address 10.1.1.1 255.255.255.252
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 10.2.1.1 255.255.255.252
ospf cost 100
#
ospf 1 vpn-instance vpn1
area 0.0.0.0
network 10.1.1.0 0.0.0.3
network 10.2.1.0 0.0.0.3
#
ip ip-prefix frr1 index 10 permit 10.5.1.0 24
#
route-policy ip_frr_rp permit node 10
if-match ip-prefix frr1
apply backup-nexthop 10.2.1.2
apply backup-interface GigabitEthernet2/0/0
#
bfd for_ip_frr bind peer-ip 10.1.1.2 vpn-instance vpn1 interface GigabitEthernet 1/0/0
discriminator local 10
discriminator remote 20
min-tx-interval 100
min-rx-interval 100
commit
#
return
#
bfd for_ip_frr bind peer-ip 10.1.1.1 interface GigabitEthernet 1/0/0
discriminator local 20
discriminator remote 10
min-tx-interval 100
min-rx-interval 100
commit
#
return
As shown in Figure 7-59, CE1 and CE2 belong to the same VPN. PE1, P, PE2 on the
backbone network belong to the same AS and use the IS-IS protocol to exchange
routing information. CE1 connects to PE1, and CE2 connects to PE2. BGP runs
between CE1 and PE1, and OSPF runs between CE2 and PE2.
GE2/0/0 GE1/0/0
100.1.1.1/30 100.2.1.2/30
PE1 PE2
GE1/0/0 GE2/0/0
GE1/0/0 100.1.1.2/30 P 100.2.1.1/30 GE2/0/0
10.1.1.2/30 10.2.1.2/30
GE1/0/0 GE1/0/0
10.1.1.1/30 10.2.1.1/30
CE1 CE2
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure basic BGP/MPLS IP VPN functions.
2. Configure IGP GR, BGP GR, and LDP GR on the backbone network. Configure
GR for the routing protocols running between the PE and CE devices to ensure
uninterrupted VPN traffic forwarding when an active/standby switchover
occurs on any of the CE, PE, and P devices.
Procedure
Step 1 Configure IP addresses for the interfaces on the backbone network.
# Configure PE1.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] ip address 100.1.1.1 30
[PE1-GigabitEthernet2/0/0] quit
The configurations of PE2 and P are similar to the configuration of PE1, and are
not mentioned here.
Step 2 Configure basic BGP/MPLS IP VPN functions on the backbone network.
Configure IS-IS as the IGP on the backbone network, enable LDP on PE1 and PE2,
and set up an MP-IBGP peer relationship between PE1 and PE2.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.9
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] isis 1
[PE1-isis-1] network-entity 10.0000.0000.0001.00
[PE1-isis-1] quit
[PE1] interface loopback 1
[PE1-LoopBack1] isis enable 1
[PE1-LoopBack1] quit
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] ip address 100.1.1.1 30
[PE1-GigabitEthernet2/0/0] isis enable 1
[PE1-GigabitEthernet2/0/0] mpls
[PE1-GigabitEthernet2/0/0] mpls ldp
[PE1-GigabitEthernet2/0/0] quit
[PE1] bgp 100
[PE1-bgp] peer 3.3.3.9 as-number 100
[PE1-bgp] peer 3.3.3.9 connect-interface loopback 1
[PE1-bgp] ipv4-family vpnv4
[PE1-bgp-af-vpnv4] peer 3.3.3.9 enable
[PE1-bgp-af-vpnv4] quit
[PE1-bgp] quit
# Configure P.
[P] mpls lsr-id 2.2.2.9
[P] mpls
[P-mpls] quit
[P] mpls ldp
[P-mpls-ldp] quit
[P] isis 1
[P-isis-1] network-entity 10.0000.0000.0002.00
[P-isis-1] quit
[P] interface loopback 1
[P-LoopBack1] isis enable 1
[P-LoopBack1] quit
[P] interface gigabitethernet 1/0/0
[P-GigabitEthernet1/0/0] isis enable 1
[P-GigabitEthernet1/0/0] mpls
[P-GigabitEthernet1/0/0] mpls ldp
[P-GigabitEthernet1/0/0] quit
[P] interface gigabitethernet 2/0/0
[P-GigabitEthernet2/0/0] isis enable 1
[P-GigabitEthernet2/0/0] mpls
[P-GigabitEthernet2/0/0] mpls ldp
[P-GigabitEthernet2/0/0] quit
# Configure PE2.
[PE2] mpls lsr-id 3.3.3.9
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
[PE2] isis 1
[PE2-isis-1] network-entity 10.0000.0000.0003.00
[PE2-isis-1] quit
[PE2] interface loopback 1
[PE2-LoopBack1] isis enable 1
[PE2-LoopBack1] quit
[PE2] interface gigabitethernet 1/0/0
[PE2-GigabitEthernet1/0/0] isis enable 1
[PE2-GigabitEthernet1/0/0] mpls
[PE2-GigabitEthernet1/0/0] mpls ldp
[PE2-GigabitEthernet1/0/0] quit
[PE2] bgp 100
[PE2-bgp] peer 1.1.1.9 as-number 100
[PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
After the configuration is complete, run the display isis peer command on PE1 or
PE2. You can see that the IS-IS neighbor relationship is in Up state. Run the
display bgp vpnv4 all peer command, and you can see that the BGP peer
relationship has been set up and is in Established state. Run the display mpls ldp
session command, and you can see that an LDP session has been set up and the
session status is Operational.
Step 3 Configure a VPN instance on the PE devices and bind the instance to the
interfaces connected to the CE devices.
Configure VPN instance vpn1 on PE1 and bind it to the interface connected to
CE1. Configure VPN instance vpn1 on PE2 and bind it to the interface connected
to CE2. Set up an EBGP peer relationship between CE1 and PE1. Set up an OSPF
neighbor relationship between CE2 and PE2.
# Configure CE1.
[CE1] interface gigabitethernet 1/0/0
[CE1-GigabitEthernet1/0/0] ip address 10.1.1.1 30
[CE1-GigabitEthernet1/0/0] quit
[CE1] bgp 65410
[CE1-bgp] peer 10.1.1.2 as-number 100
[CE1-bgp] import-route direct
[CE1-bgp] quit
# Configure PE1.
[PE1] ip vpn-instance vpn1
[PE1-vpn-instance-vpn1] ipv4-family
[PE1-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpn1-af-ipv4] vpn-target 111:1
[PE1-vpn-instance-vpn1-af-ipv4] quit
[PE1-vpn-instance-vpn1] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpn1
[PE1-GigabitEthernet1/0/0] ip address 10.1.1.2 30
[PE1-GigabitEthernet1/0/0] quit
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpn1
[PE1-bgp-vpn1] peer 10.1.1.1 as-number 65410
[PE1-bgp-vpn1] quit
[PE1-bgp] quit
# Configure PE2.
[PE2] ip vpn-instance vpn1
[PE2-vpn-instance-vpn1] ipv4-family
[PE2-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:2
[PE2-vpn-instance-vpn1-af-ipv4] vpn-target 111:1
[PE2-vpn-instance-vpn1-af-ipv4] quit
[PE2-vpn-instance-vpn1] quit
[PE2] interface gigabitethernet 2/0/0
[PE2-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[PE2-GigabitEthernet2/0/0] ip address 10.2.1.2 30
[PE2-GigabitEthernet2/0/0] quit
[PE2] ospf 2 vpn-instance vpn1
[PE2-ospf-2] area 0
[PE2-ospf-2-area-0.0.0.0] network 10.2.1.0 0.0.0.3
[PE2-ospf-2-area-0.0.0.0] quit
[PE2-ospf-2] import-route bgp
[PE2-ospf-2] quit
[PE2] bgp 100
[PE2-bgp] ipv4-family vpn-instance vpn1
[PE2-bgp-vpn1] import-route ospf 2
[PE2-bgp-vpn1] quit
[PE2-bgp] quit
# Configure CE2.
[CE2] interface gigabitethernet 1/0/0
[CE2-GigabitEthernet1/0/0] ip address 10.2.1.1 30
[CE2-GigabitEthernet1/0/0] quit
[CE2] ospf 2
[CE2-ospf-2] area 0
[CE2-ospf-2-area-0.0.0.0] network 10.2.1.0 0.0.0.3
[CE2-ospf-2-area-0.0.0.0] quit
[CE2-ospf-2] import-route direct
[CE2-ospf-2] quit
The basic BGP/MPLS IP VPN configuration is complete, and CE1 and CE2 can
communicate with each other.
Step 4 Configure IGP GR on the backbone network.
Configure IGP GR on PE1, P, and PE2.
# Configure PE1.
[PE1] isis 1
[PE1-isis-1] graceful-restart
[PE1-isis-1] quit
# Configure P.
[P] isis 1
[P-isis-1] graceful-restart
[P-isis-1] quit
# Configure PE2.
[PE2] isis 1
[PE2-isis-1] graceful-restart
[PE2-isis-1] quit
Run the display isis graceful-restart status command on PE1, P, and PE2. The
command output shows that IS-IS GR has been configured successfully.
The display on PE1 is used as an example:
[PE1] display isis graceful-restart status
# Configure P.
[P] mpls ldp
[P-mpls-ldp] graceful-restart
[P-mpls-ldp] quit
# Configure PE2.
[PE2] mpls ldp
[PE2-mpls-ldp] graceful-restart
[PE2-mpls-ldp] quit
Step 6 Configure GR for the routing protocols running between the PE and CE devices.
Configure BGP GR on PE1 and CE1. Configure OSPF GR on PE2 and CE2.
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] graceful-restart
[PE1-bgp] quit
# Configure CE1.
[CE1] bgp 65410
[CE1-bgp] graceful-restart
[CE1-bgp] quit
# Configure PE2.
[PE2] ospf 2 vpn-instance vpn1
[PE2-ospf-2] opaque-capability enable
[PE2-ospf-2] graceful-restart
[PE2-ospf-2] quit
# Configure CE2.
[CE2] ospf 2
[CE2-ospf-2] opaque-capability enable
[CE2-ospf-2] graceful-restart
[CE2-ospf-2] quit
Run the display ospf brief command on PE2 or CE2. The command output shows
that OSPF GR has been configured successfully.
The display on PE2 is used as an example:
[PE2] display ospf brief
Run the display bgp vpnv4 all peer verbose command on PE1. The command
output shows that IBGP GR has taken effect between PE1 and PE2, and EBGP GR
has taken effect between PE1 and CE1.
[PE1] display bgp vpnv4 all peer verbose
KeepAlive messages 2
Notification messages 0
Refresh messages 0
Sent: Total 8 messages
Update messages 3
Open messages 2
KeepAlive messages 3
Notification messages 0
Refresh messages 0
Authentication type configured: None
Last keepalive received: 2013/09/15 19:43:15
Last keepalive sent : 2013/09/15 19:43:15
Last update received: 2013/09/15 19:42:15
Last update sent : 2013/09/15 19:42:15
Minimum route advertisement interval is 0 seconds
Optional capabilities:
Route refresh capability has been enabled
4-byte-as capability has been enabled
Connect-interface has been configured
Peer Preferred Value: 0
Routing policy configured:
No routing policy is configured
# Communication between the site connected to CE1 and the site connected to
CE2 is not interrupted.
NOTE
Communication between the sites may be interrupted when two or more neighboring
devices among CE1, PE1, PE2, and CE2 perform an active/standby switchover at the same
time.
----End
Configuration Files
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
graceful-restart
#
isis 1
graceful-restart
network-entity 10.0000.0000.0001.00
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpn1
ip address 10.1.1.2 255.255.255.252
#
interface GigabitEthernet2/0/0
ip address 100.1.1.1 255.255.255.252
isis enable 1
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
isis enable 1
#
bgp 100
graceful-restart
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.9 enable
#
ipv4-family vpn-instance vpn1
peer 10.1.1.1 as-number 65410
#
return
● P configuration file
#
sysname P
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
graceful-restart
#
isis 1
graceful-restart
network-entity 10.0000.0000.0002.00
#
interface GigabitEthernet1/0/0
ip address 100.1.1.2 255.255.255.252
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 100.2.1.1 255.255.255.252
isis enable 1
mpls
mpls ldp
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
isis enable 1
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:2
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
mpls lsr-id 3.3.3.9
mpls
#
mpls ldp
graceful-restart
#
isis 1
graceful-restart
network-entity 10.0000.0000.0003.00
#
interface GigabitEthernet1/0/0
ip address 100.2.1.2 255.255.255.252
isis enable 1
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 10.2.1.2 255.255.255.252
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
isis enable 1
#
bgp 100
graceful-restart
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpn1
import-route ospf 2
#
ospf 2 vpn-instance vpn1
import-route bgp
opaque-capability enable
graceful-restart
area 0.0.0.0
network 10.2.1.0 0.0.0.3
#
return
Loopback1 Loopback1
2.2.2.9/32 AS100 3.3.3.9/32
GE1/0/0 GE2/0/0
GE3/0/0 GE3/0/0
GE1/0/0 GE1/0/0
Loopback1 Loopback1
1.1.1.9/32 GE3/0/0 GE3/0/0 4.4.4.9/32
PE1 GE2/0/0 GE2/0/0 PE2
VPN Backbone
GE1/0/0 GE1/0/0
10.1.1.1/24 10.2.1.1/24
CE1 CE2
AS65410 AS65420
vpna vpna
PE1 PE2
10 GE1
2. 0
0.3 /0
24
1. 0/
.4. /0
1/
0. 1/
2/
10 GE
PE1 24
GE3/0/0 Loopback1
Loopback1 GE3/0/0 4.4.4.9/32
1.1.1.9/32 100.1.3.1/24 100.2.4.2/24
0
0/ 4 PE2
2/ 2/2
G 1.1
E
10
.
E2 .2
G .1
.
.2
/0 /2
10
/0 4
Loopback1 Loopback1
RR1 2.2.2.9/32 RR2 3.3.3.9/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure an IGP protocol on the MPLS backbone network for IP connectivity.
2. Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone
network to set up MPLS LSPs.
3. Configure VPN instances on PE1 and PE2 and bind the instances to the
interfaces connected to the CEs. Configure the same VPN target for the VPN
instances to enable users in the same VPN to communicate with each other.
4. Set up EBGP peer relationships between the PEs and CEs and import VPN
routes into BGP.
5. Set up MP-IBGP peer relationships between PEs and RRs. The PEs do not need
to set up an MP-IBGP peer relationship.
6. Configure the same reflector cluster ID for RR1 and RR2 so that they back up
each other.
7. Configure RR1 and RR2 to accept all VPNv4 routes without filtering the routes
based on VPN targets, because RR1 and RR2 must save all VPNv4 routes and
advertise them to PEs.
NOTE
On a VPN with double RRs, ensure that each RR has at least two paths to a PE and the
paths do not share the same network segment or node. If there is only one path between
the RRs and PEs or if the paths share the same network segment or node, double RRs
cannot improve network reliability.
Procedure
Step 1 Assign IP addresses to interfaces according to Figure 7-60.
# Configure PE1.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip address 100.1.2.1 24
[PE1-GigabitEthernet1/0/0] quit
[PE1] interface gigabitethernet 3/0/0
[PE1-GigabitEthernet3/0/0] ip address 100.1.3.1 24
[PE1-GigabitEthernet3/0/0] quit
The configuration on PE2, RRs, CE1, and CE2 is similar to the configuration on PE1
and is not mentioned here.
Step 2 Configure an IGP protocol on the MPLS backbone network for IP connectivity.
# Configure PE1.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 100.1.2.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 100.1.3.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
The configuration on PE2 and RRs is similar to the configuration on PE1 and is not
mentioned here.
NOTE
The IP addresses of loopback interfaces that are used as LSR IDs need to be advertised.
After the configuration is complete, the devices on the backbone network can
learn the loopback interface addresses from each other.
Step 3 Configure basic MPLS capabilities and MPLS LDP on the MPLS backbone network
to set up LDP LSPs.
# Configure PE1.
The configuration on PE2 and RRs is similar to the configuration on PE1 and is not
mentioned here.
After the configuration is complete, run the display mpls ldp session command
on the PEs and RRs. The State field in the command output displays as
Operational.
The information displayed on PE1 and RR1 is used as an example.
[PE1] display mpls ldp session
# Configure RR1.
[RR1] bgp 100
[RR1-bgp] group rr1 internal
[RR1-bgp] peer rr1 connect-interface loopback 1
[RR1-bgp] peer 1.1.1.9 group rr1
[RR1-bgp] peer 3.3.3.9 group rr1
[RR1-bgp] peer 4.4.4.9 group rr1
[RR1-bgp] ipv4-family vpnv4
[RR1-bgp-af-vpnv4] peer rr1 enable
[RR1-bgp-af-vpnv4] peer 1.1.1.9 group rr1
[RR1-bgp-af-vpnv4] peer 3.3.3.9 group rr1
[RR1-bgp-af-vpnv4] peer 4.4.4.9 group rr1
[RR1-bgp-af-vpnv4] quit
[RR1-bgp] quit
# Configure RR2.
# Configure RR2.
[RR2] bgp 100
[RR2-bgp] ipv4-family vpnv4
[RR2-bgp-af-vpnv4] reflector cluster-id 100
[RR2-bgp-af-vpnv4] peer rr2 reflect-client
[RR2-bgp-af-vpnv4] undo policy vpn-target
[RR2-bgp-af-vpnv4] quit
[RR2-bgp] quit
# If CE1 and CE2 can ping each other, the route reflection function has been
configured successfully.
# Run the shutdown command in the view of GE3/0/0 on PE1 and GE3/0/0 on
PE2. CE1 and CE2 can still ping each other, indicating that the RRs are successfully
configured.
----End
Configuration Files
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 100.1.2.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpna
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet3/0/0
ip address 100.1.3.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
peer 2.2.2.9 as-number 100
peer 2.2.2.9 connect-interface LoopBack1
peer 3.3.3.9 as-number 100
peer 3.3.3.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.9 enable
peer 3.3.3.9 enable
#
ipv4-family vpnv4
policy vpn-target
#
ospf 1
area 0.0.0.0
network 100.1.2.0 0.0.0.255
network 100.2.3.0 0.0.0.255
network 100.2.4.0 0.0.0.255
network 2.2.2.9 0.0.0.0
#
return
● RR2 configuration file
#
sysname RR2
#
mpls lsr-id 3.3.3.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 100.2.3.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 100.3.4.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet3/0/0
ip address 100.1.3.2 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
bgp 100
peer 1.1.1.9 as-number 100
peer 2.2.2.9 as-number 100
peer 4.4.4.9 as-number 100
group rr2 internal
peer rr2 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer rr2 enable
peer 1.1.1.9 enable
peer 1.1.1.9 group rr2
peer 3.3.3.9 enable
peer 3.3.3.9 group rr2
peer 4.4.4.9 enable
peer 4.4.4.9 group rr2
#
ipv4-family vpnv4
reflector cluster-id 100
undo policy vpn-target
peer rr2 enable
peer rr2 reflect-client
peer 1.1.1.9 enable
peer 1.1.1.9 group rr2
peer 2.2.2.9 enable
peer 2.2.2.9 group rr2
peer 4.4.4.9 enable
peer 4.4.4.9 group rr2
#
ospf 1
area 0.0.0.0
network 100.2.3.0 0.0.0.255
network 100.3.4.0 0.0.0.255
Loopback1 Loopback1
1.1.1.1/32 2.2.2.2/32 Loopback1
3.3.3.3/32
GE1/0/0 GE1/0/0
PE1 100.1.1.2/24 100.2.1.2/24
PE2
GE2/0/0 GE2/0/0
GE1/0/0 100.1.1.1/24 P 100.2.1.1/24 GE2/0/0
10.1.1.2/24 10.2.1.2/24
Internet
AS100
GE1/0/0 GE1/0/0
10.1.1.1/24 10.2.1.1/24
GE2/0/0 CE2
10.3.1.2/24 Agent Server
CE1 10.3.1.1/24
vpn1 vpn1
AS 65420
AS 65410
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure basic BGP/MPLS IP VPN functions.
2. Configure three static routes:
– On CE1, create a default route and specify PE1 as the next hop.
– On PE1, configure a default route from the VPN to the Internet and
specify P as the next hop. This route enables traffic to be transmitted
from the agent server to the Internet.
– On PE1, configure a static route from the Internet to the agent server and
specify CE1 as the next hop. Configure IGP to advertise the static route to
the Internet. This route enables traffic to be transmitted from the Internet
to the agent server.
Procedure
Step 1 Assign IP addresses to interfaces according to Figure 7-61.
# Configure PE1.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.1 32
[PE1-LoopBack1] quit
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] ip address 100.1.1.1 24
[PE1-GigabitEthernet2/0/0] quit
The configuration on PE2, P, CE1, and CE2 is similar to the configuration on PE1
and is not mentioned here.
Step 2 Configure an IGP protocol on the MPLS backbone network for IP connectivity.
# Configure PE1.
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 100.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
The configuration on PE2 and P is similar to the configuration on PE1 and is not
mentioned here.
NOTE
The IP addresses of loopback interfaces that are used as LSR IDs need to be advertised.
After the configuration is complete, the devices on the backbone network can
learn the loopback interface addresses from each other.
Step 3 Set up MPLS LDP LSPs and an MP-IBGP peer relationship between the devices on
the backbone network.
# Enable MPLS LDP on PE1 to set up MPLS LDP LSPs.
The configuration on PE2 and P is similar to the configuration on PE1 and is not
mentioned here.
After the configuration is complete, run the display mpls ldp session command
on P. The command output shows that the LDP sessions between PE1 and P, and
between PE2 and P are in Operational state.
Run the display bgp vpnv4 all peer command on PE1 and PE2. The command
output shows that an MP-IBGP peer relationship has been set up between the PEs
and is in Established state. The information displayed on PE1 is used as an
example.
[PE1] display bgp vpnv4 all peer
# Create VPN instance vpn1 on the PEs and bind it to the interfaces connected to
CEs. The information displayed on PE1 is used as an example.
Run the display bgp vpnv4 all peer command on the PEs. The command output
shows that the IBGP and EBGP peer relationships are all in Established state.
The information displayed on PE1 is used as an example.
[PE1] display bgp vpnv4 all peer
Step 5 Configure static routes to enable VPN users to access the Internet.
# On CE1, create a default route and specify PE1 as the next hop.
[CE1] ip route-static 0.0.0.0 0 10.1.1.2
# Configure PE1.
# Configure a default route from the agent server to the Internet and specify P as
the next hop. Specify the public keyword in the command to use the public IP
address of P as the next hop address.
NOTE
If the CEs and PEs are connected through an Ethernet network, you must specify the next
hop when configuring the static route.
# Configure a static route from the Internet to the agent server and specify CE1 as
the next hop.
[PE1] ip route-static 10.3.1.0 24 vpn-instance vpn1 10.1.1.1
# Advertise the preceding static route to the Internet using an IGP (OSPF in this
example).
[PE1] ospf 1
[PE1-ospf-1] import-route static
[PE1-ospf-1] quit
# Configure the agent server. Set the IP address of the agent server to 10.3.1.1/24
and the default gateway address of the agent server to 10.3.1.2/24 (address of
CE1). In addition, the agent server must run the agent software.
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 10.3.1.2 255.255.255.0
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
ip route-static 0.0.0.0 0.0.0.0 10.1.1.2
#
return
● P configuration file
#
sysname P
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 100.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip address 100.2.1.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 100.1.1.0 0.0.0.255
network 100.2.1.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:2
vpn-target 1:1 export-extcommunity
vpn-target 1:1 import-extcommunity
#
mpls lsr-id 3.3.3.3
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 100.2.1.2 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 10.2.1.2 255.255.255.0
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.1 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.1 enable
#
ipv4-family vpn-instance vpn1
peer 10.2.1.1 as-number 65420
import-route direct
#
ospf 1
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 100.2.1.0 0.0.0.255
#
return
● CE2 configuration file
#
sysname CE2
#
interface GigabitEthernet1/0/0
ip address 10.2.1.1 255.255.255.0
#
bgp 65420
peer 10.2.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.2.1.2 enable
#
return
In Figure 7-62:
● Branch 1 connects to the VPN backbone network through CE1 and PE1.
● Branch 2 connects to the VPN backbone network through CE2 and PE2.
On the backbone network, PEs provide MPLS functions, and the P does not
provide MPLS functions.
The enterprise wants to establish a GRE tunnel between the PEs and use IP to
forward VPN packets over the IP network.
Figure 7-62 Networking diagram for configuring BGP/MPLS IP VPN to use a GRE
tunnel
AS:100
GE1/0/0 GE2/0/0
172.1.1.2/24 172.2.1.1/24
P
Loopback1 Loopback1
10.10.1.1/32 10.10.2.1/32
GE2/0/0 GE2/0/0
172.1.1.1/24 172.2.1.2/24
PE1 PE2
GRE Tunnel
GE1/0/0 Tunnel0/0/1 Tunnel0/0/1 GE1/0/0
10.1.1.2/24 10.3.1.1/24 10.3.1.2/24 10.2.1.2/24
GE1/0/0 GE1/0/0
10.1.1.1/24 10.2.1.1/24
CE1 CE2
vpn1 vpn1
AS: 65410 AS: 65420
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure OSPF between the PEs and P to implement IP connectivity on the
backbone network.
2. Create a GRE tunnel between PEs so that VPN packets can be transmitted
over the GRE tunnel.
3. Configure VPN instances on PEs and bind each PE interface connected to a CE
to a VPN instance.
4. Because the P device does not support MPLS functions, an LSP cannot be used
to transmit VPN packets. Configure a tunnel policy on the PEs to specify that
VPN packets are transmitted over a GRE tunnel, and apply the tunnel policy.
5. Establish EBGP peer relationships between PEs and CEs to exchange routes so
that a CE can learn routes from the peer CE and CE1 can communicate with
CE2.
Procedure
Step 1 Configure an IP address for each interface.
# Configure CE1.
<Huawei> system-view
[Huawei] sysname CE1
# Configure CE2.
<Huawei> system-view
[Huawei] sysname CE2
[CE2] interface gigabitethernet 1/0/0
[CE2-GigabitEthernet1/0/0] ip address 10.2.1.1 24
[CE2-GigabitEthernet1/0/0] quit
# Configure PE2.
[PE2] ospf 1
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 10.10.2.1 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] network 172.2.1.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
After the configurations are complete, OSPF neighbor relationships can be set up
between PE1, P, and PE2. Run the display ospf peer command. You can see that
the neighbor status is Full. Run the display ip routing-table command. You can
see that PEs have learnt the routes to Loopback1 of each other.
Step 3 Configure a GRE tunnel.
# Configure PE1.
[PE1] interface tunnel 0/0/1
[PE1-Tunnel0/0/1] tunnel-protocol gre
[PE1-Tunnel0/0/1] source loopback 1
[PE1-Tunnel0/0/1] destination 10.10.2.1
[PE1-Tunnel0/0/1] ip address 10.3.1.1 24
[PE1-Tunnel0/0/1] quit
# Configure PE2.
[PE2] interface tunnel 0/0/1
[PE2-Tunnel0/0/1] tunnel-protocol gre
[PE2-Tunnel0/0/1] source loopback 1
[PE2-Tunnel0/0/1] destination 10.10.1.1
[PE2-Tunnel0/0/1] ip address 10.3.1.2 24
[PE2-Tunnel0/0/1] quit
# Configure PE2.
[PE2] mpls lsr-id 10.10.2.1
[PE2] mpls
[PE2-mpls] quit
Step 5 Configure VPN instances on PEs and bind each interface that connects a PE to a
CE to a VPN instance. Apply tunnel policies on the PEs to specify the GRE tunnel
used to forward VPN packets.
# Configure PE1.
[PE1] tunnel-policy gre1
[PE1-tunnel-policy-gre1] tunnel select-seq gre load-balance-number 1
[PE1-tunnel-policy-gre1] quit
[PE1] ip vpn-instance vpn1
[PE1-vpn-instance-vpn1] ipv4-family
[PE1-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpn1-af-ipv4] vpn-target 100:1 both
[PE1-vpn-instance-vpn1-af-ipv4] tnl-policy gre1
[PE1-vpn-instance-vpn1-af-ipv4] quit
[PE1-vpn-instance-vpn1] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpn1
[PE1-GigabitEthernet1/0/0] ip address 10.1.1.2 24
[PE1-GigabitEthernet1/0/0] quit
# Configure PE2.
[PE2] tunnel-policy gre1
[PE2-tunnel-policy-gre1] tunnel select-seq gre load-balance-number 1
[PE2-tunnel-policy-gre1] quit
[PE2] ip vpn-instance vpn1
[PE2-vpn-instance-vpn1] ipv4-family
[PE2-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:2
[PE2-vpn-instance-vpn1-af-ipv4] vpn-target 100:1 both
[PE2-vpn-instance-vpn1-af-ipv4] tnl-policy gre1
[PE2-vpn-instance-vpn1-af-ipv4] quit
[PE2-vpn-instance-vpn1] quit
[PE2] interface gigabitethernet 1/0/0
[PE2-GigabitEthernet1/0/0] ip binding vpn-instance vpn1
[PE2-GigabitEthernet1/0/0] ip address 10.2.1.2 24
[PE2-GigabitEthernet1/0/0] quit
After the configurations are complete, run the display ip vpn-instance verbose
command on PEs to view the configurations of VPN instances. Each PE can ping its
local CE.
NOTE
If a PE has multiple interfaces bound to the same VPN instance, specify a source IP address
by setting -a source-ip-address in the ping -vpn-instance vpn-instance-name -a source-ip-
address dest-ip-address command to ping a remote CE. If the source IP address is not
specified, the ping operation fails.
Step 6 Set up EBGP peer relationships between the PEs and CEs and import VPN routes
to EBGP.
# Configure CE1.
[CE1] bgp 65410
[CE1-bgp] peer 10.1.1.2 as-number 100
[CE1-bgp] import-route direct
[CE1-bgp] quit
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpn1
[PE1-bgp-vpn1] peer 10.1.1.1 as-number 65410
[PE1-bgp-vpn1] import-route direct
[PE1-bgp-vpn1] quit
[PE1-bgp] quit
# Configure CE2.
[CE2] bgp 65420
[CE2-bgp] peer 10.2.1.2 as-number 100
[CE2-bgp] import-route direct
[CE2-bgp] quit
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] ipv4-family vpn-instance vpn1
[PE2-bgp-vpn1] peer 10.2.1.1 as-number 65420
[PE2-bgp-vpn1] quit
[PE2-bgp] quit
After the configurations are complete, run the display bgp vpnv4 vpn-instance
peer command on PEs. You can see that BGP peer relationships have been
established between PEs and CEs and are in Established state.
The command output on PE1 is used as an example.
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] peer 10.10.1.1 as-number 100
[PE2-bgp] peer 10.10.1.1 connect-interface loopback 1
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 10.10.1.1 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
After the configurations are complete, run the display bgp vpnv4 all peer
command on a PE. The command output shows that the BGP peer relationships
have been established between the PEs and are in the Established state.
[PE1] display bgp vpnv4 all peer
----End
Configuration Files
● Configuration file of CE1
#
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
return
#
bgp 100
peer 10.10.2.1 as-number 100
peer 10.10.2.1 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 10.10.2.1 enable
#
ipv4-family vpnv4
policy vpn-target
peer 10.10.2.1 enable
#
ipv4-family vpn-instance vpn1
peer 10.1.1.1 as-number 65410
import-route direct
#
ospf 1
area 0.0.0.0
network 10.10.1.1 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● Configuration file of the P device
#
sysname P
#
interface GigabitEthernet1/0/0
ip address 172.1.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.2.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 172.1.1.0 0.0.0.255
network 172.2.1.0 0.0.0.255
#
return
● Configuration file of PE2
#
sysname PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:2
tnl-policy gre1
vpn-target 100:1 export-extcommunity
vpn-target 100:1 import-extcommunity
#
mpls lsr-id 10.10.2.1
mpls
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpn1
ip address 10.2.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.2.1.2 255.255.255.0
#
interface LoopBack1
ip address 10.10.2.1 255.255.255.255
#
interface Tunnel0/0/1
ip address 10.3.1.2 255.255.255.0
tunnel-protocol gre
source LoopBack1
destination 10.10.1.1
#
tunnel-policy gre1
tunnel select-seq gre load-balance-number 1
#
bgp 100
peer 10.10.1.1 as-number 100
peer 10.10.1.1 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 10.10.1.1 enable
#
ipv4-family vpnv4
policy vpn-target
peer 10.10.1.1 enable
#
ipv4-family vpn-instance vpn1
peer 10.2.1.1 as-number 65420
#
ospf 1
area 0.0.0.0
network 10.10.2.1 0.0.0.0
network 172.2.1.0 0.0.0.255
#
return
Figure 7-63 Networking for configuring L3VPN using LDP signaling over
AS:100
GE1/0/0 GE2/0/0
172.1.1.2/24 172.2.1.1/24
P
Loopback1 Loopback1
1.1.1.9/32 2.2.2.9/32
PE1 GE2/0/0 GE2/0/0 PE2
172.1.1.1/24 172.2.1.2/24
Loopback0 Loopback0
1.1.1.1/32 GRE tunnel 2.2.2.2/32
GE1/0/0 Tunnel0/0/1 Tunnel0/0/1 GE1/0/0
10.1.1.2/24 20.1.1.1/24 20.1.1.2/24 10.2.1.2/24
GE1/0/0 GE1/0/0
10.1.1.1/24 10.2.1.1/24
CE1 CE2
vpn1 vpn1
AS: 65410 AS: 65420
Configuration Roadmap
The configuration roadmap is as follows:
NOTE
The IP address of Loopback1 interface is used as the LSR ID, that is, LDP uses this IP address to
establish a session. A GRE tunnel interface must have an IP address configured, and uses
addresses of Loopback0 interfaces as source and destination addresses. The source and
destination addresses, and physical interface are advertised by an IGP, and the IP address of
Loopback1 interface and tunnel interface address are advertised by another IGP or static route.
If a static route is used, specify the tunnel interface as the outbound interface.
Procedure
Step 1 Configure OSPF between the PEs and P to implement IP connectivity on the
backbone network.
# Configure PE1.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] ip address 172.1.1.1 24
[PE1-GigabitEthernet2/0/0] quit
[PE1] interface loopback 0
[PE1-LoopBack0] ip address 1.1.1.1 32
[PE1-LoopBack0] quit
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
The configurations of PE2 and P are similar to the configuration of PE1, and are
not mentioned here.
After the configurations are complete, OSPF neighbor relationships can be set up
between PE1, P, and PE2. Run the display ospf peer command. You can see that
the neighbor status is Full. Run the display ip routing-table command. You can
see that PEs have learnt the routes to Loopback1 of each other.
Step 2 Enable basic MPLS functions and MPLS LDP on PEs.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.9
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
# Configure PE2.
[PE2] mpls lsr-id 2.2.2.9
[PE2] mpls
[PE2-mpls] quit
[PE2] mpls ldp
[PE2-mpls-ldp] quit
Step 3 Create GRE tunnel interfaces on PEs, and specify source and destination addresses
of the tunnel.
Create and configure GRE tunnel interfaces on PE1 and PE2, and establish a GRE
tunnel between PEs to implement interworking on the MPLS network.
# Configure PE1.
[PE1] interface tunnel 0/0/1
[PE1-Tunnel0/0/1] tunnel-protocol gre
[PE1-Tunnel0/0/1] ip address 20.1.1.1 24
[PE1-Tunnel0/0/1] source loopback 0
[PE1-Tunnel0/0/1] destination 2.2.2.2
[PE1-Tunnel0/0/1] quit
[PE1] ospf 11
[PE1-ospf-11] area 0
[PE1-ospf-11-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-11-area-0.0.0.0] network 20.1.1.0 0.0.0.255
[PE1-ospf-11-area-0.0.0.0] quit
[PE1-ospf-11] quit
# Configure PE2.
[PE2] interface tunnel 0/0/1
[PE2-Tunnel0/0/1] tunnel-protocol gre
[PE2-Tunnel0/0/1] ip address 20.1.1.2 24
[PE2-Tunnel0/0/1] source loopback 0
[PE2-Tunnel0/0/1] destination 1.1.1.1
[PE2-Tunnel0/0/1] quit
[PE2] ospf 11
[PE2-ospf-11] area 0
[PE2-ospf-11-area-0.0.0.0] network 2.2.2.9 0.0.0.0
[PE2-ospf-11-area-0.0.0.0] network 20.1.1.0 0.0.0.255
[PE2-ospf-11-area-0.0.0.0] quit
[PE2-ospf-11] quit
After the configurations are complete, a GRE tunnel is set up between PE1 and
PE2. Run the display ip routing-table command. You can see that PEs have learnt
the routes to Loopback1 of each other.
Step 4 Enable MPLS LDP on tunnel interfaces of PEs.
Enable MPLS LDP on tunnel interfaces of PE1 and PE2 so that MPLS LSPs can be
established.
# Configure PE1.
[PE1] interface tunnel 0/0/1
[PE1-Tunnel0/0/1] mpls
[PE1-Tunnel0/0/1] mpls ldp
[PE1-Tunnel0/0/1] quit
# Configure PE2.
[PE2] interface tunnel 0/0/1
[PE2-Tunnel0/0/1] mpls
[PE2-Tunnel0/0/1] mpls ldp
[PE2-Tunnel0/0/1] quit
After the configurations are complete, an LDP session can be set up between PE1
and PE2. Run the display mpls ldp session command. You can see that the Status
field is Operational in the command output.
Step 5 Configure a VPN instance on each PE and connect CEs to PEs.
# Configure PE1.
[PE1] ip vpn-instance vpn1
[PE1-vpn-instance-vpn1] ipv4-family
[PE1-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpn1-af-ipv4] vpn-target 100:1 both
[PE1-vpn-instance-vpn1-af-ipv4] quit
[PE1-vpn-instance-vpn1] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip binding vpn-instance vpn1
[PE1-GigabitEthernet1/0/0] ip address 10.1.1.2 24
[PE1-GigabitEthernet1/0/0] quit
# Configure PE2.
[PE2] ip vpn-instance vpn1
[PE2-vpn-instance-vpn1] ipv4-family
[PE2-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:2
The configuration of CE2 is similar to that of CE1, and is not mentioned here.
After the configurations are complete, run the display ip vpn-instance verbose
command on PEs to view the configurations of VPN instances. Each PE can
successfully ping the connected CE.
NOTE
Step 6 Set up EBGP peer relationships between the PEs and CEs and import VPN routes
to EBGP.
# Configure CE1.
[CE1] bgp 65410
[CE1-bgp] peer 10.1.1.2 as-number 100
[CE1-bgp] import-route direct
[CE1-bgp] quit
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpn1
[PE1-bgp-vpn1] peer 10.1.1.1 as-number 65410
[PE1-bgp-vpn1] import-route direct
[PE1-bgp-vpn1] quit
[PE1-bgp] quit
# Configure CE2.
[CE2] bgp 65420
[CE2-bgp] peer 10.2.1.2 as-number 100
[CE2-bgp] import-route direct
[CE2-bgp] quit
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] ipv4-family vpn-instance vpn1
[PE2-bgp-vpn1] peer 10.2.1.1 as-number 65420
[PE2-bgp-vpn1] quit
[PE2-bgp] quit
After the configurations are complete, run the display bgp vpnv4 vpn-instance
peer command on PEs. You can see that BGP peer relationships have been
established between PEs and CEs and are in Established state.
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] peer 1.1.1.9 as-number 100
[PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[PE2-bgp-af-vpnv4] quit
[PE2-bgp] quit
After the configurations are complete, run the display bgp vpnv4 all peer
command on a PE. You can see that the BGP peer relationship between PEs is in
Established state.
[PE1] display bgp vpnv4 all peer
----End
Configuration Files
● CE1 configuration file
#
sysname CE1
#
interface GigabitEthernet1/0/0
ip address 10.1.1.1 255.255.255.0
#
bgp 65410
peer 10.1.1.2 as-number 100
#
ipv4-family unicast
undo synchronization
import-route direct
peer 10.1.1.2 enable
#
return
tunnel-protocol gre
source LoopBack0
destination 2.2.2.2
mpls
mpls ldp
#
bgp 100
peer 2.2.2.9 as-number 100
peer 2.2.2.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.9 enable
#
ipv4-family vpn-instance vpn1
peer 10.1.1.1 as-number 65410
import-route direct
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 172.1.1.0 0.0.0.255
#
ospf 11
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 20.1.1.0 0.0.0.255
#
return
● P configuration file
#
sysname P
#
interface GigabitEthernet1/0/0
ip address 172.1.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.2.1.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 172.1.1.0 0.0.0.255
network 172.2.1.0 0.0.0.255
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:2
vpn-target 100:1 export-extcommunity
vpn-target 100:1 import-extcommunity
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip binding vpn-instance vpn1
ip address 10.2.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.2.1.2 255.255.255.0
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
interface Tunnel0/0/1
ip address 20.1.1.2 255.255.255.0
tunnel-protocol gre
source LoopBack0
destination 1.1.1.1
mpls
mpls ldp
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpn1
peer 10.2.1.1 as-number 65420
#
ospf 1
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 172.2.1.0 0.0.0.255
#
ospf 11
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 20.1.1.0 0.0.0.255
#
return
Figure 7-64 Networking diagram for configuring L3VPN with LDP signals carried
by DSVPN
Enterprise
branch1
Loopback1 Loopback1
vpn 2.2.2.9/32 1.1.1.9/32 vpn
1 1
GE2 Spoke-PE2 /0/0
/0/0 GE2
Tunnel0/0/1 PE1
172.10.1.2/24
GE 3
vpn /0 /0 GE1/0/0 /0/0 vpn
GE3 GR 2
2 GE1/0/0
E Tu
n ne
l
GE2/0/0
Loopback1
Internet GE1/0/0 4.4.4.9/32
Hub-P
e l
nn Tunnel0/0/1
vpn E Tu
1
GE1/0/0 GR 172.10.1.1/24
GE2
/0/0
Tunnel0/0/1
172.10.1.3/24
vpn /0/0
GE3 Spoke-PE3
2 Enterprise
Loopback1
3.3.3.9/32 headquarters
Enterprise
branch2
Spoke-PE3 Hub-P
192. G
168. E2/0/0
21.1
/24
GE1/0/0 GE2/0/0
202.3.1.2/24 172.1.1.2/24
/0 /0
G E 3 /2 4 Spoke-PE3
2. 1
.1 6 8 .2 GE1/0/0
1 92 202.1.1.2/24
Hub-P
Configuration Roadmap
To expand the IP/MPLS backbone network and deploy BGP/MPLS IP VPN for an
enterprise, you need to add the Spoke-PE devices in the branches to the IP/MPLS
backbone network in the headquarters. MPLS LDP packets between the
headquarters and branches need to be transmitted over GRE tunnels because the
Internet cannot provide the MPLS function. As there are a large number of
branches and devices in the branches dynamically obtain their public addresses,
DSVPN is used to establish GRE tunnels between the headquarters and branches.
As a result, L3VPN with LDP signals carried by DSVPN can meet the requirements
of the enterprise.
The configuration roadmap for L3VPN with LDP signals carried by DSVPN is as
follows:
1. Configure branch devices to save only summarized routes to the
headquarters, configure OSPF on Hub-P and Spoke-PEs to advertise routes,
and set the OSPF network type to point-to-multipoint (P2MP), so that all VPN
data between branches is forwarded by the headquarters.
2. Enable MPLS LDP on tunnel interfaces of Spoke-PE2, Spoke-PE3, and Hub-P
and set up MPLS LSP tunnels to implement LDP over mGRE.
3. Configure L3VPN on Spoke-PE2, Spoke-PE3, and PE1 to implement secure
interconnection between the headquarters and branches and between
branches. Because there are a large number of branches, a route reflector can
be used to reduce the number of MP-IBGP connections between PEs.
NOTE
Do not configure NHRP redirection on the Hub because LDP over mGRE does not need to
establish tunnels for direct communication between branches.
Procedure
Step 1 Configure interface IP addresses and OSPF on Hub-P and PE1 to implement
interconnection on the IP/MPLS backbone network.
# Configure PE1.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip address 172.1.1.1 24
[PE1-GigabitEthernet1/0/0] quit
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
The configuration of Hub-P is similar to that of PE1, and is not mentioned here.
After the configuration is complete, an OSPF neighbor relationship can be set up
between Hub-P and PE1. Run the display ospf peer command. You can see that
the neighbor status is Full. Run the display ip routing-table command. You can
see that Hub-P and PE1 have learnt the routes to Loopback1 of each other.
Step 2 Configure interface IP addresses and static routes on Hub-P, Spoke-PE2, and
Spoke-PE3 to ensure that public routes are reachable.
Because Hub-P, Spoke-PE2, and Spoke-PE3 are directly connected to the Internet,
IP addresses and default static routes are manually specified here.
# Configure Spoke-PE2.
<Huawei> system-view
[Huawei] sysname Spoke-PE2
[Spoke-PE2] interface gigabitethernet 1/0/0
[Spoke-PE2-GigabitEthernet1/0/0] ip address 202.2.1.2 24
[Spoke-PE2-GigabitEthernet1/0/0] quit
[Spoke-PE2] interface loopback 1
[Spoke-PE2-LoopBack1] ip address 2.2.2.9 32
[Spoke-PE2-LoopBack1] quit
[Spoke-PE2] ip route-static 0.0.0.0 0 202.2.1.1
The configurations of Spoke-PE3 and Hub-P are similar to that of Spoke-PE2, and
are not mentioned here.
After the configuration is complete, devices can ping each other and public routes
are reachable.
Step 3 Create tunnel interfaces and configure DSVPN on Hub-P, Spoke-PE2, and Spoke-
PE3.
1. Create an mGRE interface, configure an IP address, and specify a source
tunnel interface.
# Configure Spoke-PE2.
[Spoke-PE2] interface tunnel 0/0/1
[Spoke-PE2-Tunnel0/0/1] ip address 172.10.1.2 24
[Spoke-PE2-Tunnel0/0/1] tunnel-protocol gre p2mp
[Spoke-PE2-Tunnel0/0/1] source gigabitethernet 1/0/0
[Spoke-PE2-Tunnel0/0/1] quit
The configurations of Spoke-PE3 and Hub-P are similar to that of Spoke-PE2,
and are not mentioned here.
2. Configure OSPF to advertise the MPLS LSR ID as DSVPN subnet information
through the tunnel interface.
# Configure Spoke-PE2.
[Spoke-PE2] ospf 1
[Spoke-PE2-ospf-1] area 0
[Spoke-PE2-ospf-1-area-0.0.0.0] network 2.2.2.9 0.0.0.0
[Spoke-PE2-ospf-1-area-0.0.0.0] network 172.10.1.0 0.0.0.255
[Spoke-PE2-ospf-1-area-0.0.0.0] quit
[Spoke-PE2-ospf-1] quit
The configurations of Spoke-PE3 and Hub-P are similar to that of Spoke-PE2,
and are not mentioned here.
3. Configure NHRP and set the OSPF network type to P2MP. Do not configure
NHRP redirection on the Hub-P.
# Configure Hub-P.
[Hub-P] interface tunnel 0/0/1
[Hub-P-Tunnel0/0/1] nhrp entry multicast dynamic
[Hub-P-Tunnel0/0/1] ospf network-type p2mp
[Hub-P-Tunnel0/0/1] ospf dr-priority 100
[Hub-P-Tunnel0/0/1] quit
# Configure Spoke-PE2.
[Spoke-PE2] interface tunnel 0/0/1
[Spoke-PE2-Tunnel0/0/1] nhrp entry 172.10.1.1 202.1.1.2 register
# Configure Spoke-PE3.
[Spoke-PE3] interface tunnel 0/0/1
[Spoke-PE3-Tunnel0/0/1] nhrp entry 172.10.1.1 202.1.1.2 register
[Spoke-PE3-Tunnel0/0/1] ospf network-type p2mp
[Spoke-PE3-Tunnel0/0/1] ospf dr-priority 0
[Spoke-PE3-Tunnel0/0/1] quit
After the configuration is complete, run the display nhrp peer all command on
Hub-P to view registration information about Spoke-PE2 and Spoke-PE3.
[Hub] display nhrp peer all
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
172.10.1.2 32 202.2.1.2 172.10.1.2 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/1
Created time : 00:02:36
Expire time : 01:57:24
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
172.10.1.3 32 202.3.1.2 172.10.1.3 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/1
Created time : 00:00:04
Expire time : 01:59:56
Step 4 Enable basic MPLS functions and MPLS LDP on Spoke-PE2, Spoke-PE3, Hub-P, and
PE1.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.9
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
The configurations of Spoke-PE2, Spoke-PE3 and Hub-P are similar to that of PE1,
and are not mentioned here.
Step 5 Enable MPLS LDP on the interfaces of Spoke-PE2, Spoke-PE3, Hub-P, and PE1.
Enable MPLS LDP on interfaces of Hub-P and PE1 that are directly connected to
each other and enable MPLS LDP on tunnel interfaces of Spoke-PE2, Spoke-PE3
and Hub-P to establish MPLS LSP tunnels.
# Configure PE1.
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] mpls
[PE1-GigabitEthernet1/0/0] mpls ldp
[PE1-GigabitEthernet1/0/0] quit
# Configure Hub-P.
# Configure Spoke-PE2.
[Spoke-PE2] interface tunnel 0/0/1
[Spoke-PE2-Tunnel0/0/1] mpls
[Spoke-PE2-Tunnel0/0/1] mpls ldp
[Spoke-PE2-Tunnel0/0/1] quit
# Configure Spoke-PE3.
[Spoke-PE3] interface tunnel 0/0/1
[Spoke-PE3-Tunnel0/0/1] mpls
[Spoke-PE3-Tunnel0/0/1] mpls ldp
[Spoke-PE3-Tunnel0/0/1] quit
After the configuration is complete, PE1, Spoke-PE2, and Spoke-PE3 can establish
LDP sessions with Hub-P. Run the display mpls ldp session command. You can
see that the MPLS LDP session status is Operational.
Step 6 Configure VPN instances on Spoke-PE2, Spoke-PE3, and PE1 and bind VPN
instances to interfaces.
# Configure PE1.
[PE1] ip vpn-instance vpn1
[PE1-vpn-instance-vpn1] ipv4-family
[PE1-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpn1-af-ipv4] vpn-target 111:1 both
[PE1-vpn-instance-vpn1-af-ipv4] quit
[PE1-vpn-instance-vpn1] quit
[PE1] ip vpn-instance vpn2
[PE1-vpn-instance-vpn2] ipv4-family
[PE1-vpn-instance-vpn2-af-ipv4] route-distinguisher 100:2
[PE1-vpn-instance-vpn2-af-ipv4] vpn-target 222:2 both
[PE1-vpn-instance-vpn2-af-ipv4] quit
[PE1-vpn-instance-vpn2] quit
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[PE1-GigabitEthernet2/0/0] ip address 192.168.1.1 24
[PE1-GigabitEthernet2/0/0] quit
[PE1] interface gigabitethernet 3/0/0
[PE1-GigabitEthernet3/0/0] ip binding vpn-instance vpn2
[PE1-GigabitEthernet3/0/0] ip address 192.168.2.1 24
[PE1-GigabitEthernet3/0/0] quit
# Configure Spoke-PE2.
[Spoke-PE2] ip vpn-instance vpn1
[Spoke-PE2-vpn-instance-vpn1] ipv4-family
[Spoke-PE2-vpn-instance-vpn1-af-ipv4] route-distinguisher 200:1
[Spoke-PE2-vpn-instance-vpn1-af-ipv4] vpn-target 111:1 both
[Spoke-PE2-vpn-instance-vpn1-af-ipv4] quit
[Spoke-PE2-vpn-instance-vpn1] quit
[Spoke-PE2] ip vpn-instance vpn2
[Spoke-PE2-vpn-instance-vpn2] ipv4-family
[Spoke-PE2-vpn-instance-vpn2-af-ipv4] route-distinguisher 200:2
[Spoke-PE2-vpn-instance-vpn2-af-ipv4] vpn-target 222:2 both
[Spoke-PE2-vpn-instance-vpn2-af-ipv4] quit
[Spoke-PE2-vpn-instance-vpn2] quit
[Spoke-PE2] interface gigabitethernet 2/0/0
[Spoke-PE2-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
# Configure Spoke-PE3.
[Spoke-PE3] ip vpn-instance vpn1
[Spoke-PE3-vpn-instance-vpn1] ipv4-family
[Spoke-PE3-vpn-instance-vpn1-af-ipv4] route-distinguisher 300:1
[Spoke-PE3-vpn-instance-vpn1-af-ipv4] vpn-target 111:1 both
[Spoke-PE3-vpn-instance-vpn1-af-ipv4] quit
[Spoke-PE3-vpn-instance-vpn1] quit
[Spoke-PE3] ip vpn-instance vpn2
[Spoke-PE3-vpn-instance-vpn2] ipv4-family
[Spoke-PE3-vpn-instance-vpn2-af-ipv4] route-distinguisher 300:2
[Spoke-PE3-vpn-instance-vpn2-af-ipv4] vpn-target 222:2 both
[Spoke-PE3-vpn-instance-vpn2-af-ipv4] quit
[Spoke-PE3-vpn-instance-vpn2] quit
[Spoke-PE3] interface gigabitethernet 2/0/0
[Spoke-PE3-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[Spoke-PE3-GigabitEthernet2/0/0] ip address 192.168.21.1 24
[Spoke-PE3-GigabitEthernet2/0/0] quit
[Spoke-PE3] interface gigabitethernet 3/0/0
[Spoke-PE3-GigabitEthernet3/0/0] ip binding vpn-instance vpn2
[Spoke-PE3-GigabitEthernet3/0/0] ip address 192.168.22.1 24
[Spoke-PE3-GigabitEthernet3/0/0] quit
# Configure Spoke-PE2.
[Spoke-PE2] bgp 100
[Spoke-PE2-bgp] peer 1.1.1.9 as-number 100
[Spoke-PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[Spoke-PE2-bgp] ipv4-family vpnv4
[Spoke-PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[Spoke-PE2-bgp-af-vpnv4] quit
# Configure Spoke-PE3.
[Spoke-PE3] bgp 100
[Spoke-PE3-bgp] peer 1.1.1.9 as-number 100
[Spoke-PE3-bgp] peer 1.1.1.9 connect-interface loopback 1
[Spoke-PE3-bgp] ipv4-family vpnv4
[Spoke-PE3-bgp-af-vpnv4] peer 1.1.1.9 enable
[Spoke-PE3-bgp-af-vpnv4] quit
[Spoke-PE3-bgp] ipv4-family vpn-instance vpn1
[Spoke-PE3-bgp-vpn1] import-route direct
[Spoke-PE3-bgp-vpn1] quit
[Spoke-PE3-bgp] ipv4-family vpn-instance vpn2
[Spoke-PE3-bgp-vpn2] import-route direct
[Spoke-PE3-bgp-vpn2] quit
[Spoke-PE3-bgp] quit
After the configuration is complete, run the display bgp vpnv4 all peer command
on Spoke-PE2, Spoke-PE3, and PE1. You can see that Spoke-PE2, Spoke-PE3, and
PE1 have set up BGP peer relationships with PE1 and are in Established state.
The display on PE1 is used as an example:
[PE1] display bgp vpnv4 all peer
# Devices in the same VPN can successfully ping each other, whereas devices in
different VPNs cannot.
# The display on Spoke-PE2 is used as an example:
[Spoke-PE2] ping -vpn-instance vpn1 -a 192.168.11.1 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=254 time=10 ms
Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms
Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=254 time=1 ms
Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=254 time=1 ms
Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=254 time=1 ms
----End
Configuration Files
NOTE
This example does not provide configuration files of devices on the Internet.
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpn2
ipv4-family
route-distinguisher 100:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 172.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet3/0/0
ip binding vpn-instance vpn2
ip address 192.168.2.1 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
group rr1 internal
peer rr1 connect-interface LoopBack1
peer 2.2.2.9 as-number 100
peer 2.2.2.9 group rr1
peer 3.3.3.9 as-number 100
peer 3.3.3.9 group rr1
#
ipv4-family unicast
undo synchronization
peer rr1 enable
peer 2.2.2.9 enable
peer 2.2.2.9 group rr1
peer 3.3.3.9 enable
peer 3.3.3.9 group rr1
#
ipv4-family vpnv4
reflector cluster-id 100
undo policy vpn-target
peer rr1 enable
peer rr1 reflect-client
peer 2.2.2.9 enable
peer 2.2.2.9 group rr1
peer 3.3.3.9 enable
peer 3.3.3.9 group rr1
#
ipv4-family vpn-instance vpn1
import-route direct
#
ipv4-family vpn-instance vpn2
import-route direct
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● Hub-P configuration file
#
sysname Hub-P
#
mpls lsr-id 4.4.4.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 202.1.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 4.4.4.9 255.255.255.255
#
interface Tunnel0/0/1
ip address 172.10.1.1 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet1/0/0
ospf network-type p2mp
ospf dr-priority 100
mpls
mpls ldp
nhrp entry multicast dynamic
#
ospf 1
area 0.0.0.0
network 4.4.4.9 0.0.0.0
network 172.1.1.0 0.0.0.255
network 172.10.1.0 0.0.0.255
#
ip route-static 0.0.0.0 0.0.0.0 202.1.1.1
#
return
● Spoke-PE2 configuration file
#
sysname Spoke-PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 200:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpn2
ipv4-family
route-distinguisher 200:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 202.2.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 192.168.11.1 255.255.255.0
#
interface GigabitEthernet3/0/0
ip binding vpn-instance vpn2
ip address 192.168.12.1 255.255.255.0
#
interface LoopBack1
ip address 2.2.2.9 255.255.255.255
#
interface Tunnel0/0/1
ip address 172.10.1.2 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet1/0/0
ospf network-type p2mp
ospf dr-priority 0
mpls
mpls ldp
nhrp entry 172.10.1.1 202.1.1.2 register
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpn1
import-route direct
#
ipv4-family vpn-instance vpn2
import-route direct
#
ospf 1
area 0.0.0.0
network 2.2.2.9 0.0.0.0
network 172.10.1.0 0.0.0.255
#
ip route-static 0.0.0.0 0.0.0.0 202.2.1.1
#
return
● Spoke-PE3 configuration file
#
sysname Spoke-PE3
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 300:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpn2
ipv4-family
route-distinguisher 300:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 3.3.3.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 202.3.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 192.168.21.1 255.255.255.0
#
interface GigabitEthernet3/0/0
ip binding vpn-instance vpn2
ip address 192.168.22.1 255.255.255.0
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
interface Tunnel0/0/1
ip address 172.10.1.3 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet1/0/0
Figure 7-65 Networking diagram for configuring L3VPN with LDP signals carried
by DSVPN and protected by IPSec
Enterprise
branch1
Loopback1 Loopback1
vpn 2.2.2.9/32 1.1.1.9/32 vpn
1 1
GE2 Spoke-PE2 /0/0
/0/0 GE2
Tunnel0/0/1 PE1
172.10.1.2/24
GR GE 3
vpn /0 /0 ET GE1/0/0 /0/0 vpn
GE3 un 2
2 GE1/0/0 ne
l
IPS
ec
GE2/0/0
Loopback1
Internet GE1/0/0 4.4.4.9/32
Hub-P
ec
IPS
vpn Tunnel0/0/1
GE1/0/0 n el 172.10.1.1/24
1 GE2 un
/0/0 ET
GR
Tunnel0/0/1
172.10.1.3/24
vpn /0/0 Enterprise
GE3 Spoke-PE3
headquarters
2
Loopback1
Enterprise 3.3.3.9/32
branch2
Spoke-PE3 Hub-P
192. G
168. E2/0/0
21.1
/24
GE1/0/0 GE2/0/0
202.3.1.2/24 172.1.1.2/24
/0 /0
G E 3 /2 4 Spoke-PE3
2. 1
.1 6 8 .2 GE1/0/0
1 92 202.1.1.2/24
Hub-P
Configuration Roadmap
To expand the IP/MPLS backbone network and deploy BGP/MPLS IP VPN for an
enterprise, you need to add the Spoke-PE devices in the branches to the IP/MPLS
backbone network in the headquarters. MPLS LDP packets between the
headquarters and branches need to be transmitted over GRE tunnels because the
Internet cannot provide the MPLS function. As there are a large number of
branches and devices in the branches dynamically obtain their public addresses,
DSVPN is used to establish GRE tunnels between the headquarters and branches.
In addition, IPSec is required to encrypt and protect VPN data transmitted over the
Internet. As a result, L3VPN with LDP signals carried by DSVPN and protected by
IPSec can meet the requirements of the enterprise.
The configuration roadmap for L3VPN with LDP signals carried by DSVPN and
protected by IPSec is as follows:
1. Configure branch devices to save only summarized routes to the
headquarters, configure OSPF on Hub-P and Spoke-PEs to advertise routes,
and set the OSPF network type to point-to-multipoint (P2MP), so that all VPN
data between branches is forwarded by the headquarters.
2. Configure IPSec on Spoke-PE2, Spoke-PE3, and Hub-P and apply IPSec profiles
to tunnel interfaces to encrypt and protect VPN data between branches.
3. Enable MPLS LDP on tunnel interfaces of Spoke-PE2, Spoke-PE3, and Hub-P
and set up MPLS LSP tunnels to implement LDP over mGRE.
4. Configure L3VPN on Spoke-PE2, Spoke-PE3, and PE1 to implement secure
interconnection between the headquarters and branches and between
branches. Because there are a large number of branches, a route reflector can
be used to reduce the number of MP-IBGP connections between PEs.
NOTE
Do not configure NHRP redirection on the Hub because LDP over mGRE does not need to
establish tunnels for direct communication between branches.
Procedure
Step 1 Configure interface IP addresses and OSPF on Hub-P and PE1 to implement
interconnection on the IP/MPLS backbone network.
# Configure PE1.
<Huawei> system-view
[Huawei] sysname PE1
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] ip address 172.1.1.1 24
[PE1-GigabitEthernet1/0/0] quit
[PE1] interface loopback 1
[PE1-LoopBack1] ip address 1.1.1.9 32
[PE1-LoopBack1] quit
[PE1] ospf 1
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
The configuration of Hub-P is similar to that of PE1, and is not mentioned here.
After the configuration is complete, an OSPF neighbor relationship can be set up
between Hub-P and PE1. Run the display ospf peer command. You can see that
the neighbor status is Full. Run the display ip routing-table command. You can
see that Hub-P and PE1 have learnt the routes to Loopback1 of each other.
Step 2 Configure interface IP addresses and static routes on Hub-P, Spoke-PE2, and
Spoke-PE3 to ensure that public routes are reachable.
Because Hub-P, Spoke-PE2, and Spoke-PE3 are directly connected to the Internet,
IP addresses and default static routes are manually specified here.
# Configure Spoke-PE2.
<Huawei> system-view
[Huawei] sysname Spoke-PE2
[Spoke-PE2] interface gigabitethernet 1/0/0
[Spoke-PE2-GigabitEthernet1/0/0] ip address 202.2.1.2 24
[Spoke-PE2-GigabitEthernet1/0/0] quit
[Spoke-PE2] interface loopback 1
[Spoke-PE2-LoopBack1] ip address 2.2.2.9 32
[Spoke-PE2-LoopBack1] quit
[Spoke-PE2] ip route-static 0.0.0.0 0 202.2.1.1
The configurations of Spoke-PE3 and Hub-P are similar to that of Spoke-PE2, and
are not mentioned here.
After the configuration is complete, devices can ping each other and public routes
are reachable.
Step 3 Create tunnel interfaces and configure DSVPN on Hub-P, Spoke-PE2, and Spoke-
PE3.
1. Create an mGRE interface, configure an IP address, and specify a source
tunnel interface.
# Configure Spoke-PE2.
[Spoke-PE2] interface tunnel 0/0/1
[Spoke-PE2-Tunnel0/0/1] ip address 172.10.1.2 24
[Spoke-PE2-Tunnel0/0/1] tunnel-protocol gre p2mp
[Spoke-PE2-Tunnel0/0/1] source gigabitethernet 1/0/0
[Spoke-PE2-Tunnel0/0/1] quit
# Configure Spoke-PE2.
[Spoke-PE2] interface tunnel 0/0/1
[Spoke-PE2-Tunnel0/0/1] nhrp entry 172.10.1.1 202.1.1.2 register
[Spoke-PE2-Tunnel0/0/1] ospf network-type p2mp
[Spoke-PE2-Tunnel0/0/1] ospf dr-priority 0
[Spoke-PE2-Tunnel0/0/1] quit
# Configure Spoke-PE3.
[Spoke-PE3] interface tunnel 0/0/1
[Spoke-PE3-Tunnel0/0/1] nhrp entry 172.10.1.1 202.1.1.2 register
[Spoke-PE3-Tunnel0/0/1] ospf network-type p2mp
[Spoke-PE3-Tunnel0/0/1] ospf dr-priority 0
[Spoke-PE3-Tunnel0/0/1] quit
After the configuration is complete, run the display nhrp peer all command on
Hub-P to view registration information about Spoke-PE2 and Spoke-PE3.
[Hub] display nhrp peer all
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
172.10.1.2 32 202.2.1.2 172.10.1.2 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/1
Created time : 00:02:36
Expire time : 01:57:24
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
172.10.1.3 32 202.3.1.2 172.10.1.3 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/1
Created time : 00:00:04
Expire time : 01:59:56
Configure IPSec on the devices and bind IPSec profiles to the tunnel interfaces.
# Configure Hub-P.
[Hub-P] ipsec proposal pro1
[Hub-P-ipsec-proposal-pro1] transform ah-esp
[Hub-P-ipsec-proposal-pro1] ah authentication-algorithm sha2-512
[Hub-P-ipsec-proposal-pro1] esp authentication-algorithm sha2-512
[Hub-P-ipsec-proposal-pro1] esp encryption-algorithm aes-256
[Hub-P-ipsec-proposal-pro1] quit
[Hub-P] ike proposal 1
[Hub-P-ike-proposal-1] dh group5
[Hub-P-ike-proposal-1] authentication-algorithm aes-xcbc-mac-96
[Hub-P-ike-proposal-1] prf aes-xcbc-128
[Hub-P-ike-proposal-1] quit
[Hub-P] ike peer Hub-P v2
[Hub-P-ike-peer-Hub-P] ike-proposal 1
[Hub-P-ike-peer-Hub-P] pre-shared-key cipher huawei
[Hub-P-ike-peer-Hub-P] quit
[Hub-P] ipsec profile profile1
[Hub-P-ipsec-profile-profile1] proposal pro1
[Hub-P-ipsec-profile-profile1] ike-peer Hub-P
[Hub-P-ipsec-profile-profile1] quit
[Hub-P] interface tunnel 0/0/1
The configurations of Spoke-PE2 and Spoke-PE3 are similar to that of Hub-P, and
are not mentioned here.
After the configuration is complete, run the display ipsec sa command on Spoke-
PE2, Spoke-PE3, and Hub-P. You can see that security associations (SAs) have been
established.
Step 5 Enable basic MPLS functions and MPLS LDP on Spoke-PE2, Spoke-PE3, Hub-P, and
PE1.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.9
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
The configurations of Spoke-PE2, Spoke-PE3 and Hub-P are similar to that of PE1,
and are not mentioned here.
Step 6 Enable MPLS LDP on the interfaces of Spoke-PE2, Spoke-PE3, Hub-P, and PE1.
Enable MPLS LDP on interfaces of Hub-P and PE1 that are directly connected to
each other and enable MPLS LDP on tunnel interfaces of Spoke-PE2, Spoke-PE3
and Hub-P to establish MPLS LSP tunnels.
# Configure PE1.
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] mpls
[PE1-GigabitEthernet1/0/0] mpls ldp
[PE1-GigabitEthernet1/0/0] quit
# Configure Hub-P.
[Hub-P] interface gigabitethernet 2/0/0
[Hub-P-GigabitEthernet2/0/0] mpls
[Hub-P-GigabitEthernet2/0/0] mpls ldp
[Hub-P-GigabitEthernet2/0/0] quit
[Hub-P] interface tunnel 0/0/1
[Hub-P-Tunnel0/0/1] mpls
[Hub-P-Tunnel0/0/1] mpls ldp
[Hub-P-Tunnel0/0/1] quit
# Configure Spoke-PE2.
[Spoke-PE2] interface tunnel 0/0/1
[Spoke-PE2-Tunnel0/0/1] mpls
[Spoke-PE2-Tunnel0/0/1] mpls ldp
[Spoke-PE2-Tunnel0/0/1] quit
# Configure Spoke-PE3.
[Spoke-PE3] interface tunnel 0/0/1
[Spoke-PE3-Tunnel0/0/1] mpls
[Spoke-PE3-Tunnel0/0/1] mpls ldp
[Spoke-PE3-Tunnel0/0/1] quit
After the configuration is complete, PE1, Spoke-PE2, and Spoke-PE3 can establish
LDP sessions with Hub-P. Run the display mpls ldp session command. You can
see that the MPLS LDP session status is Operational.
Step 7 Configure VPN instances on Spoke-PE2, Spoke-PE3, and PE1 and bind VPN
instances to interfaces.
# Configure PE1.
[PE1] ip vpn-instance vpn1
[PE1-vpn-instance-vpn1] ipv4-family
[PE1-vpn-instance-vpn1-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpn1-af-ipv4] vpn-target 111:1 both
[PE1-vpn-instance-vpn1-af-ipv4] quit
[PE1-vpn-instance-vpn1] quit
[PE1] ip vpn-instance vpn2
[PE1-vpn-instance-vpn2] ipv4-family
[PE1-vpn-instance-vpn2-af-ipv4] route-distinguisher 100:2
[PE1-vpn-instance-vpn2-af-ipv4] vpn-target 222:2 both
[PE1-vpn-instance-vpn2-af-ipv4] quit
[PE1-vpn-instance-vpn2] quit
[PE1] interface gigabitethernet 2/0/0
[PE1-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[PE1-GigabitEthernet2/0/0] ip address 192.168.1.1 24
[PE1-GigabitEthernet2/0/0] quit
[PE1] interface gigabitethernet 3/0/0
[PE1-GigabitEthernet3/0/0] ip binding vpn-instance vpn2
[PE1-GigabitEthernet3/0/0] ip address 192.168.2.1 24
[PE1-GigabitEthernet3/0/0] quit
# Configure Spoke-PE2.
[Spoke-PE2] ip vpn-instance vpn1
[Spoke-PE2-vpn-instance-vpn1] ipv4-family
[Spoke-PE2-vpn-instance-vpn1-af-ipv4] route-distinguisher 200:1
[Spoke-PE2-vpn-instance-vpn1-af-ipv4] vpn-target 111:1 both
[Spoke-PE2-vpn-instance-vpn1-af-ipv4] quit
[Spoke-PE2-vpn-instance-vpn1] quit
[Spoke-PE2] ip vpn-instance vpn2
[Spoke-PE2-vpn-instance-vpn2] ipv4-family
[Spoke-PE2-vpn-instance-vpn2-af-ipv4] route-distinguisher 200:2
[Spoke-PE2-vpn-instance-vpn2-af-ipv4] vpn-target 222:2 both
[Spoke-PE2-vpn-instance-vpn2-af-ipv4] quit
[Spoke-PE2-vpn-instance-vpn2] quit
[Spoke-PE2] interface gigabitethernet 2/0/0
[Spoke-PE2-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[Spoke-PE2-GigabitEthernet2/0/0] ip address 192.168.11.1 24
[Spoke-PE2-GigabitEthernet2/0/0] quit
[Spoke-PE2] interface gigabitethernet 3/0/0
[Spoke-PE2-GigabitEthernet3/0/0] ip binding vpn-instance vpn2
[Spoke-PE2-GigabitEthernet3/0/0] ip address 192.168.12.1 24
[Spoke-PE2-GigabitEthernet3/0/0] quit
# Configure Spoke-PE3.
[Spoke-PE3] ip vpn-instance vpn1
[Spoke-PE3-vpn-instance-vpn1] ipv4-family
[Spoke-PE3-vpn-instance-vpn1-af-ipv4] route-distinguisher 300:1
[Spoke-PE3-vpn-instance-vpn1-af-ipv4] vpn-target 111:1 both
[Spoke-PE3-vpn-instance-vpn1-af-ipv4] quit
[Spoke-PE3-vpn-instance-vpn1] quit
[Spoke-PE3] ip vpn-instance vpn2
[Spoke-PE3-vpn-instance-vpn2] ipv4-family
[Spoke-PE3-vpn-instance-vpn2-af-ipv4] route-distinguisher 300:2
[Spoke-PE3-vpn-instance-vpn2-af-ipv4] vpn-target 222:2 both
[Spoke-PE3-vpn-instance-vpn2-af-ipv4] quit
[Spoke-PE3-vpn-instance-vpn2] quit
[Spoke-PE3] interface gigabitethernet 2/0/0
[Spoke-PE3-GigabitEthernet2/0/0] ip binding vpn-instance vpn1
[Spoke-PE3-GigabitEthernet2/0/0] ip address 192.168.21.1 24
[Spoke-PE3-GigabitEthernet2/0/0] quit
[Spoke-PE3] interface gigabitethernet 3/0/0
[Spoke-PE3-GigabitEthernet3/0/0] ip binding vpn-instance vpn2
# Configure Spoke-PE2.
[Spoke-PE2] bgp 100
[Spoke-PE2-bgp] peer 1.1.1.9 as-number 100
[Spoke-PE2-bgp] peer 1.1.1.9 connect-interface loopback 1
[Spoke-PE2-bgp] ipv4-family vpnv4
[Spoke-PE2-bgp-af-vpnv4] peer 1.1.1.9 enable
[Spoke-PE2-bgp-af-vpnv4] quit
[Spoke-PE2-bgp] ipv4-family vpn-instance vpn1
[Spoke-PE2-bgp-vpn1] import-route direct
[Spoke-PE2-bgp-vpn1] quit
[Spoke-PE2-bgp] ipv4-family vpn-instance vpn2
[Spoke-PE2-bgp-vpn2] import-route direct
[Spoke-PE2-bgp-vpn2] quit
[Spoke-PE2-bgp] quit
# Configure Spoke-PE3.
[Spoke-PE3] bgp 100
[Spoke-PE3-bgp] peer 1.1.1.9 as-number 100
[Spoke-PE3-bgp] peer 1.1.1.9 connect-interface loopback 1
[Spoke-PE3-bgp] ipv4-family vpnv4
[Spoke-PE3-bgp-af-vpnv4] peer 1.1.1.9 enable
[Spoke-PE3-bgp-af-vpnv4] quit
[Spoke-PE3-bgp] ipv4-family vpn-instance vpn1
[Spoke-PE3-bgp-vpn1] import-route direct
[Spoke-PE3-bgp-vpn1] quit
[Spoke-PE3-bgp] ipv4-family vpn-instance vpn2
[Spoke-PE3-bgp-vpn2] import-route direct
[Spoke-PE3-bgp-vpn2] quit
[Spoke-PE3-bgp] quit
After the configuration is complete, run the display bgp vpnv4 all peer command
on Spoke-PE2, Spoke-PE3, and PE1. You can see that Spoke-PE2, Spoke-PE3, and
PE1 have set up BGP peer relationships with PE1 and are in Established state.
# Devices in the same VPN can successfully ping each other, whereas devices in
different VPNs cannot.
# The display on Spoke-PE2 is used as an example:
[Spoke-PE2] ping -vpn-instance vpn1 -a 192.168.11.1 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=254 time=10 ms
Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms
Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=254 time=1 ms
Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=254 time=1 ms
Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=254 time=1 ms
----End
Configuration Files
NOTE
This example does not provide configuration files of devices on the Internet.
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 100:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpn2
ipv4-family
route-distinguisher 100:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 1.1.1.9
mpls
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 172.1.1.1 255.255.255.0
mpls
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet3/0/0
ip binding vpn-instance vpn2
ip address 192.168.2.1 255.255.255.0
#
interface LoopBack1
ip address 1.1.1.9 255.255.255.255
#
bgp 100
group rr1 internal
peer rr1 connect-interface LoopBack1
peer 2.2.2.9 as-number 100
peer 2.2.2.9 group rr1
peer 3.3.3.9 as-number 100
peer 3.3.3.9 group rr1
#
ipv4-family unicast
undo synchronization
peer rr1 enable
peer 2.2.2.9 enable
peer 2.2.2.9 group rr1
peer 3.3.3.9 enable
peer 3.3.3.9 group rr1
#
ipv4-family vpnv4
reflector cluster-id 100
undo policy vpn-target
peer rr1 enable
peer rr1 reflect-client
peer 2.2.2.9 enable
peer 2.2.2.9 group rr1
peer 3.3.3.9 enable
peer 3.3.3.9 group rr1
#
ipv4-family vpn-instance vpn1
import-route direct
#
ipv4-family vpn-instance vpn2
import-route direct
#
ospf 1
area 0.0.0.0
network 1.1.1.9 0.0.0.0
network 172.1.1.0 0.0.0.255
#
return
● Hub-P configuration file
#
sysname Hub-P
#
mpls lsr-id 4.4.4.9
mpls
#
mpls ldp
#
ipsec proposal pro1
transform ah-esp
ah authentication-algorithm sha2-512
esp authentication-algorithm sha2-512
esp encryption-algorithm aes-256
#
ike proposal 1
dh group5
authentication-algorithm aes-xcbc-mac-96
prf aes-xcbc-128
#
ike peer Hub-P v2
pre-shared-key cipher %^%#JvZxR2g8c;a9~FPN~n'$7`DEV&=G(=Et02P/%\*!%^%#
ike-proposal 1
#
ipsec profile profile1
ike-peer Hub-P
proposal pro1
#
interface GigabitEthernet1/0/0
ip address 202.1.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 172.1.1.2 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 4.4.4.9 255.255.255.255
#
interface Tunnel0/0/1
ip address 172.10.1.1 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet1/0/0
ospf network-type p2mp
ospf dr-priority 100
ipsec profile profile1
mpls
mpls ldp
nhrp entry multicast dynamic
#
ospf 1
area 0.0.0.0
network 4.4.4.9 0.0.0.0
network 172.1.1.0 0.0.0.255
network 172.10.1.0 0.0.0.255
#
ip route-static 0.0.0.0 0.0.0.0 202.1.1.1
#
return
● Spoke-PE2 configuration file
#
sysname Spoke-PE2
#
ip vpn-instance vpn1
ipv4-family
route-distinguisher 200:1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpn2
ipv4-family
route-distinguisher 200:2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 2.2.2.9
mpls
#
mpls ldp
#
ipsec proposal pro1
transform ah-esp
ah authentication-algorithm sha2-512
esp authentication-algorithm sha2-512
esp encryption-algorithm aes-256
#
ike proposal 1
dh group5
authentication-algorithm aes-xcbc-mac-96
prf aes-xcbc-128
#
ike peer Spoke-PE2 v2
pre-shared-key cipher %^%#K{JG:rWVHPMnf;5\|,GW(Luq'qi8BT4nOj%5W5=)%^%#
ike-proposal 1
#
ipsec profile profile1
ike-peer Spoke-PE2
proposal pro1
#
interface GigabitEthernet1/0/0
ip address 202.2.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 192.168.11.1 255.255.255.0
#
interface GigabitEthernet3/0/0
ip binding vpn-instance vpn2
ike proposal 1
dh group5
authentication-algorithm aes-xcbc-mac-96
prf aes-xcbc-128
#
ike peer Spoke-PE3 v2
pre-shared-key cipher %^%#IRFGEiFPJ1$&a'Qy,L*XQL_+*Grq-=yMb}ULZdS6%^%#
ike-proposal 1
#
ipsec profile profile1
ike-peer Spoke-PE3
proposal pro1
#
interface GigabitEthernet1/0/0
ip address 202.3.1.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpn1
ip address 192.168.21.1 255.255.255.0
#
interface GigabitEthernet3/0/0
ip binding vpn-instance vpn2
ip address 192.168.22.1 255.255.255.0
#
interface LoopBack1
ip address 3.3.3.9 255.255.255.255
#
interface Tunnel0/0/1
ip address 172.10.1.3 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet1/0/0
ospf network-type p2mp
ospf dr-priority 0
ipsec profile profile1
mpls
mpls ldp
nhrp entry 172.10.1.1 202.1.1.2 register
#
bgp 100
peer 1.1.1.9 as-number 100
peer 1.1.1.9 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.9 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.9 enable
#
ipv4-family vpn-instance vpn1
import-route direct
#
ipv4-family vpn-instance vpn2
import-route direct
#
ospf 1
area 0.0.0.0
network 3.3.3.9 0.0.0.0
network 172.10.1.0 0.0.0.255
#
ip route-static 0.0.0.0 0.0.0.0 202.3.1.1
#
return
Figure 7-66 Networking diagram for configuring a tunnel policy for an L3VPN
Loopback1 Loopback1
3.3.3.3/32 5.5.5.5/32
vpna vpna
CE1 CE3
Loopback1 Loopback1
1.1.1.1/32 2.2.2.2/32
MPLS TE tunnel 1
GE1/0/0 GE1/0/0
10.1.1.1/30 10.3.1.1/30
GE2/0/0 MPLS TE tunnel 2 ( binding) GE2/0/0
10.1.1.2/30 10.3.1.2/30
GE1/0/0 GE1/0/0
GE3/0/0 GE3/0/0
100.1.1.1/30 100.1.1.2/30
10.2.1.2/30 PE1 PE2 10.4.1.2/30
GE1/0/0 GE1/0/0
10.2.1.1/30 LSP 10.4.1.1/30
CE2 CE4
vpnb vpnb
Loopback1 Loopback1
4.4.4.4/32 6.6.6.6/32
Configuration Roadmap
The configuration roadmap is as follows:
1. Configure a routing protocol so that PEs can communicate with each other.
2. Configure basic MPLS capabilities on the routers on the backbone network
and set up an LSP and two MPLS TE tunnels between the PEs.
3. Configure VPN instances on PEs and connect CEs to the PEs.
4. Configure tunnel policies and apply the policies to different VPN instances.
5. Configure MP-IBGP to exchange VPN routing information.
Procedure
Step 1 Configure an IGP on the MPLS backbone network so that PEs can communicate.
# Configure PE1.
<Huawei> system-view
[Huawei] sysname PE1
# Configure PE2.
<Huawei> system-view
[Huawei] sysname PE2
[PE2] interface loopback 1
[PE2-LoopBack1] ip address 2.2.2.2 32
[PE2-LoopBack1] quit
[PE2] interface gigabitethernet 1/0/0
[PE2-GigabitEthernet1/0/0] ip address 100.1.1.2 30
[PE2-GigabitEthernet1/0/0] quit
[PE2] ospf 1
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 100.1.1.0 0.0.0.3
[PE2-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
Step 2 Configure basic MPLS capabilities on the MPLS backbone to set up an LDP LSP
between PEs.
# Configure PE1.
[PE1] mpls lsr-id 1.1.1.1
[PE1] mpls
[PE1-mpls] quit
[PE1] mpls ldp
[PE1-mpls-ldp] quit
[PE1] interface gigabitethernet 1/0/0
[PE1-GigabitEthernet1/0/0] mpls
[PE1-GigabitEthernet1/0/0] mpls ldp
[PE1-GigabitEthernet1/0/0] quit
# Configure PE2.
# After the configuration is complete, an LDP LSP is set up between PE1 and PE2.
Run the display tunnel-info all command, and you can find the LSP destined for
the address 2.2.2.2. Run the display mpls ldp lsp command, and you can view LSP
information.
# The information displayed on PE1 is used as an example.
[PE1] display tunnel-info all
* -> Allocated VC Token
Tunnel ID Type Destination Token
----------------------------------------------------------------------
0x15 lsp 2.2.2.2 21
0x16 lsp 2.2.2.2 22
[PE1] display mpls ldp lsp
LDP LSP Information
-------------------------------------------------------------------------------
DestAddress/Mask In/OutLabel UpstreamPeer NextHop OutInterface
-------------------------------------------------------------------------------
1.1.1.1/32 3/NULL 2.2.2.2 127.0.0.1 InLoop0
*1.1.1.1/32 Liberal/16 DS/2.2.2.2
2.2.2.2/32 NULL/3 - 100.1.1.2 GE1/0/0
2.2.2.2/32 16/3 2.2.2.2 100.1.1.2 GE1/0/0
-------------------------------------------------------------------------------
TOTAL: 3 Normal LSP(s) Found.
TOTAL: 1 Liberal LSP(s) Found.
TOTAL: 0 Frr LSP(s) Found.
A '*' before an LSP means the LSP is not established
A '*' before a Label means the USCB or DSCB is stale
A '*' before a UpstreamPeer means the session is stale
A '*' before a DS means the session is stale
A '*' before a NextHop means the LSP is FRR LSP
# Configure PE2.
[PE2] mpls
[PE2-mpls] mpls te
[PE2-mpls] mpls rsvp-te
[PE2-mpls] mpls te cspf
[PE2-mpls] quit
[PE2] interface gigabitethernet1/0/0
[PE2-GigabitEthernet1/0/0] mpls te
[PE2-GigabitEthernet1/0/0] mpls rsvp-te
[PE2-GigabitEthernet1/0/0] quit
# Configure PE1.
[PE1] ospf 1
[PE1-ospf-1] opaque-capability enable
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] mpls-te enable
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# Configure PE2.
[PE2] ospf 1
[PE2-ospf-1] opaque-capability enable
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] mpls-te enable
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# Configure PE2.
[PE2] interface tunnel 0/0/1
[PE2-Tunnel0/0/1] ip address unnumbered interface loopback 1
[PE2-Tunnel0/0/1] tunnel-protocol mpls te
[PE2-Tunnel0/0/1] destination 1.1.1.1
[PE2-Tunnel0/0/1] mpls te tunnel-id 11
[PE2-Tunnel0/0/1] mpls te commit
[PE2-Tunnel0/0/1] quit
# Configure PE2.
[PE2] interface tunnel 0/0/2
[PE2-Tunnel0/0/2] ip address unnumbered interface loopback 1
[PE2-Tunnel0/0/2] tunnel-protocol mpls te
[PE2-Tunnel0/0/2] destination 1.1.1.1
[PE2-Tunnel0/0/2] mpls te tunnel-id 22
[PE2-Tunnel0/0/2] mpls te reserved-for-binding
[PE2-Tunnel0/0/2] mpls te commit
[PE2-Tunnel0/0/2] quit
Tunnel0/0/1
----------------------------------------------------------------
Tunnel State Desc : UP
Active LSP : Primary LSP
Session ID : 11
Ingress LSR ID : 1.1.1.1 Egress LSR ID: 2.2.2.2
Admin State : UP Oper State : UP
Primary LSP State : UP
Main LSP State : READY LSP ID : 1
----------------------------------------------------------------
Tunnel0/0/2
----------------------------------------------------------------
Tunnel State Desc : UP
Active LSP : Primary LSP
Session ID : 22
Ingress LSR ID : 1.1.1.1 Egress LSR ID: 2.2.2.2
Admin State : UP Oper State : UP
Primary LSP State : UP
Main LSP State : READY LSP ID : 2
Step 4 Configure VPN instances on PEs and bind the instances to the interfaces
connected to CEs.
# Configure PE1.
[PE1] ip vpn-instance vpna
[PE1-vpn-instance-vpna] ipv4-family
[PE1-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[PE1-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[PE1-vpn-instance-vpna-af-ipv4] quit
[PE1-vpn-instance-vpna] quit
[PE1] ip vpn-instance vpnb
[PE1-vpn-instance-vpnb] ipv4-family
[PE1-vpn-instance-vpnb-af-ipv4] route-distinguisher 100:2
[PE1-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 both
[PE1-vpn-instance-vpnb-af-ipv4] quit
[PE1-vpn-instance-vpnb] quit
[PE1] interface gigabitethernet2/0/0
[PE1-GigabitEthernet2/0/0] ip binding vpn-instance vpna
[PE1-GigabitEthernet2/0/0] ip address 10.1.1.2 30
[PE1-GigabitEthernet2/0/0] quit
[PE1] interface gigabitethernet 3/0/0
[PE1-GigabitEthernet3/0/0] ip binding vpn-instance vpnb
[PE1-GigabitEthernet3/0/0] ip address 10.2.1.2 30
[PE1-GigabitEthernet3/0/0] quit
# Configure PE2.
[PE2] ip vpn-instance vpna
[PE2-vpn-instance-vpna] ipv4-family
[PE2-vpn-instance-vpna-af-ipv4] route-distinguisher 100:3
[PE2-vpn-instance-vpna-af-ipv4] vpn-target 111:1 both
[PE2-vpn-instance-vpna-af-ipv4] quit
[PE2-vpn-instance-vpna] quit
[PE2] ip vpn-instance vpnb
[PE2-vpn-instance-vpnb] ipv4-family
[PE2-vpn-instance-vpnb-af-ipv4] route-distinguisher 100:4
[PE2-vpn-instance-vpnb-af-ipv4] vpn-target 222:2 both
[PE2-vpn-instance-vpnb-af-ipv4] quit
[PE2-vpn-instance-vpnb] quit
[PE2] interface gigabitethernet 2/0/0
[PE2-GigabitEthernet2/0/0] ip binding vpn-instance vpna
[PE2-GigabitEthernet2/0/0] ip address 10.3.1.2 30
[PE2-GigabitEthernet2/0/0] quit
[PE2] interface gigabitethernet 3/0/0
[PE2-GigabitEthernet3/0/0] ip binding vpn-instance vpnb
[PE2-GigabitEthernet3/0/0] ip address 10.4.1.2 30
[PE2-GigabitEthernet3/0/0] quit
# Assign IP addresses to the interfaces on the CEs according to Figure 7-66. The
configuration procedure is not provided here.
# After the configuration is complete, run the display ip vpn-instance verbose
command on PEs, and you can view configuration of the VPN instances.
NOTE
If a PE has multiple interfaces bound to the same VPN, when you run the ping command to
ping the CE connected to the remote PE, specify the source IP address; that is, specify -a
source-ip-address in the ping -a source-ip-address -vpn-instance vpn-instance-name
destination-address command. Otherwise, the ping fails.
# Configure PE2.
[PE2] tunnel-policy policy1
[PE2-tunnel-policy-policy1] tunnel binding destination 1.1.1.1 te tunnel 0/0/2
[PE2-tunnel-policy-policy1] quit
[PE2] ip vpn-instance vpna
[PE2-vpn-instance-vpna] ipv4-family
[PE2-vpn-instance-vpna-af-ipv4] tnl-policy policy1
[PE2-vpn-instance-vpna-af-ipv4] quit
[PE2-vpn-instance-vpna] quit
# Configure a tunnel type prioritizing policy and apply the policy to vpnb.
# Configure PE1.
[PE1] tunnel-policy policy2
[PE1-tunnel-policy-policy2] tunnel select-seq cr-lsp lsp load-balance-number 2
[PE1-tunnel-policy-policy2] quit
[PE1] ip vpn-instance vpnb
[PE1-vpn-instance-vpnb] ipv4-family
[PE1-vpn-instance-vpnb-af-ipv4] tnl-policy policy2
[PE1-vpn-instance-vpnb-af-ipv4] quit
[PE1-vpn-instance-vpnb] quit
# Configure PE2.
[PE2] tunnel-policy policy2
[PE2-tunnel-policy-policy2] tunnel select-seq cr-lsp lsp load-balance-number 2
[PE2-tunnel-policy-policy2] quit
[PE2] ip vpn-instance vpnb
[PE2-vpn-instance-vpnb] ipv4-family
[PE2-vpn-instance-vpnb-af-ipv4] tnl-policy policy2
[PE2-vpn-instance-vpnb-af-ipv4] quit
[PE2-vpn-instance-vpnb] quit
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] peer 1.1.1.1 as-number 100
[PE2-bgp] peer 1.1.1.1 connect-interface loopback 1
[PE2-bgp] ipv4-family vpnv4
[PE2-bgp-af-vpnv4] peer 1.1.1.1 enable
[PE2-bgp-af-vpnv4] quit
# After the configuration is complete, run the display bgp peer or display bgp
vpnv4 all peer command on the PEs. The command output shows that a BGP
peer relationship is set up between PEs and the BGP peer relationship is in
Established state.
Step 7 Set up EBGP peer relationships between PEs and CEs.
# Configure PE1.
[PE1] bgp 100
[PE1-bgp] ipv4-family vpn-instance vpna
[PE1-bgp-af-vpna] peer 10.1.1.1 as-number 65410
[PE1-bgp-af-vpna] quit
[PE1-bgp] ipv4-family vpn-instance vpnb
[PE1-bgp-af-vpnb] peer 10.2.1.1 as-number 65410
[PE1-bgp-af-vpnb] quit
[PE1-bgp] quit
# Configure CE1.
[CE1] bgp 65410
[CE1-bgp] peer 10.1.1.2 as-number 100
[CE1-bgp] import-route direct
[CE1-bgp] quit
# Configure CE2.
[CE2] bgp 65410
[CE2-bgp] peer 10.2.1.2 as-number 100
[CE2-bgp] import-route direct
[CE2-bgp] quit
# Configure PE2.
[PE2] bgp 100
[PE2-bgp] ipv4-family vpn-instance vpna
[PE2-bgp-af-vpna] peer 10.3.1.1 as-number 65420
[PE2-bgp-af-vpna] quit
[PE2-bgp] ipv4-family vpn-instance vpnb
[PE2-bgp-af-vpnb] peer 10.4.1.1 as-number 65420
[PE2-bgp-af-vpnb] quit
[PE2-bgp] quit
# Configure CE3.
[CE3] bgp 65420
[CE3-bgp] peer 10.3.1.2 as-number 100
[CE3-bgp] import-route direct
[CE3-bgp] quit
# Configure CE4.
[CE4] bgp 65420
[CE4-bgp] peer 10.4.1.2 as-number 100
Destination: 5.5.5.5/32
Protocol: IBGP Process ID: 0
Preference: 255 Cost: 0
NextHop: 2.2.2.2 Neighbour: 2.2.2.2
State: Active Adv Relied Age: 00h00m08s
Tag: 0 Priority: low
Label: 0x13 QoSInfo: 0x0
IndirectID: 0xb9
RelayNextHop: 0.0.0.0 Interface: Tunnel0/0/2
TunnelID: 0x3d Flags: RD
[PE1] display ip routing-table vpn-instance vpnb 6.6.6.6 verbose
Route Flags: R - relay, D - download for forwarding
------------------------------------------------------------------------------
Routing Table : vpnb
Summary Count : 1
Destination: 6.6.6.6/32
Protocol: IBGP Process ID: 0
Preference: 255 Cost: 0
NextHop: 2.2.2.2 Neighbour: 2.2.2.2
State: Active Adv Relied Age: 00h04m37s
Tag: 0 Priority: low
Label: 0x15 QoSInfo: 0x0
IndirectID: 0xb8
RelayNextHop: 0.0.0.0 Interface: Tunnel0/0/1
TunnelID: 0x3b Flags: RD
RelayNextHop: 0.0.0.0 Interface: LDP LSP
TunnelID: 0x1c Flags: RD
# CEs in the same VPN can ping each other, whereas CEs in different VPNs cannot.
----End
Configuration Files
● PE1 configuration file
#
sysname PE1
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
tnl-policy policy1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 100:2
tnl-policy policy2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 1.1.1.1
mpls
mpls te
mpls rsvp-te
mpls te cspf
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 100.1.1.1 255.255.255.252
mpls
mpls te
mpls rsvp-te
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpna
ip address 10.1.1.2 255.255.255.252
#
interface GigabitEthernet3/0/0
ip binding vpn-instance vpnb
ip address 10.2.1.2 255.255.255.252
#
interface LoopBack1
ip address 1.1.1.1 255.255.255.255
#
interface Tunnel0/0/1
ip address unnumbered interface LoopBack1
tunnel-protocol mpls te
destination 2.2.2.2
mpls te tunnel-id 11
mpls te commit
#
interface Tunnel0/0/2
ip address unnumbered interface LoopBack1
tunnel-protocol mpls te
destination 2.2.2.2
mpls te tunnel-id 22
mpls te reserved-for-binding
mpls te commit
#
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 2.2.2.2 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.2 enable
#
ipv4-family vpn-instance vpna
peer 10.1.1.1 as-number 65410
#
ipv4-family vpn-instance vpnb
peer 10.2.1.1 as-number 65410
#
ospf 1
opaque-capability enable
area 0.0.0.0
mpls-te enable
network 100.1.1.0 0.0.0.3
network 1.1.1.1 0.0.0.0
#
tunnel-policy policy1
tunnel binding destination 2.2.2.2 te Tunnel0/0/2
#
tunnel-policy policy2
tunnel select-seq cr-lsp lsp load-balance-number 2
#
return
● PE2 configuration file
#
sysname PE2
#
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:3
tnl-policy policy1
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
ip vpn-instance vpnb
ipv4-family
route-distinguisher 100:4
tnl-policy policy2
vpn-target 222:2 export-extcommunity
vpn-target 222:2 import-extcommunity
#
mpls lsr-id 2.2.2.2
mpls
mpls te
mpls rsvp-te
mpls te cspf
#
mpls ldp
#
interface GigabitEthernet1/0/0
ip address 100.1.1.2 255.255.255.252
mpls
mpls te
mpls rsvp-te
mpls ldp
#
interface GigabitEthernet2/0/0
ip binding vpn-instance vpna
ip address 10.3.1.2 255.255.255.252
#
interface GigabitEthernet3/0/0
ip binding vpn-instance vpnb
ip address 10.4.1.2 255.255.255.252
#
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
interface Tunnel0/0/1
ip address unnumbered interface LoopBack1
tunnel-protocol mpls te
destination 1.1.1.1
mpls te tunnel-id 11
mpls te commit
#
interface Tunnel0/0/2
ip address unnumbered interface LoopBack1
tunnel-protocol mpls te
destination 1.1.1.1
mpls te tunnel-id 22
mpls te reserved-for-binding
mpls te commit
#
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.1 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.1 enable
#
ipv4-family vpn-instance vpna
peer 10.3.1.1 as-number 65420
#
ipv4-family vpn-instance vpnb
peer 10.4.1.1 as-number 65420
#
ospf 1
opaque-capability enable
area 0.0.0.0
mpls-te enable
network 100.1.1.0 0.0.0.3
network 2.2.2.2 0.0.0.0
#
tunnel-policy policy1
tunnel binding destination 1.1.1.1 te Tunnel0/0/2
#
tunnel-policy policy2
tunnel select-seq cr-lsp lsp load-balance-number 2
#
return
#
return