0

I am trying to use MPLS on mininet I was able to install iproute2 and when I try something like this

ip route add 192.168.10.187/32 encap mpls 101 via 10.10.0.187

I get the error:

Error: either "to" is duplicate, or "encap" is a garbage.

Also when I try something like this

ip -f mpls route add 101 dev lo

I get the error:

RTNETLINK answers: Operation not supported

I checked my config file and set all of this, with no success:

CONFIG_NETFILTER_NETLINK=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
CONFIG_NETFILTER_NETLINK_LOG=y
CONFIG_NF_CT_NETLINK=y
CONFIG_SCSI_NETLINK=y
CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_NET_SCH_INGRESS=y
CONFIG_NET_SCHED=y
CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_NETFILTER_XT_TARGET_MARK=y

I have the linux image 4.4.0-97-generic, any help will be greatly appreciated.

UPDATE

After doing some reading I found out that I am missing the directory /proc/sys/net/mpls

UPDATE 2

After doing more digging somehow, don't ask me how, I finally installed the missing module and now I have this error:

RTNETLINK answers: Invalid argument

UPDATE 3

I still have the previous problem stated in UPDATE 2, but I noticed when I try to add a new route, I get no complains and it actually shows on the routing table. However when I do:

ip -f mpls route show

I get no results

  • The `ENOTSUP` message typically comes because the module is not available in the kernel. No mention of the MPLS modules in that config (they're `MPLS_` variables). on the presumption that they're compiled as loadable modules, try loading the routing module using `modprobe mpls_routing` – Anya Shenanigans Oct 23 '17 at 15:15
  • @Petesh I tried that and I got this message: `modprobe: FATAL: Module mpls_routing not found in directory /lib/modules/4.4.0-97-generic` – Rafael Luciano Oct 23 '17 at 19:39
  • you seem to have found the module. There is a pretty good answer here for all the commands: https://stackoverflow.com/questions/31926342/iproute2-commands-for-mpls-configuration – Anya Shenanigans Oct 24 '17 at 08:35
  • @Petesh thanks I was actually reading that post and it works when I add a route but the show command doesn't show anything and I get the same error when trying to uncapsulate or swap labels – Rafael Luciano Oct 25 '17 at 13:22

1 Answers1

1

I think you have to load the kernel mpls modules first,

modprobe mpls_router
modprobe mpls_iptunnel

Then, allow the network interfaces to process mpls labeled packets (disabled by default)

echo 1 > /proc/sys/net/mpls/conf/IFNAME/input

(where IFNAME is the name of the network interface that will send/receive mpls packets)

And finally, specify number of entries that the kernel should allocate for labels (0 by default)

echo 2048 > /proc/sys/net/mpls/platform_labels

or else the iproute2 will gladly process your routes but the kernel won't know any of them (I've been bit by that, too).

References:

Mauro
  • 11
  • 1