Iproute2 Commands for MPLS Configuration

Trying to figure out how iproute2 can be used to manage static MPLS routes with a label in the Linux 4.1 kernel.

I know that iproute2 support for MPLS may not be complete right now [2].

Can anyone shed some light on what iproute2-4.1.1 can currently do?

This is what I have found so far:

Documentation / Network / MPLS-sysctl.txt

/ Transactions / systems / net / MPLS / platform_labels / proc / sys / net / mpls / conf // input

Download the mpls module

sudo modprobe mpls_router 

Find sysctl support

 sysctl -a --pattern mpls net.mpls.conf.eth0.input = 0 net.mpls.conf.eth1.input = 0 net.mpls.conf.lo.input = 0 net.mpls.platform_labels = 0 

Enable mpls support

 sudo sysctl -w net.mpls.conf.eth0.input=1 sudo sysctl -w net.mpls.conf.eth1.input=1 sudo sysctl -w net.mpls.platform_labels=1000 

push??? (how to add a prefix-to-push action?)

 sudo ip route add 1.1.1.1/32 via mpls 100/200/300 dev eth0 

swap ??? (how to add a shortcut change action?)

 sudo ip -f mpls route add 10 via mpls 100/200/300 dev eth0 

pop ??? (how to add label-pop action?)

???

show ??? (how to display label switched routes?)

???

Can someone help me. Thanks at Advance.

+7
linux linux-kernel netlink routing iproute
source share
1 answer

A bit late, but hope this helps someone. You can find them here :

Routing 10.10.10.10/32 - 192.168.1.2 labeled 100:

 ip route add 10.10.10.10/32 encap mpls 100 via inet 192.168.1.2 

Shortcut exchange 100 to 200 and sent to 192.168.2.2:

 ip -f mpls route add 100 as 200 via inet 192.168.2.2 

Decapsulating the 300 tag and delivering locally:

 ip -f mpls route add 300 dev lo 

To show MPLS routes, you can:

 ip -f mpls route show 

If your version of iproute2 does not support these commands, you can get it here:

https://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-4.6.0.tar.gz

And then

 ./configure && make && make install 
+5
source share

All Articles