Skip to main content

Basic MPLS BGP and L3VPN Lab Setup

In this lab, we’ve set up a basic MPLS, BGP, and L3VPN environment, which is a great foundation for understanding how service providers build scalable networks. The lab uses the EVE-NG simulator along with Router IOS C7200-ADVENTERPRISEK9-M, Version 15.2(4)M8 to emulate a realistic MPLS environment. Below is a summary of the key components and roles of each router in the lab.



MPLS Core Routers:

The MPLS core consists of the routers responsible for label switching and forwarding customer traffic through the network:

  • PE1 (Provider Edge 1): Connects customer networks to the MPLS core and handles both MPLS and BGP routing. It also hosts VRF (Virtual Routing and Forwarding) instances for customers.
  • PE2 (Provider Edge 2): Functions similarly to PE1, connecting another customer network to the MPLS core.
  • P1 (Core Router 1) and P2 (Core Router 2): These routers serve as MPLS core routers and handle label switching but do not store or process customer routes directly. They simply forward packets through the core using MPLS.

OSPF for Internal Routing:

  • OSPF is used as the IGP (Interior Gateway Protocol) within the MPLS core to manage routing between PE and P routers. OSPF advertises loopback addresses and forms adjacencies between P1, P2, PE1, and PE2, which are critical for MPLS label distribution.
  • OSPF is also used to share routes between customer edge (CE) routers and provider edge (PE) routers.

Route Reflectors (RR1, RR2):

  • RR1 and RR2 are used as BGP Route Reflectors to manage route distribution between the PE routers. This eliminates the need for a full iBGP mesh by reflecting BGP routes to the appropriate PE routers.
  • These routers do not participate in MPLS label switching and are solely for route reflection in BGP.

Summary of the Lab Setup:

  • The MPLS Core consists of PE1, PE2, P1, and P2, which handle MPLS traffic forwarding and switching.
  • OSPF is used for internal routing and to advertise loopback addresses required for BGP and MPLS label distribution.
  • RR1 and RR2 are responsible for BGP route reflection between PE routers, but they do not handle MPLS traffic.

This lab was created using the EVE-NG simulator and the C7200-ADVENTERPRISEK9-M, Version 15.2(4)M8 IOS image. The topology provides a solid understanding of how MPLS, BGP, and L3VPN work together in a service provider network.

In the following sections of the blog, I will be copying and pasting the running configurations from all the routers in the lab. This will allow you to easily replicate the setup for learning or practice purposes.

RR1 Router Configurations

hostname RR1

!

interface Loopback0

 ip address 1.1.1.1 255.255.255.255

!

interface Ethernet1/0

 ip address 10.1.1.1 255.255.255.252

 duplex full

!

interface Ethernet1/1

 ip address 10.1.2.1 255.255.255.252

 duplex full

!

router ospf 1

 router-id 1.1.1.1

 network 1.1.1.1 0.0.0.0 area 0

 network 10.1.1.0 0.0.0.3 area 0

 network 10.1.2.0 0.0.0.3 area 0

!

router bgp 6501

 bgp log-neighbor-changes

 neighbor 3.3.3.3 remote-as 6501

 neighbor 3.3.3.3 update-source Loopback0

 neighbor 4.4.4.4 remote-as 6501

 neighbor 4.4.4.4 update-source Loopback0

 !

 address-family ipv4

  neighbor 3.3.3.3 activate

  neighbor 3.3.3.3 route-reflector-client

  neighbor 4.4.4.4 activate

  neighbor 4.4.4.4 route-reflector-client

 exit-address-family

 !

 address-family vpnv4

  neighbor 3.3.3.3 activate

  neighbor 3.3.3.3 send-community both

  neighbor 3.3.3.3 route-reflector-client

  neighbor 4.4.4.4 activate

  neighbor 4.4.4.4 send-community both

  neighbor 4.4.4.4 route-reflector-client

 exit-address-family

!


RR2 - Router Configurations

hostname RR2

!

interface Loopback0

 ip address 2.2.2.2 255.255.255.255

!

interface Ethernet1/0

 ip address 10.2.1.1 255.255.255.252

 duplex full

!

interface Ethernet1/1

 ip address 10.2.2.1 255.255.255.252

 duplex full

!

router ospf 1

 router-id 2.2.2.2

 network 2.2.2.2 0.0.0.0 area 0

 network 10.2.1.0 0.0.0.3 area 0

 network 10.2.2.0 0.0.0.3 area 0

!

