Logo

EcoRouter

EcoNAT

EcoQOE

EcoBypass

English

MPLS settings EcoRouter Documentation / MPLS settings

MPLS (multiprotocol label switching is the mechanism that transfers data from one node of the network to another using tags.

Each packet passing through the MPLS network, regardless of the type of this packet, is assigned a specific label, on the basis of which a routing decision is made. The content of the packets is not inspected.

The routers in the MPLS network are divided according to their functions into the Label Edge Router (LER) and Label Switch Router (LSR) which changes tags.

The table below shows the basic commands required to configure MPLS in EcoRouter.

CommandDescription
mpls ac-group <NAME> <NUMBER>
Create a new access circuit group
mpls bandwidth-class
bandwidth-class
mpls disable-all-interfaces
Disable all interfaces for MPLS
mpls egress-ttl <0-255>

Specify a TTL value for LSPs for which this LSR is the egress

mpls enable-all-interfaces
Enable all interfaces for MPLS
mpls ftn-entry <IP PREFIX> <TAG> <IP ADDRESS OF THE WAITING INTERFACE> <OUTGOING INTERFACE NAME>
Add an FTN entry for MPLS cloud
mpls ilm-entry <INCOMING TAG> <INCOMING INTERFACE NAME> swap <OUTGOING TAG> <OUTGOING INTERFACE NAME> <IP ADDRESS OF THE WAITING INTERFACE> <IP PREFIX>
Add an ILM entry for LSR tranzit
mpls ingress-ttl <0-255>
Specify a TTL value for LSPs for which this LSR is the ingress
mpls ldp <max-label-value|min-label-value>
Specify label range value for ldp. Possible values from 16 to 1048575
mpls lsp-tunneling <INCOMING INTERFACE NAME> <INCOMING TAG> <OUTGOING TAG> <IP PREFIX>
Tunnel a transit LSP
mpls map-route <IP PREFIX|IP PREFIX/MASK> <IP PREFIX>
Map an IPv4 route
mpls propagate-ttl

Propogate TTL

mpls l2-circuit <имя> <ID> <IP PREFIX>Specify an MPLS Layer-2 Virtual Circuit (type 5)
mpls l2-circuit <имя> <ID> <IP PREFIX> mode tagged svlan <VLAN> tpid <TPID>Specify an MPLS Layer-2 Virtual Circuit (type 4)

Static MPLS configuration

Static MPLS allows to manually configure all operations with labels on the router. ILM and FTN tables are used for storage. The ILM rule settings are used to perform label replacement operations within the MPLS domain. The FTN rule settings are used to hang or cut a label on the edge router of the MPLS domain.

Example of the setting the ILM rule.

ecorouter(config)#mpls ilm-entry 1111 e1 swap 2222 e2 10.0.0.1 2.2.2.2/32

Where 1111 is the label that is expected on the e1 interface; 2222 is the new value of the label and sending it through the interface e2; 10.0.0.1 is the address of the next router (nexthop), and 2.2.2.2/32 is FEC.

For explicit-null and implicit-null, output labels must be 0 and 3, respectively.
Example of the setting the FTN rule.

ecorouter(config)#mpls ftn-entry 2.2.2.2/32 2222 10.0.0.2 e1         

Where 2.2.2.2 / 32 - FEC; 2222 - the label to be hung; 10.0.0.2 - the address of the next router (nexthop); E1 - interface for sending.

LDP

LDP (Label Distribution Protocol) is the protocol of distribution of labels. Labels are generated for all routes in the routing table. All local labels are stored in the LIB. The labels spread in the direction from Egress LER to Ingress LER. Depending on the settings, the distribution of labels can occur either in the Downstream Unsolicited mode - distribution of labels to all neighboring routers at once, or Downstream-on-Demand - distribution of labels on request. The correspondence between the label and the network is sent to all LDP neighbors.

LDP configuration

To start the labels exchange between the routers one need to configure the LDP protocol and enable the labels operating function at the interfaces on the side of the neibourgh MPLS router.

Switch to the context configuration mode and LDP protocol enabling. 

ecorouter(config)#router ldp

After the FEC (Forwarding equivalence class) address of next-hop changed the router generates a new label for this FEC and announce it to neighbors. In case the same label need to be used for the same FEC after next-hop addres changed, enable this option in the context LDP protocol configuration mode.

ecorouter(config)#ldp label preserve

Since the label's lifetime is 30 sec, then next-hop changing must be done during shorter period for correct use of the same label.

Determine the transport address of the router (optional parameter). 

ecorouter(config-router)#transport-address ipv4 <ip-address>

Enable LDP and the labels operating function at the interfaces. 

ecorouter(config-if)#enable-ldp ipv4
ecorouter(config-if)#label-switching
View information about the LDP neighborhood.
ecorouter#sh mpls ldp neighbor

Show Commands

The commands of the administration mode shown in the table below are used to view the configuration and status of the LDP protocol.

Command

Description

show ldp adjacencyLDP adjacency list

show ldp advertise-labels

List IP access lists of advertise-labels

show ldp downstream

View downstream labels distribution

show ldp upstream

View upstream labels distribution

show ldp fec

Forwarding Equivalence Class

show ldp fec-ipv4

IPv4 Forwarding Equivalence Class

show ldp graceful-restartGraceful Restart Status
show ldp igpLDP IGP parameters

show ldp interface

Label-switching status of interface

show ldp lsp

View the label switch path in LDP

show ldp mpls-l2-circuit

Show MPLS Layer-2 Virtual Circuits configuration

show ldp ms-pwMulti-Segment PW information
show ldp routesLDP NSM routes table

show ldp session

LDP session list

show ldp statistics

Show LDP statistics

show ldp targeted-peer

Targeted peer

show ldp targeted-peers

List of targeted peers defined

Pseudowire

Pseudowire (pseudo-wire) or L2-circuit is a virtual private network service for communicating two network segments in a point-to-point manner. Any incoming traffic on the PE router is assigned an MPLS label over which the routing takes place.

L2-circuit configuration

The basic pseudowire setting includes the Label Edge Router (LER) configuration and the Label Switch Router (LSR) configuration.

LSR configurations example.

Creating the loopback interface.

ecorouter(config)#interface loopback.<number>
ecorouter(config-if)#ip address <address/mask>

Going to the LDP configuration mode.

ecorouter(config)#router ldp

Determine the transport address of the router.

ecorouter(config-router)#transport-address ipv4 <ip-address>

Enable LDP and the labels operating function at the interfaces.

ecorouter(config-if)#enable-ldp ipv4
ecorouter(config-if)#label-switching


LER configurations example.

Creating the loopback interface.

ecorouter(config)#interface loopback.<number>
ecorouter(config-if)#ip address <address/mask>

Going to the LDP configuration mode.

ecorouter(config)#router ldp

Determine the transport address of the router.

ecorouter(config-router)#transport-address ipv4 <ip-address>

Determine the target router. Where as the <ip-address> is the network address of the border router to which the l2-circuit will be built.

ecorouter(config-router)#targeted-peer ipv4 <ip-address>

Enable LDP and the labels operating function at the interfaces.

ecorouter(config-if)#enable-ldp ipv4
ecorouter(config-if)#label-switching

L2-circuit is configured depending on the type of circuit being created.

Creating an l2-circuit type 5.

mpls l2-circuit <name> <Identifying value> <ip-address for end-point>
Where as the name of the connection is given the identification name of the connection, <Identifying value> is the number of l2-circuit, <ip-address for end-point> is the address of the boundary router.

Creating l2-circuit type 4.

mpls l2-circuit <name> <Identifying value> <ip-address for end-point> mode tagged svlan <vlan Identifier>

Where is the identification name of the connection as <name>, <Identifying value> is l2-circuit number, <ip-address for end-point> is the edge router address, <vlan Identifier> is the number of the virtual network .

Link the created l2-circuit to the port.

ecorouter(config)#port ge2
ecorouter(config-port)#service-instance ge2/e2
ecorouter(config-service-instance)#encapsulation <tag/untag>
ecorouter(config-service-instance)#mpls-l2-circuit <name>

Where, depending on the type of l2-circuit, the tagged or un-tagged traffic is specified, the parameter <name> is the name of the previously created l2-circuit.

View the status of the l2-circuit. Where <name> is the name of the previously created l2-circuit.

ecorouter#show mpls l2-circuit <name>

Flexible configuration of various operations with VLAN tags on the service-instance allows you to send the packet through the l2-circuit, previously having done these operations with VLAN-tags. This uses the type of encapsulation 5 (ethernet).

The following operations are supported:

Remove an external label from the packet with two labels, before sending it to the MPLS-tunnel:

mpls l2-circuit pop_sv_any_cv 20 2.2.2.2 
!
port te1
 service-instance pop_sv_any_cv
 encapsulation dot1q 40 second-dot1q any
 rewrite pop 1
 mpls-l2-circuit pop_sv_any_cv primary

An internal label can be any (second-dot1q any) or rigidly defined (second-dot1q 100). In the second case, all packets must have an outer label 40 and an internal label 100.. Otherwise, the packet will be discarded.

Remove both marks from the packet before sending them to the MPLS-tunnel:

mpls l2-circuit pop_pop 30 2.2.2.2
!
port te1
 service-instance pop_pop
 encapsulation dot1q 40 second-dot1q 90
 rewrite pop 2
 mpls-l2-circuit pop_pop primary

Remove the external label and replace the internal label with an arbitrary one before sending it to the MPLS-tunnel:

mpls l2-circuit pop_swap 40 2.2.2.2 
!
port te1
 service-instance pop_swap
 encapsulation dot1q 40 second-dot1q 90
 rewrite translate 2-to-1 77
 mpls-l2-circuit pop_swap primary

Add an external label before sending it to the MPLS-tunnel:

mpls l2-circuit push_sv 50 2.2.2.2 
!
port te1
 service-instance push_sv
 encapsulation dot1q 60 exact
 rewrite push 77
 mpls-l2-circuit push_sv primary

Add two labels before sending to the MPLS-tunnel:

mpls l2-circuit push_two 60 2.2.2.2 
!
port te1
 service-instance push_two
 encapsulation untagged
 rewrite push 77 88
 mpls-l2-circuit push_two primary

Replace the external label before sending it to the MPLS-tunnel:

mpls l2-circuit swap_sv 70 2.2.2.2
!
port te1
 service-instance swap_sv
 encapsulation dot1q 40 second-dot1q 90
 rewrite translate 1-to-1 77
 mpls-l2-circuit push_two primary

Replace both labels before sending them to the MPLS-tunnel:

mpls l2-circuit swap_swap 80 2.2.2.2 
!
port te1
 service-instance swap_swap
 encapsulation dot1q 40 second-dot1q 90
 rewrite translate 2-to-2 77 88
 mpls-l2-circuit swap_swap primary

Replace the internal label and add an external label before sending it to the MPLS-tunnel:

mpls l2-circuit swap_push 90 2.2.2.2 
!
port te1
 service-instance swap_push
 encapsulation dot1q 60 exact
 rewrite translate 1-to-2 77 88
 mpls-l2-circuit swap_push primary

Backup Pseudowire

Pseudowire Redundancy (backup pseudowire) allows to configure one of the boundary routers of the MPLS network to detect a network failure and redirect traffic to another endpoint. The function provides the ability to recover from a failure of one of the remote edge routers.

For emergency switching to the standby pseudowire, two L2 tunnels must be configured in the EcoRouter configuration. One of which will act as a backup pseudowire. When transferring traffic over the main L2 tunnel, the backup pseudowire will be in the standby state.

To configure backup pseudowire, you must do the following.

Create loopback interface loopback.0 with network address 1.1.1.1 and mask 32.

ecorouter(config)#interface loopback.0
ecorouter(config-if)#ip address 1.1.1.1/32

Going to the LDP protocol configuration mode. 

ecorouter(config)#router ldp

Determine the transport address of the router.

ecorouter(config-router)#transport-address ipv4 1.1.1.1

Determine the target router. For example, the network address of the destination router will be 2.2.2.2 with mask 32.

ecorouter(config-router)#targeted-peer ipv4 2.2.2.2

Enable the distribution of labels throughout the routing table.

ecorouter(config-router)#pw-status-tlv

Enable LDP and the labels operating function at the interface at the MPLS network side.

ecorouter(config-if)#enable-ldp ipv4
ecorouter(config-if)#label-switching

Farther, configure the main L2 tunnel.
For example, create an l2-circuit type 5 named vc1, Identifying value - 1111.

To do this, create an l2-circuit type 5
.
mpls l2-circuit vc1 1111 2.2.2.2

Configure the backup L2 tunnel, named vc2, Identifying value - 2222.

mpls l2-circuit vc2 2222 2.2.2.2

Bind the l2-circuit created to port ge2, enable the switching function on the main l2-circuit when it is available.

ecorouter(config)#port ge2
ecorouter(config-port)#service-instance ge2/e2
ecorouter(config-service-instance)#encapsulation untag
ecorouter(config-service-instance)#mpls-l2-circuit vc1
ecorouter(config-service-instance)#mpls-l2-circuit vc2
ecorouter(config-service-instance)#vc-mode revertive

BGP and MPLS

This section discusses the implementation of the joint work of the BGP and MPLS protocols based on EcoRouterOS.

The main difference between BGP and IGP when working with MPLS is the absence of labels for BGP routes. When an LSR router receives a BGP route, it passes packets to the BGP neighbor's side, which is indicated as the next hop in the route's announcement, using the created label for the next step. Therefore, there is no need to configure BGP on each router in an autonomous system, it is configured only on the edge routers to which clients or other providers are connected.

Topology

The diagram below shows a classic scenario of the joint operation of the BGP and MPLS protocols, which clearly demonstrates all the advantages of label switching.

In the diagram ECO-1, ECO-2 and R2 routers are in the MPLS cloud, and iBGP is configured between ECO-1 and ECO-2. The R1 and R3 routers connect to the MPLS cloud via eBGP. The local networks of the R1 and R3 routers are represented as loopback-interfaces. One need to create a connection between the local networks of the routers R1 and R3.

Routers configuration

Below is the configuration of the routers to implement this scheme.

ECO-1

ECO-1#sh running-config
!
router ldp
 transport-address ipv4 100.100.100.100
!
mpls map-route 3.3.3.3/32 200.200.200.200/32
!
router ospf 1
 network 10.0.0.0 0.255.255.255 area 0.0.0.0
 network 100.100.100.100 0.0.0.0 area 0.0.0.0
!
router bgp 200
 neighbor 11.0.0.1 remote-as 100
 neighbor 200.200.200.200 remote-as 200
 neighbor 200.200.200.200 update-source loopback.0
 neighbor 200.200.200.200 next-hop-self
!
port te0
 lacp-priority 32767
 mtu 9728
 service-instance te0/e1
  encapsulation untagged
!
port te1
 lacp-priority 32767
 mtu 9728
 service-instance te1/e2
  encapsulation untagged
!
interface loopback.0
 ip mtu 1500
 ip address 100.100.100.100/32
!
interface e2
 ip mtu 1500
 label-switching
 connect port te1 service-instance te1/e2
 ip address 10.12.0.100/16
 ldp enable ipv4
!
interface e1
 ip mtu 1500
 connect port te0 service-instance te0/e1
 ip address 11.0.0.100/16
!
end

ECO-2

ECO-2#sh running-config
!
router ldp
 transport-address ipv4 200.200.200.200
!
mpls map-route 1.1.1.1/32 100.100.100.100/32
!
router ospf 1
 network 10.0.0.0 0.255.255.255 area 0.0.0.0
 network 200.200.200.200 0.0.0.0 area 0.0.0.0
!
router bgp 200
 neighbor 23.0.0.3 remote-as 300
 neighbor 100.100.100.100 remote-as 200
 neighbor 100.100.100.100 update-source loopback.0
 neighbor 100.100.100.100 next-hop-self
!
port te1
 lacp-priority 32767
 mtu 9728
 service-instance te1/e2
  encapsulation untagged
!
port te2
 lacp-priority 32767
 mtu 9728
 service-instance te2/e3
  encapsulation untagged
!
interface loopback.0
 ip mtu 1500
 ip address 200.200.200.200/32
!
interface e3
 ip mtu 1500
 connect port te2 service-instance te2/e3
 ip address 23.0.0.200/16
!
interface e2
 ip mtu 1500
 label-switching
 connect port te1 service-instance te1/e2
 ip address 10.22.0.200/16
 ldp enable ipv4
!
end

R1

R1#sh running-config
!
router bgp 100
 neighbor 11.0.0.100 remote-as 200
 network 1.1.1.1 mask 255.255.255.255
!
port te0
 lacp-priority 32767
 mtu 9728
 service-instance te0/FastEthernet0/0
  encapsulation untagged
!
interface loopback.0
 ip mtu 1500
 ip address 1.1.1.1/32
!
interface FastEthernet0/0
 ip mtu 1500
 connect port te0 service-instance te0/FastEthernet0/0
 ip address 11.0.0.1/16
!
end

R3

R3#sh running-config
!
router bgp 300
 neighbor 23.0.0.200 remote-as 200
 network 3.3.3.3 mask 255.255.255.255
!
port te0
 lacp-priority 32767
 mtu 9728
 service-instance te0/FastEthernet0/0
  encapsulation untagged
!
interface loopback.0
 ip mtu 1500
 ip address 3.3.3.3/32
!
interface FastEthernet0/0
 ip mtu 1500
 connect port te0 service-instance te0/FastEthernet0/0
 ip address 23.0.0.3/16
!
end

R2

R2#sh running-config
!
router ldp
 transport-address ipv4 22.22.22.22
!
mpls map-route 3.3.3.3/32 200.200.200.200/32
!
router ospf 1
  network 10.0.0.0 0.255.255.255 area 0.0.0.0
  network 22.22.22.22 0.0.0.0 area 0.0.0.0
!
port te0
 lacp-priority 32767
 mtu 9728
 service-instance te0/FastEthernet0/1
  encapsulation untagged
!
port te1
 lacp-priority 32767
 mtu 9728
 service-instance te1/FastEthernet0/0
  encapsulation untagged
!
interface loopback.0
 ip mtu 1500
 ip address 22.22.22.22/32
!
interface FastEthernet0/0
 ip mtu 1500
 label-switching
 connect port te1 service-instance te1/FastEthernet0/0
 ip address 10.12.0.2/16
 ldp enable ipv4
!
interface FastEthernet0/1
 ip mtu 1500
 label-switching
 connect port te0 service-instance te0/FastEthernet0/1
 ip address 10.22.0.2/16
 ldp enable ipv4
!
end


For the connectivity between the loopback-interfaces of the R1 and R3 routers, it is not required that BGP is configured on the R2 router and all routes in the routing table are present. With the increasing of the size of the MPLS cloud, this becomes a noticeable advantage to use the technology of labels switching.

Below is the output to the console of the ECO-1 routing table.

ECO-1#sh ip route
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
       O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default
 
IP Route Table for VRF "default"
B       1.1.1.1/32 [20/0] via 11.0.0.1, e1, 19:33:53
B       3.3.3.3/32 [200/0] via 200.200.200.200 (recursive via 10.12.0.2 ), 19:33:40
C       10.12.0.0/16 is directly connected, e2
O       10.22.0.0/16 [110/20] via 10.12.0.2, e2, 19:34:09
C       11.0.0.0/16 is directly connected, e1
C       100.100.100.100/32 is directly connected, loopback.0
O       200.200.200.200/32 [110/30] via 10.12.0.2, e2, 19:33:56

MPLS map

The route to address 3.3.3.3/32, received from the BGP neighbor ECO-2, passes through the MPLS cloud through the device with the address 10.12.0.2. Such routes are called recursive. In order to add an MPLS label for the address of the next-hop BGP neighbor when sending packets to address 3.3.3.3, EcoRouterOS requires explicitly to specify the "MPLS card".

To do this, enter the configuration mode command mpls map-route <IP subnet / subnet mask> <FEC subnet / subnet mask>, where subnets are specified statically. The first parameter in the command is the IP subnet, for which it is necessary to create an MPLS card. The second parameter is FEC for this subnet. FEC (Forwarding Equivalence Class) is a traffic class. In the simplest case, the class identifier is the destination address prefix (in other words, the IP address or destination subnet).
In the above configuration of the ECO-1 router, this action corresponds to the string
:

mpls map-route 3.3.3.3/32 200.200.200.200/32

This configuration line means that when sending a packet to subnet 3.3.3.3/32 for it, one must use a label for the subnet 200.200.200.200/32.

Such static maps more fully describe the topology and operations with frames, which allows reducing the time of searching for problems on the network.