两步骤:

1。配置CEF

2。在接口上配置MPLS

---在接口上开启标签交换

---开启分发协议(LDP 或者 TDP)

可选步骤:配置MTU大小

---------------------------------------------------------------------------------

一、配置CEF

非常简单,在配置模式下输入ip cef [distributed]

Router(config)#ip cef

检验命令

show ip cef summary

show ip cef detail

二、配置MPLS

1.在接口上开启标签交换

Router(config-if)#mpls ip

2.选择标签分发协议

在全局模式或接口模式下输入命令mpls label protocol [tdp | ldp | both]

Router(config-if)#mpls label protocol tdp

默认的,路由器用以LDP协议分发标签。

LDP is the default protocol on Cisco IOS software Release 12.4(3) and later. In the older releases, TDP was the default protocol.

检验MPLS:

show tag tdp blindings

show tag forwarding-bable

show ip cef detail

tracertroute *.*.*.*

三、(可选)配置MTU

Optionally, you may change the maximum size of labeled packets. Because of the additional label header, increase the MTU on LAN interfaces to prevent IP fragmentation.

The default MTU size on the LAN segments is 1500 bytes. The size of the MPLS MTU depends on the application you are running with MPLS. When you are using pure MPLS in the backbone,MTU size will increase for one label header only to 1504 bytes. When you are implementing MPLS ×××, MTU size has to increase for two label headers to 1508 bytes. With MPLS ××× with Traffic Engineering (TE), the MTU size should increase for three label headers to 1512 bytes.

The interface MTU is automatically increased on WAN interfaces, but not on LAN interfaces.
Because MTU is not automatically increased on LAN interfaces, you have to increase it
manually using mpls mtu command.

在接口模式下命令mpls mtu bytes,例如:

Router(config-if)#mpls mtu 1512

The minimum MTU is 64 bytes. The maximum depends on the type of interface medium.