router bgp 6501

 bgp log-neighbor-changes

 neighbor 3.3.3.3 remote-as 6501

 neighbor 3.3.3.3 update-source Loopback0

 neighbor 4.4.4.4 remote-as 6501

 neighbor 4.4.4.4 update-source Loopback0

 !

 address-family ipv4

  neighbor 3.3.3.3 activate

  neighbor 3.3.3.3 route-reflector-client

  neighbor 4.4.4.4 activate

  neighbor 4.4.4.4 route-reflector-client

 exit-address-family

 !

 address-family vpnv4

  neighbor 3.3.3.3 activate

  neighbor 3.3.3.3 send-community both

  neighbor 3.3.3.3 route-reflector-client

  neighbor 4.4.4.4 activate

  neighbor 4.4.4.4 send-community both

  neighbor 4.4.4.4 route-reflector-client

 exit-address-family

!


P1 Router Configurations

hostname P1

!

interface Loopback0

 ip address 5.5.5.5 255.255.255.255

!

interface Ethernet1/0

 ip address 10.1.1.2 255.255.255.252

 duplex full

 mpls ip

!

interface Ethernet1/1

 ip address 10.2.1.2 255.255.255.252

 duplex full

 mpls ip

!

interface Ethernet1/2

 ip address 10.3.1.2 255.255.255.252

 duplex full

 mpls ip

!

interface Ethernet2/0

 ip address 10.5.1.1 255.255.255.252

 duplex full

 mpls ip

!

router ospf 1

 router-id 5.5.5.5

 network 5.5.5.5 0.0.0.0 area 0

 network 10.1.1.0 0.0.0.3 area 0

 network 10.2.1.0 0.0.0.3 area 0

 network 10.3.1.0 0.0.0.3 area 0

 network 10.5.1.0 0.0.0.3 area 0

!


P2 Router Configurations

hostname P2

!

interface Loopback0

 ip address 6.6.6.6 255.255.255.255

!

interface Ethernet1/0

 ip address 10.1.2.2 255.255.255.252

 duplex full

 mpls ip

!

interface Ethernet1/1

 ip address 10.2.2.2 255.255.255.252

 duplex full

 mpls ip

!

interface Ethernet1/2

 ip address 10.4.1.2 255.255.255.252

 duplex full

 mpls ip

!

interface Ethernet2/0

 ip address 10.5.1.2 255.255.255.252

 duplex full

 mpls ip

!

router ospf 1

 router-id 6.6.6.6

 network 6.6.6.6 0.0.0.0 area 0

 network 10.1.2.0 0.0.0.3 area 0

 network 10.2.2.0 0.0.0.3 area 0

 network 10.4.1.0 0.0.0.3 area 0

 network 10.5.1.0 0.0.0.3 area 0

!


PE1 Router Configurations

!

hostname PE1

!

ip vrf CUSTOMER1

 rd 100:1

 route-target export 100:1

 route-target import 100:1

!

interface Loopback0

 ip address 3.3.3.3 255.255.255.255

!

interface Loopback1

 ip address 172.16.3.3 255.255.255.255

!

interface Ethernet1/0

 ip address 10.3.1.1 255.255.255.252

 duplex full

 mpls ip

!

interface Ethernet1/2

 ip vrf forwarding CUSTOMER1

 ip address 192.168.1.1 255.255.255.0

 duplex full

!

router ospf 1

 router-id 3.3.3.3

 network 3.3.3.3 0.0.0.0 area 0

 network 10.3.1.0 0.0.0.3 area 0

!

router bgp 6501

 bgp log-neighbor-changes

 neighbor 1.1.1.1 remote-as 6501

 neighbor 1.1.1.1 update-source Loopback0

 neighbor 2.2.2.2 remote-as 6501

 neighbor 2.2.2.2 update-source Loopback0

 !

 address-family ipv4

  redistribute connected

  neighbor 1.1.1.1 activate

  neighbor 2.2.2.2 activate

 exit-address-family

 !

 address-family vpnv4

  neighbor 1.1.1.1 activate

  neighbor 1.1.1.1 send-community both

  neighbor 2.2.2.2 activate

  neighbor 2.2.2.2 send-community both

 exit-address-family

 !

 address-family ipv4 vrf CUSTOMER1

  redistribute connected

 exit-address-family

!


PE2 Router Configurations

hostname PE2

!

ip vrf CUSTOMER1

 rd 100:1

 route-target export 100:1

 route-target import 100:1

!

interface Loopback0

 ip address 4.4.4.4 255.255.255.255

!

