Page MenuHomeVyOS Platform

MPLS Support
Needs testing, LowPublicFEATURE REQUEST

Description

hi,

recent linux kernel have mpls support included. frr builds in vyos have also mpls support included and the iproute2 on vyos is also mpls ready.
Documentation:

http://www.samrussell.nz/2015/12/mpls-testbed-on-ubuntu-linux-with.html
http://docs.frrouting.org/en/latest/zebra.html#mpls-commands

in 1.2.x frr raised an error cause the kernel is lacking mpls support...

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close

Related Objects

StatusSubtypeAssignedTask
Needs testingFEATURE REQUESTNone
ResolvedFEATURE REQUESTc-po
OpenFEATURE REQUESTNone

Event Timeline

rherold created this task.Oct 18 2018, 9:09 AM
syncer triaged this task as Low priority.Oct 18 2018, 9:16 AM

Second this. Came here looking for MPLS support as its supported in FRR.

I can see on boot that it displays the message ZEBRA: Disabling MPLS support (no kernel support)

pasik added a subscriber: pasik.Mar 12 2019, 6:09 PM

hi,

I want write an follow up.

We have here some tasks todo:

  1. Enable MPLS Support in Kernel
  2. Make protocol ldp configurable see: http://docs.frrouting.org/en/latest/ldpd.html
  3. Extend ospf an bgp protocol configurable
syncer added a subscriber: syncer.

Ok,
the first step is done

maznu added a subscriber: maznu.Sep 23 2019, 3:24 PM
c-po moved this task from Need Triage to Backlog on the VyOS 1.3 Equuleus board.Oct 13 2019, 3:07 PM

MPLS requires Linux Kernel 4.5 or higher (LDPcan be built, but may have limited use without MPLS).
Ref https://readthedocs.org/projects/frrouting-developers-guide/downloads/pdf/latest/

Viacheslav added a comment.EditedJan 9 2020, 10:11 AM

First tests for MPLS.
Latest rolling releases is supported it.

Load mpls modules and turn on it in sysctl.

sudo modprobe mpls_router
sudo modprobe mpls_gso
sudo modprobe mpls_iptunnel

sudo sysctl -w net.mpls.conf.eth0.input=1
sudo sysctl -w net.mpls.conf.eth1.input=1
sudo sysctl -w net.mpls.conf.lo.input=1
sudo sysctl -w net.mpls.platform_labels=1048575
sudo sysctl -w net.ipv4.conf.all.rp_filter=2

Enable ldpd daemon in frr.

vyos@mpls:~$ sudo cat /etc/frr/daemons | grep ldp
ldpd=yes
ldpd_options="  --daemon -A 127.0.0.1"

Restart frr

vyos@mpls:~$ restart frr

vtysh

router ospf
 ospf router-id 2.2.2.2
 network 0.0.0.0/0 area 0
!
mpls ldp
 router-id 2.2.2.2
 neighbor 3.3.3.3 password test
 !
 address-family ipv4
  discovery transport-address 2.2.2.2
  !
  interface eth1
  !
  interface lo
  !
 exit-address-family
 !
!

Show routing table with label.

vyos@mpls:~$ show ip route | match label
O>* 3.3.3.3/32 [110/1] via 192.168.122.172, eth0, label implicit-null, 00:09:28
O>* 192.168.3.0/25 [110/1001] via 192.168.122.172, eth0, label implicit-null, 00:09:28
vyos@mpls:~$

Vtysh show mpls table

mpls# show mpls table 
 Inbound Label  Type  Nexthop          Outbound Label  
 ------------------------------------------------------
 16             LDP   192.168.122.172  implicit-null   
 17             LDP   192.168.122.172  implicit-null   

mpls# 
mpls# show mpls ldp neighbor 
AF   ID              State       Remote Address    Uptime
ipv4 3.3.3.3         OPERATIONAL 3.3.3.3         00:11:54
mpls#

Tcpdump

vyos@mpls:~$ sudo tcpdump -ni eth1 port 646
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes
10:12:41.911859 IP 192.168.1.3.646 > 224.0.0.2.646: LDP, Label-Space-ID: 3.3.3.3:0, pdu-length: 38
10:12:43.279738 IP 192.168.1.1.646 > 224.0.0.2.646: LDP, Label-Space-ID: 2.2.2.2:0, pdu-length: 38
10:12:46.914300 IP 192.168.1.3.646 > 224.0.0.2.646: LDP, Label-Space-ID: 3.3.3.3:0, pdu-length: 38
10:12:48.281244 IP 192.168.1.1.646 > 224.0.0.2.646: LDP, Label-Space-ID: 2.2.2.2:0, pdu-length: 38

Need tests from community.
Someone can help in writing the correct cli ?

Dmitry added a subscriber: Dmitry.Jan 10 2020, 8:43 AM

PR https://github.com/vyos/vyos-1x/pull/203
Adding commands for show mpls

