Showing posts with label MP-BGP. Show all posts
Showing posts with label MP-BGP. Show all posts

Thursday, June 21, 2012

Multiprotocol Label Switching (MPLS) VPN

Yes Guys & Girls! Waiting for detail step wise configuration of Multiprotocol Label Switching Virtual Private Network (MPLS-VPN).

R1(config) # ip cef
R1(config) # mpls ldp router-id loopback 0
R1(config) # mpls label protocol ldp
R1(config) # mpls ip

Repeat same commands on router R2 & R3



We can divide the configuration phase into four steps:

1 - VRP related Configuration
2 - MP-BGP Related Configuration
3 - PE-CE Routing Protocol Configuration
4 - Redistribution

Step # 1 VRF Configuration

R1(config)# ip vrf test
R1(config-vrf)# rd 1:1
R1(config-vrf)# route-target 1:1

By using above command for RT it is defined automatically for both
importa and export, if you want to use seperate you can do so. Use
R1 # show running-config command to see that both import and export
RT is defined using above command.

R1(config)# interface serial 1/1
R1(config-if)# ip vrf forwarding test

./. You will get Warning that IP Address 5.1.1.2 is removed due to
vrf configuration. Assign IP Address again.

R1(config)# interface serial 1/1
R1(config-if)# ip address 5.1.1.1 255.0.0.0

Note: Now when you check your routing table you will not see 5.0.0.0 network as it is removed and move to vrf table. you can confirm it using below command:

R1 # show ip route vrf test

R1 # ping vrf test 5.1.1.1

The result should be sucessfull :)


R3(config)# ip vrf test //The vrf name here can be differnt.
R3(config-vrf)# rd 1:1
R3(config-vrf)# route-target 1:1

R3(config)# interface serial 1/0
R3(config-if)# ip vrf forwarding test

./. You will get Warning that IP Address 5.1.1.2 is removed due to
vrf configuration. Assign IP Address again.

R3(config)# interface serial 1/0
R3(config-if)# ip address 3.1.1.1 255.0.0.0


Step # 2 MP-BGP Configuration

R1(config)# router bgp 1
R1(config-router)# bgp router-id 11.1.1.1
R1(config-router)# bgp auto-summary
R1(config-router)# no synchronization
R1(config-router)# neighbor 33.3.3.3 remote-as 1
R1(config-router)# neighbor 33.3.3.3 update-source loopback 0

R3(config-router)# router bgp 1
R3(config-router)# bgp router-id 33.3.3.3
R3(config-router)# bgp auto-summary
R3(config-router)# no synchronization
R3(config-router)# neighbor 11.1.1.1 remote-as 1
R3(config-router)# neighbor 11.1.1.1 update-source loopback 0

The above is basic BGP configuration. Now MP-BGP configuraiton (We used Multi-Protocol BGP (MP-BGP) because we need this to carry VPNv4, VPNv6, IPv6 & IPv4 Packets while BGP only carry IPv4 traffic.

R1(config) # router bgp 1
R1(config-router) # address-family vpnv4
R1(config-router-af) # neighbor 33.3.3.3 activate
R1(config-router-af) # neighbor 33.3.3.3 send-community both

R3(config) # router bgp 1
R3(config-router) # address-family vpnv4
R3(config-router-af) # neighbor 11.1.1.1 activate
R3(config-router-af) # neighbor 11.1.1.1 send-community both



Step # 3 PE-CE Configuration

Run OSPF between PE & CE but make sure to use different process-id from one which is already running on PE as you all routes will be in service provider area.

R1(config)# router ospf 10 vrf test
R1(config-vrf)# router-id 5.1.1.2
R1(config-vrf)# network 5.0.0.0 0.255.255.255 area 0

Note: We used different id other than loopback as that is already use by OSPF-1.

R5(config)# router ospf 1
R5(config-router)# router-id 55.5.5.5
R5(config-router)# network 55.5.5.5 0.0.0.0 area 0
R5(config-router)# network 50.1.1.1 0.0.0.0 area 0
R5(config-router)# network 5.1.1.1 0.0.0.0 area 0

R1# show ip route vrf test


R3(config)# router ospf 10 vrf test
R3(config-vrf)# router-id 3.1.1.1
R3(config-vrf)# network 3.0.0.0 0.255.255.255 area 0

R7(config)# router ospf 1
R7(config-router)# router-id 77.7.7.7
R7(config-router)# network 77.7.7.7 0.0.0.0 area 0
R7(config-router)# network 70.1.1.1 0.0.0.0 area 0

R3# show ip route vrf test

R3# ping 11.1.1.1


Step # 4 Redistribution

On R1, Routes which are learned via OSPF are now redistributed into BGP which is run in the MPLS domain.

R1(config)# router bgp 1
R1(config-router)# address-family ipv4 vrf test
R1(config-router)# redistribute ospf 10 match internal external

R3# show ip route vrf test

Now redistribute BGP into OSPF as routes reached to R3 but not R7 as on R7 we have OSPF, so redistribute BGP into OSPF.

R3(config)# router ospf 10
R3(config-router)# redistribute bgp 1 subnets

Now do the redistribution in reverse direction. Redistribute OSPF into BGP.

R3(config)# router bgp 1
R3(config-router)# address-family ipv4 vrf test
R3(config)# redistribute ospf 10 match internal external

R1(config)# router ospf 10
R1(config-router)#redistribute bgp 1 subnets


Verifications:

R5# ping 77.7.7.7
R5# traceroute 77.7.7.7

I hope this will be informative for you :)