interface Ethernet1/0

 ip address 10.4.1.1 255.255.255.252

 duplex full

 mpls ip

!

interface Ethernet1/2

 ip vrf forwarding CUSTOMER1

 ip address 192.168.2.1 255.255.255.0

 duplex full

!

router ospf 1

 router-id 4.4.4.4

 network 4.4.4.4 0.0.0.0 area 0

 network 10.4.1.0 0.0.0.3 area 0

!

router bgp 6501

 bgp log-neighbor-changes

 neighbor 1.1.1.1 remote-as 6501

 neighbor 1.1.1.1 update-source Loopback0

 neighbor 2.2.2.2 remote-as 6501

 neighbor 2.2.2.2 update-source Loopback0

 !

 address-family ipv4

  neighbor 1.1.1.1 activate

  neighbor 2.2.2.2 activate

 exit-address-family

 !

 address-family vpnv4

  neighbor 1.1.1.1 activate

  neighbor 1.1.1.1 send-community both

  neighbor 2.2.2.2 activate

  neighbor 2.2.2.2 send-community both

 exit-address-family

 !

 address-family ipv4 vrf CUSTOMER1

  redistribute connected

 exit-address-family

 !


CE1 Router Configurations

hostname CE1

!

interface Loopback0

 ip address 7.7.7.7 255.255.255.255

!

interface Ethernet1/0

 ip address 192.168.1.2 255.255.255.0

 duplex full

!

ip route 0.0.0.0 0.0.0.0 192.168.1.1

!


CE Router Configurations

!

hostname CE2

!

interface Loopback0

 ip address 8.8.8.8 255.255.255.255

!

interface Ethernet1/0

 ip address 192.168.2.2 255.255.255.0

 duplex full

!

ip route 0.0.0.0 0.0.0.0 192.168.2.1

!

Comments

Popular posts from this blog

How to import Putty Saved Connections to mRemoteNG

Just started using mRemoteNG and its being very cool to connect to different remote connection with different protocols e.g Window Remote Desktop, VNC to Linux, SSH, HTTP connection etc. from a single application. As new user I configured some remote desktop connection which was quite easy to figure out. But when I wanted to add SSH connections, it came in my mind to import all of the saved connections in the putty. But I couldn't figure it out how can it be done, though it was quite easy and here are the steps. Open your mRemoteNG Create a folder if you want segregation of multiple networks Create a new connection Enter the IP address of remote server under connection in Config pane Under the config pane, select protocol " SSH version 2 ".  Once you select protocol to SSH version 2 you are given option to import putty sessions, as shown in the snap below. In the above snap, I have imported CSR-AWS session from my saved sessions in Putty.

BGP Soft Reconfiguration vs. Route Refresh: Key Differences and Best Practices

In BGP (Border Gateway Protocol), managing route updates and reapplying new policies can sometimes be challenging, especially if you want to avoid resetting the BGP session. Two methods allow you to update routing policies without tearing down the session: BGP Soft Reconfiguration and BGP Route Refresh . While both methods serve the same purpose, they work differently and have distinct impacts on your router's resources. This post explains the key differences between Soft Reconfiguration and Route Refresh , when to use each, and why Route Refresh is preferred in most modern networks. 1. What is BGP Soft Reconfiguration? BGP Soft Reconfiguration is an older method of applying new policies (like route maps, filters, or prefix lists) without resetting the BGP session. It works by storing a local copy of all the routes received from a BGP neighbor before applying inbound policies. This local route copy allows the router to reprocess the routes when a policy change occurs. How So...

BGP Local Preference Controlling Outbound Traffic in BGP

In BGP, Local Preference is used to control the outbound traffic path. It helps you decide which egress point (exit point) should be used when you have multiple connections to external networks, such as ISPs. Local Preference is an attribute that is local to your AS and is shared with all iBGP peers but not with eBGP neighbors. Higher Local Preference = More preferred outbound path. Example Scenario : You have two external links: ISP1 (via CE1) and ISP2 (via CE2). You want traffic to prefer ISP1 for all outbound traffic. Network Topology : CE1 (connected to ISP1): 10.0.1.1/30 CE2 (connected to ISP2): 10.0.2.1/30 iBGP Router (Internal) connected to both CE1 (10.0.1.2/30) and CE2 (10.0.2.2/30). Configuration on CE1 (Higher Local Preference) : Create a route map to set the local preference to 200 for routes learned from CE1: route-map SET_LOCAL_PREF permit 10 set local-preference 200 In the BGP configuration for CE1, apply this route map to the neighbor: router bgp 65001 ne...