Mpls VPN Basic
Mpls VPN Basic
Mpls VPN Basic
Contents
Introduction
Prerequisites
Requirements
Components Used
Conventions
Background Information
Configuration
Network Diagram
Configurations
Verification
Related Information
Introduction
This document describes how to configure a basic Multiprotocol Label Switching (MPLS) VPN core
network.
Prerequisites
Requirements
Components Used
The information in this document is based on these software and hardware versions:
P and PE Routers
• Any Cisco router from the Aggregation Services Router (ASR) and Integrated Services Router
(ISR) series or other higher end routers supports P and PE functionality.
C and CE Routers
• You can use any router that can exchange routing information with its PE router.
The information in this document was created from the devices in a specific lab environment. All of the
devices used in this document started with a cleared (default) configuration. If your network is live, ensure
that you understand the potential impact of any command.
Conventions
Refer to Cisco Technical Tips Conventions for more information on document conventions.
These letters represent the different types of routers and switches used:
• P — Provider router
• C — Customer router
Note: PE routers are the last hop in the provider network. These devices connect directly to the CE
routers, which are customer-owned devices that interface with the service provider network but do not
participate in MPLS operations.
Background Information
MPLS is a high-performance network technology that directs data from one node to another using short path
labels instead of long network addresses. This approach speeds up and shapes traffic flows across enterprise
and service provider networks. MPLS assigns labels to packets, which are used by Label Switching Routers
(LSR), or P routers, to make forwarding decisions. Label Edge Routers (LER), or PE routers, at the network
edge add and remove these labels.
MPLS uses Forwarding Equivalence Classes (FECs) to group packets that are forwarded in the same
manner, and the Label Distribution Protocol (LDP) to distribute label mappings between routers. This
ensures a consistent view of label bindings across the network.
The benefits of MPLS include improved performance, scalability, traffic engineering capabilities, and
support for Quality of Service (QoS). It is protocol-agnostic, making it a versatile solution for various
network environments. MPLS is widely used to create scalable and secure Virtual Private Networks (VPNs),
manage and optimize traffic flows, and support the convergence of different types of traffic (for example
data, voice, and video) onto a single network infrastructure.
This document provides a sample configuration of an MPLS VPN network where Border Gateway Protocol
(BGP) is used between PE (Provider Edge) and CE (Customer Edge) routers. When used with MPLS, the
VPN feature allows several sites to interconnect transparently through a service provider network. One
service provider network can support several different IP VPNs, each appearing to its users as a private
network, separate from all other networks. Within a VPN, each site can send IP packets to any other site in
the same VPN.
Each VPN is associated with one or more Virtual Routing and Forwarding (VRF) instances. A VRF consists
of an IP routing table, a derived Cisco Express Forwarding (CEF) table, and a set of interfaces that use this
forwarding table. The router maintains a separate Routing Information Base (RIB) and CEF table for each
VRF. This ensures that information is not sent outside the VPN, allowing the same subnet to be used in
several VPNs without causing duplicate IP address problems. The router that uses Multiprotocol BGP (MP-
BGP) distributes the VPN routing information with the MP-BGP extended communities.
Configuration
This section provides the configuration examples and how they are implemented.
Network Diagram
This document uses this network setup, this diagram shows a typical configuration that illustrates the
conventions outlined previously.:
MPLS Topology
1. Verify that ip cef is enabled on the routers where MPLS is required (CEF is enabled by default on latest
software releases).
2. Configure an Interior Gateway Protocol (IGP) on the service provider core, either Open Shortest Path
First (OSPF) or Intermediate System-to-Intermediate System (IS-IS) protocols are the recommended
options, and advertise the Loopback0 from each P and PE routers.
3. After the service provider core routers are fully Layer 3 (L3) reachable between their loopbacks,
configure the command mpls ip on each L3 interface between P and PE routers or use the mpls ldp
autoconfig command to enable LDP on each interface that is running the OSPF or IS-IS process.
Note: The PE router interface that connects directly to the CE router does not require the mpls ip
command configuration.
After the mpls ip configuration has been added to the interfaces, complete the next steps on the PE routers:
4. Create one VRF for each VPN connected with the vrf definition <VRF name> command. Additional steps:
Specify the route distinguisher used for that VPN. The command rd <VPN route distinguisher> is used to extend
the IP address so that you can identify which VPN it belongs to.
Set up the import and export properties for the MP-BGP extended communities. These are used to filter the
import and export process with the command route-target {import|export|both} <target VPN extended
community> as shown in the next output:
5. On the PE router, add the interfaces that connect the CE to the corresponding VRF. Configure the
forwarding details for the respective interfaces with the vrf forwarding command and set up the IP address.
<#root>
PE-1#
Building configuration...
Configure MP-BGP
There are several ways to configure BGP, for example, you can configure PE routers as BGP neighbors or
use a Route Reflector (RR) or Confederation methods. A Route Reflector is used in the next example, which
is more scalable than the use of full mesh neighbors between PE routers:
1. Enter the address-family ipv4 vrf <VRF name> command for each VPN present at this PE router. Next,
carry out one or more of the next steps, as necessary:
• If you use BGP to exchange routing information with the CE, configure and activate the BGP
neighbors with the CE routers.
• If you use a different dynamic routing protocol to exchange routing information with the CE,
redistribute the routing protocols.
Note: Based on the PE-CE routing protocol you use, you can configure any dynamic routing protocols
(EIGRP, OSPF or BGP) between PE and CE devices. If BGP is the protocol used to exchange routing
information between PE and CE, there is no need to configure redistribution between protocols.
2. Under router bgp hierarchy, enter the address-family vpnv4 mode, and complete the next steps:
• Activate the neighbors, a VPNv4 neighbor session needs to be established between each PE router and
the Route Reflector.
Configurations
This document uses these configurations to setup the MPLS VPN network example:
• PE-1 (PE)
• PE-2 (PE)
• P-2 (P)
• RR (RR)
• P-1 (P)
PE-1
<#root>
hostname PE-1
!
ip cef
!
!--- Enables the VPN routing and forwarding (VRF) routing table.
!--- Route distinguisher creates routing and forwarding tables for a VRF.
!--- Route targets creates lists of import and export extended communities for the specified VRF.
!--- This is allowed because they belong to two different customer VRFs.
!
interface GigabitEthernet0/0
description link to P-1
ip address 10.1.1.14 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
router bgp 65000
bgp log-neighbor-changes
neighbor 10.10.10.2 remote-as 65000
neighbor 10.10.10.2 update-source Loopback0
!--- And enables BGP sessions to use a specific operational interface for TCP connections.
!
address-family vpnv4
neighbor 10.10.10.2 activate
neighbor 10.10.10.2 send-community both
exit-address-family
!--- To enter address family configuration mode that use standard VPN version 4 address prefixes.
!
address-family ipv4 vrf Client_A
neighbor 10.0.4.1 remote-as 65002
neighbor 10.0.4.1 activate
exit-address-family
!
address-family ipv4 vrf Client_B
neighbor 10.0.4.1 remote-as 65001
neighbor 10.0.4.1 activate
exit-address-family
!--- These are the eBGP sessions to each CE router belonging to different customers.
!--- The eBGP sessions are configured within the VRF address family
!
end
PE-2
hostname PE-2
!
ip cef
!
vrf definition Client_A
rd 100:110
route-target export 100:1000
route-target import 100:1000
!
address-family ipv4
exit-address-family
!
vrf definition Client_B
rd 100:120
route-target export 100:2000
route-target import 100:2000
!
address-family ipv4
exit-address-family
!
ip cef
!
interface Loopback0
ip address 10.10.10.6 255.255.255.255
ip router isis
!
interface GigabitEthernet0/0
description link to P-2
ip address 10.1.1.22 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/1
vrf forwarding Client_B
ip address 10.0.6.2 255.255.255.0
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/2
vrf forwarding Client_A
ip address 10.1.6.2 255.255.255.0
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/3
vrf forwarding Client_A
ip address 10.0.6.2 255.255.255.0
duplex auto
speed auto
media-type rj45
!
router isis
net 49.0001.0000.0000.0006.00
is-type level-2-only
metric-style wide
passive-interface Loopback0
!
router bgp 65000
bgp log-neighbor-changes
neighbor 10.10.10.2 remote-as 65000
neighbor 10.10.10.2 update-source Loopback0
!
address-family vpnv4
neighbor 10.10.10.2 activate
neighbor 10.10.10.2 send-community both
exit-address-family
!
address-family ipv4 vrf Client_A
neighbor 10.0.6.1 remote-as 65004
neighbor 10.0.6.1 activate
neighbor 10.1.6.1 remote-as 65004
neighbor 10.1.6.1 activate
exit-address-family
!
address-family ipv4 vrf Client_B
neighbor 10.0.6.1 remote-as 65003
neighbor 10.0.6.1 activate
exit-address-family
!
!
end
P-2
hostname P-2
!
ip cef
!
interface Loopback0
ip address 10.10.10.3 255.255.255.255
ip router isis
!
interface GigabitEthernet0/0
description link to PE-2
ip address 10.1.1.21 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/1
description link to P-1
ip address 10.1.1.6 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/2
description link to RR
ip address 10.1.1.9 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
router isis
net 49.0001.0000.0000.0003.00
is-type level-2-only
metric-style wide
passive-interface Loopback0
!
end
RR
hostname RR
!
ip cef
!
interface Loopback0
ip address 10.10.10.2 255.255.255.255
ip router isis
!
interface GigabitEthernet0/0
description link to P-1
ip address 10.1.1.2 255.255.255.252ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/1
description link to P-2
ip address 10.1.1.10 255.255.255.252ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/3
no ip address
shutdown
duplex auto
speed auto
media-type rj45
!
router isis
net 49.0001.0000.0000.0002.00
is-type level-2-only
metric-style wide
passive-interface Loopback0
!
router bgp 65000
bgp log-neighbor-changes
neighbor 10.10.10.4 remote-as 65000
neighbor 10.10.10.4 update-source Loopback0
neighbor 10.10.10.6 remote-as 65000
neighbor 10.10.10.6 update-source Loopback0
!
address-family vpnv4
neighbor 10.10.10.4 activate
neighbor 10.10.10.4 send-community both
neighbor 10.10.10.4 route-reflector-client
neighbor 10.10.10.6 activate
neighbor 10.10.10.6 send-community both
neighbor 10.10.10.6 route-reflector-client
exit-address-family
!
!
end
P-1
hostname P-1
!
ip cef
!
interface Loopback0
ip address 10.10.10.1 255.255.255.255
ip router isis
!
interface GigabitEthernet0/0
description link to PE-1
ip address 10.1.1.13 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/1
description link to RR
ip address 10.1.1.5 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/2
description link to P-2
ip address 10.1.1.1 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
router isis
net 49.0001.0000.0000.0001.00
is-type level-2-only
metric-style wide
passive-interface Loopback0
!
end
CE-A1 CE-A3
Verification
This section provides information you can use to confirm that the configuration works properly:
PE to CE Verification Commands
show ip vrf
This next is a sample command output of the show ip vrf interfaces command.
<#root>
PE-2#
In this next sample, the show ip route vrf commands show the same prefix 10.0.6.0/24 in both the outputs.
This is because the remote PE has the same network for two Cisco clients, CE_B2 and CE_A3, which is
allowed in a typical MPLS VPN solution.
<#root>
PE-1#
PE-1#
show ip route vrf Client_B
When you run a traceroute between two sites, in this example two sites of Client_A (CE-A1 to CE-A3), it is
possible to see the label stack used by the MPLS network (if it is configured to do so by mpls ip propagate-
ttl ).
<#root>
CE-A1#
CE-A1#
ping 10.0.6.1
CE-A1#
The next output shows the IS-IS and LDP adjacency established between the RR and some of the P routers
in the Service Provider core network:
<#root>
RR#
Tag null:
System Id Type Interface IP Address State Holdtime Circuit Id
P-1 L2 Gi0/0 10.1.1.1 UP 25 RR.01
P-2 L2 Gi0/1 10.1.1.9 UP 23 RR.02
RR#
RR#
Related Information
• MPLS Command Reference
• Technical Support & Documentation - Cisco Systems
• Verify MPLS Layer 3 VPN Forwarding