R1
router ospf 1
int fa0/0
ip ospf 1 area 0
int lo 0
ip ospf 1 area 0
int fa0/0
mpls ip
ip cef
R2
router ospf 1
int fa0/0
ip ospf 1 area 0
int fa0/1
ip ospf 1 area 0
int lo 0
ip ospf 1 area 0
int fa0/0
mpls ip
ip cef
int fa0/1
mpls ip
ip cef
R3
router ospf 1
int fa0/0
ip ospf 1 area 0
int lo 0
ip ospf 1 area 0
int fa0/0
mpls ip
ip cef
#show mpls ldp bindings
#shpw mpls ldp neighbors
#show mpls interfaces
P1
conf t
hostname P1
int fa0/0
ip add 10.0.9.5 255.255.255.252
no sh
int fa0/1
ip add 10.0.9.1 255.255.255.252
no sh
int lo 0
ip add 10.0.0.1 255.255.255.255
P2
conf t
hostname P2
int fa0/0
ip add 10.0.9.9 255.255.255.252
no sh
int fa0/1
ip add 10.0.9.2 255.255.255.252
no sh
int lo 0
ip add 10.0.0.2 255.255.255.255
PE1
conf t
hostname PE1
int fa0/0
ip add 10.0.9.6 255.255.255.252
no sh
int lo 0
ip add 10.0.0.3 255.255.255.255
PE2
conf t
hostname PE2
int fa0/0
ip add 10.0.9.10 255.255.255.252
no sh
int lo 0
ip add 10.0.0.4 255.255.255.255
-------------------------------- ---
**CE-NEstle-Hq - OSPF 2**
conf t
hostname Nestle-HQ
int fa0/0
ip add 10.0.1.2 255.255.255.252
no sh
ip ospf 2 area 0
int lo 1
ip add 172.16.1.1 255.255.255.0
CE-Pepsi-Hq - OSPF 3
conf t
hostname Pepsi-HQ
int fa0/0
ip add 10.0.1.6 255.255.255.252
ip ospf 3 area 0
no sh
int lo 1
ip add 172.16.1.1 255.255.255.0
CE-NEstle-Branch - OSPF 2
conf t
int fa0/0
ip add 10.0.2.2 255.255.255.252
no sh
ip ospf 2 area 0
int lo 1
ip add 172.16.2.1 255.255.255.0
CE-Pepsi-Branch - OSPF 3
conf t
int fa0/0
ip add 10.0.2.6 255.255.255.252
ip ospf 3 area 0
no sh
int lo 1
ip add 172.16.2.1 255.255.255.0
There are five core tasks we need to accomplish to get an MPLS VPN up and running:
Enable OSPF 1 on all P & PE Routers.
Enable LDP on P and PE Routers.
P1
conf t
int fa0/0
mpls ip
int fa0/1
mpls ip
P2
conf t
int fa0/0
mpls ip
int fa0/1
mpls ip
PE1
int fa0/0
mpls ip
PE2
int fa0/0
mpls ip
MPLS LDP Autoconfig automatically configure LDP on ospf interfaces
conf t
**router ospf 1
mpls ldp auto-config.**
show mpls ldp neighbor show mpls forwarding-table Create VRFs and assign routed interfaces to them.
We will create VRF on PE Routers. Bcoz PE Routers are connected with CE Routers.
**Route distinguisher** for each VRF in the form of
:.
The command route-target both is used as a shortcut for the two commands route-target import and route-target export
Pe1
ip vrf Nestle
**rd 65000:1**
route-target both 65000:1
ip vrf Pepsi
**rd 65000:2**
route-target **both** 65000:2
Pe2
ip vrf Nestle
rd 65000:1
route-target both 65000:1
ip vrf Pepsi
rd 65000:2
route-target **both** 65000:2
**ADD Interfaces in VRF**
PE1
int fa0/1
ip vrf forwarding Nestle
ip add 10.0.1.1 255.255.255.252
no sh
int fa1/0
ip vrf forwarding Pepsi
ip address 10.0.1.5 255.255.255.252
no sh
PE2
int fa1/0
ip vrf forwarding Nestle
ip add 10.0.2.1 255.255.255.252
no sh
int fa0/1
ip vrf forwarding Pepsi
ip address 10.0.2.5 255.255.255.252
no sh
Configure MP-BGP between the PE routers.
We configuring the **MP-BGP** so that We can forward customer routes
from one location to another location. **We will configure MP-BGP on PE Routers**
It also supports the advertisement of VPN routes,
which are longer than normal routes due to the addition of a 64-bit
route distinguisher (which we assigned under VRF configuration).
MPBGP will run between PE Routers. P routers rely on IGP & MPLS.
BGP Core FREE.
PE1
router bgp 65000
neighbor 10.0.0.4 remote-as 65000
**neighbor 10.0.0.4 update-source loopback 0**
**address-family vpnv4**
neighbor 10.0.0.4 activate
PE2
router bgp 65000
neighbor 10.0.0.3 remote-as 65000
neighbor 10.0.0.3 update-source loopback 0
address-family vpnv4
neighbor 10.0.0.3 activate
Configure MP-BGP between the PE routers.
We can use any IGP protocol between PE and CE.
We are running IGP so that we can forward the routes from CE to PE.
PE1
**router ospf 2 vrf Nestle**
router-id 10.0.1.1
int fa0/1
ip ospf 2 area 0
router ospf 3 vrf Pepsi
router-id 10.0.1.5
int fa1/0
ip ospf 3 area 0
PE2
router ospf 2 vrf Nestle
router-id 10.0.2.1
int fa1/0
ip ospf 2 area 0
router ospf 3 vrf Pepsi
router-id 10.0.1.5
int fa0/1
ip ospf 3 area 0