iproute2 commands for MPLS configuration
A little bit too late, but hope it helps somebody. You can find them here:
Routing 10.10.10.10/32 to 192.168.1.2 with label 100:
ip route add 10.10.10.10/32 encap mpls 100 via inet 192.168.1.2
Label swapping 100 for 200 and sent to 192.168.2.2:
ip -f mpls route add 100 as 200 via inet 192.168.2.2
Decapsulating label 300 and delivering locally:
ip -f mpls route add 300 dev lo
To show MPLS routes you can do:
ip -f mpls route show
If your iproute2 version doesn't support those commands, you can get it from here:
https://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-4.6.0.tar.gz
And then
./configure && make && make install
Add MPLS attributes in NETLINK Messages
According to net/mpls/af_mpls.c:rtm_to_route_config()
, the label should be provided with RTA_DST
NLA.
Pls notice also assertions in the function, they're quite strict.
Related Topics
How to Clear All History in Linux/Ubuntu Terminal or Bash Permanently
How to Delete History of Last 10 Commands in Shell
Graphical Diff Programs for Linux
How to Delete Multiple Files at Once in Bash on Linux
How to Extract Files Without Folder Structure Using Tar
How to Get Hostname from Ip (Linux)
Custom Linux Gui: Where to Begin
Implementing an Update/Upgrade System for Embedded Linux Devices
How to Get Diff Between All Files Inside 2 Folders That Are on the Web
How to Run Vi on Docker Container
How to Install Crontab on Centos
How to Copy Text from My Xterm Without a Mouse
How to Create a Directory and Give Permission in Single Command
How to Enable Scrolling in Tmux Panels with Mouse Wheel
About Process Control Block in Os