本文介绍了iproute2命令用于MPLS配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图弄清楚如何使用iproute2在Linux内核4.1中管理静态的标签交换MPLS路由.

Trying to figure out how one can use iproute2 to manage static label-switched MPLS routes in Linux kernel 4.1.

我知道iproute2对MPLS的支持现在可能还不完整[2].

I am aware iproute2 support for MPLS might be incomplete right now [2].

任何人都可以阐明iproute2-4.1.1当前可以执行的操作吗?

Can anyone please shed some light on what iproute2-4.1.1 is currently able to do?

这是我到目前为止发现的:

This is what I have found so far:

/proc/sys/net/mpls/platform_labels/proc/sys/net/mpls/conf//input

/proc/sys/net/mpls/platform_labels/proc/sys/net/mpls/conf//input

sudo modprobe mpls_router

查找sysctl支持

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

启用mpls支持

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

推??? (如何添加前缀到推送操作?)

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

交换??? (如何添加标签交换操作?)

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

流行音乐??? (如何添加标签弹出动作?)

???

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

???

???

有人可以帮我吗?预先感谢.

Can someone help me out .Thanks in Advance.

推荐答案

有点为时已晚,但希望对您有所帮助.您可以在此处找到它们:

A little bit too late, but hope it helps somebody. You can find them here:

将带有标签100的10.10.10.10/32路由到192.168.1.2:

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

标签将100交换为200,并发送到192.168.2.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

解封标签300并在本地交付:

Decapsulating label 300 and delivering locally:

ip -f mpls route add 300 dev lo

要显示MPLS路由,您可以执行以下操作:

To show MPLS routes you can do:

ip -f mpls route show

如果您的iproute2版本不支持这些命令,则可以从此处获取:

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

然后

./configure && make && make install

这篇关于iproute2命令用于MPLS配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 02:11