MPLS的静态配置
实验环境
如图所示,全网使用OSPF AREA 0连接,并将loopback 0地址宣告进OSPF中,AR1的Loopback 1配置接口192.168.1.1/24,AR4的Loopback 1配置接口192.168.2.1/24,并都宣告如OSPF中。
网络配置规则:router id和mpls lsr-id均为1.1.1.X(X为ARX),在同一个广播域中router id 小的,所使用的网络地址小。

通过MPLS的配置,控制192.168.1.1至192.168.2.1的流量路径为AR1、AR2、AR3、AR4,192.168.2.1至192.168.1.1的流量路径为AR4、AR3、AR5、AR2、AR1。

参考配置
以AR1为例
点击查看代码
#
router id 1.1.1.1
#
mpls lsr-id 1.1.1.1
mpls
#
interface GigabitEthernet0/0/0
ip address 10.1.1.1 255.255.255.0
mpls
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
ospf enable 1 area 0.0.0.0
#
interface LoopBack1
ip address 192.168.1.1 255.255.255.0
ospf enable 1 area 0.0.0.0
#
ospf 1
area 0.0.0.0
network 10.1.0.0 0.0.255.255
#
static-lsp ingress 1to2 destination 192.168.2.1 32 nexthop 10.1.1.2 out-label 100
static-lsp egress 2to1 incoming-interface GigabitEthernet0/0/0 in-label 700
#
点击查看代码
#
mpls lsr-id 1.1.1.2
mpls
#
interface GigabitEthernet0/0/0
ip address 10.1.1.2 255.255.255.0
mpls
#
interface GigabitEthernet0/0/1
ip address 10.1.2.1 255.255.255.0
mpls
#
interface GigabitEthernet0/0/2
ip address 10.1.4.1 255.255.255.0
mpls
#
interface LoopBack0
ip address 1.1.1.2 255.255.255.255
ospf enable 1 area 0.0.0.0
#
ospf 1
area 0.0.0.0
network 10.1.0.0 0.0.255.255
#
static-lsp transit 1to2 incoming-interface GigabitEthernet0/0/0 in-label 100 nexthop 10.1.2.2 out-label 200
static-lsp transit 2to1 incoming-interface GigabitEthernet0/0/2 in-label 600 nexthop 10.1.1.1 out-label 700
#
以AR4为例
点击查看代码
#
router id 1.1.1.4
#
mpls lsr-id 1.1.1.4
mpls
#
interface GigabitEthernet0/0/0
ip address 10.1.3.2 255.255.255.0
mpls
#
interface LoopBack0
ip address 1.1.1.4 255.255.255.255
ospf enable 1 area 0.0.0.0
#
interface LoopBack1
ip address 192.168.2.1 255.255.255.0
ospf enable 1 area 0.0.0.0
#
ospf 1
area 0.0.0.0
network 10.1.0.0 0.0.255.255
#
static-lsp ingress 2to1 destination 192.168.1.1 32 nexthop 10.1.3.1 out-label 400
static-lsp egress 1to2 incoming-interface GigabitEthernet0/0/0 in-label 300
#
本文来自博客园,作者:FuMingyang,转载请注明原文链接:https://www.cnblogs.com/fumingyang/articles/18628666

MPLS的数据转发主要根据FTN(FEC to NHLFE,转发等价类到下一跳标签转发项)、NHLFE(next hop label forwarding entry,下一跳标签转发项)、ILM(incoming label mapping,如标签映射)。三者通过系统自动创建的tunnel ID联系,该值自动分配且仅本地有效。
浙公网安备 33010602011771号