vyos@mpls:~$ show mpls table 
 Inbound Label  Type  Nexthop      Outbound Label  
 --------------------------------------------------
 16             LDP   192.168.1.1  implicit-null   
 17             LDP   192.168.1.1  implicit-null 

vyos@mpls:~$ show mpls ldp neighbor 
AF   ID              State       Remote Address    Uptime
ipv4 2.2.2.2         OPERATIONAL 2.2.2.2         01:39:16

vyos@mpls:~$ show mpls ldp interface 
AF   Interface   State  Uptime   Hello Timers  ac
ipv4 eth0        ACTIVE 01:44:05 5/15           1
ipv4 lo          ACTIVE 01:44:05 5/15           1

This is working nicely, many thanks!

I stumbled whilst attempting to enable mpls on vlan interfaces though, due to sysctl replacing all periods with forward slashed.

We use the following VyOS configuration command to create VLAN sub interfaces:

set interfaces ethernet eth0 vif 35 address 192.0.2.6/30

Populating /etc/sysctl.conf with 'net.mpls.conf.eth0.35.input = 1' and then applying changes (sysctl -p) results in it attempting to set /proc/sys/net/mpls/conf/eth0/35/input, which doesn't exist. Couldn't find a way to escape the period so worked around the issue by adding the following lines to the VyOS post configuration bootup script.

/config/scripts/vyos-postconfig-bootup.script

