MPLS Lab Setup

From MikroTik Wiki
Jump to navigation Jump to search

Introduction

This page is an attempt to put together a lab setup for the testing of MPLS / VPLS as well as Traffic Engineering. This is not an attempt to explain how MPLS works, rather it is to promote discussion around the operation of MPLS. Before working through this lab you should first familiarize yourself with the concepts in this WIKI article http://wiki.mikrotik.com/wiki/MPLSVPLS as most of the setup has been based around those concepts. As my understanding of MPLS is also rather limited please feel free to edit and correct where required. If you want the original network diagram (in Visio format) please email me on david [at] mikrotiksa dot com. I can also export to some other formats. There is also a discussion on the forum about this wiki. Please check for updates.

Lab Setup

Network Diagram

First lets look at a network diagram of the basic setup File:MPLS Lab Setup.png

The setup was created using 6 RB532's, but anything with 3 network interfaces and 32MB memory should be able to do the job. P1 - P3 are the Provider (MPLS Backbone) routers. PE1 - PE3 are the Provider Edge routers which do the Label Popping

Router Setup

Loopback Interface

Each router is setup with a loopback adapter lobridge which holds the loopback address. From http://wiki.mikrotik.com/wiki/MPLSVPLS we can see this serves 2 purposes:

  • as there is only one LDP session between any 2 routers, no matter how many links connect them, loopback IP address ensures that the LDP session is not affected by interface state or address changes
  • use of loopback address as LDP transport address ensures proper penultimate hop popping behavior when multiple labels are attached to packet as in case of VPLS

Here is a typical router setup (this is from P1)

P1

/interface bridge add name=lobridge
/ip address add address=10.255.255.1/32 interface=lobridge

The other routers are setup with 10.255.255.2-6 as per the diagram above

P2

/interface bridge add name=lobridge
/ip address add address=10.255.255.2/32 interface=lobridge

P3

/interface bridge add name=lobridge
/ip address add address=10.255.255.3/32 interface=lobridge

PE1

/interface bridge add name=lobridge
/ip address add address=10.255.255.4/32 interface=lobridge

PE2

/interface bridge add name=lobridge
/ip address add address=10.255.255.5/32 interface=lobridge

PE3

/interface bridge add name=lobridge
/ip address add address=10.255.255.6/32 interface=lobridge

IP Addressing

We then setup the links between the core routers and the core-edge routers as per the diagram:

P1

/ip address 
add address=10.0.255.1/30 interface=ether1 
add address=10.0.255.5/30 interface=ether2
add address=10.1.0.254/24 interface=ether3

P2

/ip address 
add address=10.0.255.6/30 interface=ether1 
add address=10.0.255.9/30 interface=ether2
add address=10.2.0.254/24 interface=ether3

P3

/ip address 
add address=10.0.255.10/30 interface=ether1
add address=10.0.255.2/30 interface=ether2
add address=10.3.0.254/24 interface=ether3

PE1

/ip address 
add address=10.1.0.1/24 interface=ether1

PE2

/ip address 
add address=10.2.0.1/24 interface=ether1

PE3

/ip address 
add address=10.3.0.1/24 interface=ether1

Dynamic Routing Setup

Next we can setup OSPF on each router to dynamically distribute routes

P1

/routing ospf instance
set distribute-default=never redistribute-connected=as-type-1 router-id=10.255.255.1 numbers=default
/routing ospf network 
add area=backbone network=10.0.255.0/30 
add area=backbone network=10.0.255.4/30 
add area=backbone network=10.1.0.0/24 

P2

/routing ospf instance
set distribute-default=never redistribute-connected=as-type-1 router-id=10.255.255.2 numbers=default
/routing ospf network 
add area=backbone network=10.0.255.8/30 
add area=backbone network=10.0.255.4/30 
add area=backbone network=10.2.0.0/24 

P3

/routing ospf instance
set distribute-default=never redistribute-connected=as-type-1 router-id=10.255.255.3 numbers=default
/routing ospf network 
add area=backbone network=10.0.255.0/30 
add area=backbone network=10.0.255.8/30 
add area=backbone network=10.3.0.0/24 

PE1

/routing ospf instance
set distribute-default=never redistribute-connected=as-type-1 router-id=10.255.255.4 numbers=default
/routing ospf network 
add area=backbone network=10.1.0.0/24 

PE2

/routing ospf instance
set distribute-default=never redistribute-connected=as-type-1 router-id=10.255.255.5 numbers=default
/routing ospf network 
add area=backbone network=10.2.0.0/24 

PE3

/routing ospf instance
set distribute-default=never redistribute-connected=as-type-1 router-id=10.255.255.6 numbers=default
/routing ospf network 
add area=backbone network=10.3.0.0/24 

You should now have a working OSPF routed system

MPLS Setup

The next step is to add and configure the MPLS system. In order to distribute labels for routes, LDP needs to be enabled. Then all interfaces that participate in MPLS need to be added.

P1

/mpls ldp 
set enabled=yes lsr-id=10.255.255.1 transport-address=10.255.255.1
/mpls ldp interface 
add interface=ether1
add interface=ether2
add interface=ether3

P2

/mpls ldp 
set enabled=yes lsr-id=10.255.255.2 transport-address=10.255.255.2
/mpls ldp interface 
add interface=ether1
add interface=ether2
add interface=ether3

P3

/mpls ldp 
set enabled=yes lsr-id=10.255.255.3 transport-address=10.255.255.3
/mpls ldp interface 
add interface=ether1
add interface=ether2
add interface=ether3

PE1

/mpls ldp 
set enabled=yes lsr-id=10.255.255.4 transport-address=10.255.255.4
/mpls ldp interface 
add interface=ether1

PE2

/mpls ldp 
set enabled=yes lsr-id=10.255.255.5 transport-address=10.255.255.5
/mpls ldp interface 
add interface=ether1

PE3

/mpls ldp 
set enabled=yes lsr-id=10.255.255.6 transport-address=10.255.255.6
/mpls ldp interface 
add interface=ether1

This should now give you an operational MPLS setup.

File:LDP1.png File:Mpls2.png File:Mpls1.png