#!/bin/sh
# Enable MPLS on all interfaces:
for dev in /proc/sys/net/mpls/conf/*/input; do echo 1 > $dev; done

Automatically load required kernel modules to support MPLS by creating /etc/modules-load.d/vyatta_mpls.conf:

mpls_gso
mpls_iptunnel
mpls_router

PS: Unrelated but VyOS disregards 'set interfaces ethernet eth0 vif 35 ip source-validation 'loose'' so we set 'all' and 'default' to function in RPF loose mode (2) with the following sysctl.conf

# Enable MPLS via '/config/scripts/vyos-postconfig-bootup.script'
net.mpls.platform_labels = 1048575

# Do not copy IP TTL to MPLS header
net.mpls.ip_ttl_propagate = 0

# VyOS disregards interface 'ip source-validation' configuration
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2

vtysh commands:

mpls ldp
 router-id 192.0.2.45
 !
 address-family ipv4
  discovery transport-address 192.0.2.45
  label local allocate host-routes
  !
  interface eth0.35
   discovery hello holdtime 10
   discovery hello interval 1
  !
  interface eth0.37
   discovery hello holdtime 10
   discovery hello interval 1
  !
  interface eth0.39
   discovery hello holdtime 10
   discovery hello interval 1
  !
 exit-address-family
 !
!

Regards
David Herselman

@bbs2web you can try use sysctl params from set

set interfaces ethernet eth1 vif 35 address '10.35.35.1/30'
set system sysctl custom net.mpls.conf.eth1/35.input value '1'
# sudo sysctl -a --pattern mpls
net.mpls.conf.eth0.input = 1
net.mpls.conf.eth1.input = 1
net.mpls.conf.eth1/35.input = 1
net.mpls.conf.lo.input = 1
net.mpls.default_ttl = 255
net.mpls.ip_ttl_propagate = 1
net.mpls.platform_labels = 1048575

In the future, I think these commands will be executed automatically based on the CLI logic.

Many thanks again, I much prefer having interface specific settings in a single place instead of arbitrary script locations.

As a point of reference, herewith equivalent MPLS configuration commands for DANOS vRouter (old Brocade vRouter, based on Vyatta Subscription Edition (VSE)) which also now uses FRRouting:

set protocols mpls-ldp address-family ipv4 discovery interfaces interface dp0s18.35 hello-holdtime 10
set protocols mpls-ldp address-family ipv4 discovery interfaces interface dp0s18.35 hello-interval 1
set protocols mpls-ldp address-family ipv4 discovery interfaces interface dp0s18.37 hello-holdtime 10
set protocols mpls-ldp address-family ipv4 discovery interfaces interface dp0s18.37 hello-interval 1
set protocols mpls-ldp address-family ipv4 discovery interfaces interface dp0s18.39 hello-holdtime 10
set protocols mpls-ldp address-family ipv4 discovery interfaces interface dp0s18.39 hello-interval 1
set protocols mpls-ldp address-family ipv4 label-policy allocate host-routes
set protocols mpls-ldp address-family ipv4 transport-address 192.0.2.45
set protocols mpls-ldp lsr-id 192.0.2.45

I’ll mark it here for the future. "ldpd 100% CPU utilization"
ref_cpu_utilization

Some tests results

vyos@R8:~$ show configuration commands | match mpls
set protocols mpls ldp discovery transport-ipv4-address '2.2.2.2'
set protocols mpls ldp interface 'eth1'
set protocols mpls ldp interface 'eth2'
set protocols mpls ldp router-id '2.2.2.2'
vyos@R8:~$ show mpls ldp neighbor 
AF   ID              State       Remote Address    Uptime
ipv4 10.0.0.1        OPERATIONAL 10.0.0.1        00:00:22
ipv4 3.3.3.3         OPERATIONAL 10.0.255.2      00:00:33
vyos@R8:~$ show mpls ldp interface 
AF   Interface   State  Uptime   Hello Timers  ac
ipv4 eth1        ACTIVE 00:00:51 5/15           1
ipv4 eth2        ACTIVE 00:00:52 5/15           1

vyos@R8:~$ show mpls table 
 Inbound Label  Type  Nexthop     Outbound Label  
 -------------------------------------------------
 16             LDP   10.0.255.2  implicit-null   
 17             LDP   10.0.0.1    implicit-null   

vyos@R8:~$ sudo tcpdump -n -i eth1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes
22:53:30.943787 MPLS (label 16, exp 0, [S], ttl 64) IP 1.1.1.1 > 3.3.3.3: ICMP echo request, id 12228, seq 13, length 64
22:53:30.950979 IP 10.0.0.2.646 > 224.0.0.2.646: LDP, Label-Space-ID: 2.2.2.2:0, pdu-length: 38
22:53:30.951170 IP 3.3.3.3 > 1.1.1.1: ICMP echo reply, id 12228, seq 13, length 64
22:53:31.944912 MPLS (label 16, exp 0, [S], ttl 64) IP 1.1.1.1 > 3.3.3.3: ICMP echo request, id 12228, seq 14, length 64
22:53:31.956304 IP 3.3.3.3 > 1.1.1.1: ICMP echo reply, id 12228, seq 14, length 64
22:53:32.636023 IP 10.0.0.2 > 224.0.0.5: OSPFv2, Hello, length 48
22:53:32.640385 IP 10.0.0.1.646 > 224.0.0.2.646: LDP, Label-Space-ID: 10.0.0.1:0, pdu-length: 38
22:53:32.947048 MPLS (label 16, exp 0, [S], ttl 64) IP 1.1.1.1 > 3.3.3.3: ICMP echo request, id 12228, seq 15, length 64
22:53:32.954004 IP 3.3.3.3 > 1.1.1.1: ICMP echo reply, id 12228, seq 15, length 64
Dmitry changed the task status from Open to Needs testing.Thu, Mar 19, 12:57 PM

Dmitry,

hi,
Please show router configurations, VyOS_R7, VyOS_R8, VyPS_R9.
I tried mpls configuration as your sample, but I could not establish ldp neighbor.

My testing version is "VyOS 1.3-rolling-202004040117".

Dmitry added a comment.Sun, Apr 5, 7:31 AM

Hi @Shakapon

vyos@R7# run show configuration commands | match "mpls|address|ospf"
set interfaces dummy dum0 address '1.1.1.1/32'
set interfaces ethernet eth1 address '10.0.0.1/24'
set protocols mpls ldp discovery transport-ipv4-address '1.1.1.1'
set protocols mpls ldp interface 'eth1'
set protocols mpls ldp router-id '1.1.1.1'
set protocols ospf area 0 network '0.0.0.0/0'
set protocols ospf parameters abr-type 'cisco'
set protocols ospf parameters router-id '1.1.1.1'
set interfaces dummy dum0 address '2.2.2.2/32'
set interfaces ethernet eth1 address '10.0.0.2/24'
set interfaces ethernet eth2 address '10.0.255.1/24'
set protocols mpls ldp discovery transport-ipv4-address '2.2.2.2'
set protocols mpls ldp interface 'eth1'
set protocols mpls ldp interface 'eth2'
set protocols mpls ldp router-id '2.2.2.2'
set protocols ospf area 0 network '0.0.0.0/0'
set protocols ospf parameters abr-type 'cisco'
set protocols ospf parameters router-id '2.2.2.2'
set interfaces dummy dum0 address '3.3.3.3/32'
set interfaces ethernet eth1 address '10.0.255.2/24'
set protocols mpls ldp discovery transport-ipv4-address '3.3.3.3'
set protocols mpls ldp interface 'eth1'
set protocols mpls ldp router-id '3.3.3.3'
set protocols ospf area 0 network '0.0.0.0/0'
set protocols ospf parameters abr-type 'cisco'
set protocols ospf parameters router-id '3.3.3.3'

Hi, Dmitry

Thanks a lot!
I also connected ldp neighbor.

I need to delete this configuration.

set interfaces dummy dum0 address '1.1.1.1/32'
delete interfaces loopback lo address 1.1.1.1/32 
delete protocols ospf redistribute connected route-map CONNECT
delete policy route-map CONNECT rule 10 action permit
delete policy route-map CONNECT rule 10 match interface lo

This configuration is referenced by VyOS Wiki.