HCIE-广域承载解决方案专题实验02 SR-MPLS TE

发布时间 2023-09-19 16:49:56作者: Qurare

HCIE-广域承载解决方案专题实验02 SR-MPLS TE

1 实验介绍

1.1 实验拓扑

image-20230908161456598

1.2 需求介绍

  1. 根据IP规划表完成路由设备上的接口IP配置;

  2. 使用OSPF协议实现CE-1和PE-1设备之间的OSPF邻接关系;

  3. 在骨干网PE-1、P1、P2、PE-2之间部署ISIS协议(Level-2),确保骨干网可以正常通信即可;

  4. 在PE设备之间部署MPLS VPN,确保后续完成SR之后两边CE的路由可以互相传递;

  5. 在骨干网上以SR-MPLS TE显示路径方式部署SR部署,并使SR转发路径必定经过PE1、P1、P2、PE2(路径可以是PE1-P1-P2-PE2,也可以是PE1-P2-P1-PE2,并确保来回路径一致

  6. 测试CE设备之间的连通性,并验证转发路径信息是否符合预期;

  7. 对比SR-MPLS BE与SR-MPLS TE的部署差异性;

  8. 尝试进行SR-MPLS TE的头节点算路进行部署SR;

2 配置脚本

接口地址配置省略, 注意PE和CE之间一定要通, 这个有可能会出bug.

2.1 OSPF&配置并绑定VPN实例

PE-1

ip vpn-instance sr
	route-disting 100:1
		vpn-target 111:1 export
		vpn-target 222:2 import
		qu
	qu
int ethe 1/0/0
	dis this
	ip binding vpn-instance sr
	ip add 192.168.1.1 24
	qu
ospf 1 vpn-instance sr
	area 0
		network 192.168.1.1 0.0.0.0
		qu
	qu

PE-2

ip vpn-instance sr
	route-disting 100:2
		vpn-target 222:2 export
		vpn-target 111:1 import
		qu
	qu
int ethe 1/0/0
	dis this
	ip binding vpn-instance sr
	ip add 192.168.2.1 24
	qu
ospf 1 vpn-instance sr
	area 0
		network 192.168.2.1 0.0.0.0
		qu
	qu

CE-1

ospf 1
	area 0
		network 192.168.1.2 0.0.0.0
		network 10.1.1.1 0.0.0.0
		qu
	qu

CE-2

ospf 1
	area 0
		network 192.168.2.2 0.0.0.0
		network 10.2.2.2 0.0.0.0
		qu
	qu

检查vpn实例

dis ip vpn-instance verbose sr

image-20230919110858243

2.2 ISIS

P-1

isis 1
	network-entity 47.0001.0000.0000.0002.00
	is-level level-2
	cost-style wide	#宽模式支持携带路由信息
qu
int ethe 1/0/0
	isis enable 1
	qu
int ethe 1/0/1
	isis enable 1
	qu
int ethe 1/0/3
	isis enable 1
	qu
int loop 0
	isis enable 1
	qu

P-2

isis 1
	network-entity 47.0001.0000.0000.0003.00
	is-level level-2
	cost-style wide
qu
int ethe 1/0/0
	isis enable 1
	qu
int ethe 1/0/2
	isis enable 1
	qu
int ethe 1/0/4
	isis enable 1
	qu
int loop 0
	isis enable 1
	qu

PE-1

isis 1
	network-entity 47.0001.0000.0000.0001.00
	is-level level-2
	cost-style wide
qu
int ethe 1/0/1
	isis enable 1
	qu
int ethe 1/0/2
	isis enable 1
	qu
int loop 0
	isis enable 1
	qu
	

PE-2

isis 1
	network-entity 47.0001.0000.0000.0004.00
	is-level level-2
	cost-style wide
qu
int ethe 1/0/3
	isis enable 1
	qu
int ethe 1/0/4
	isis enable 1
	qu
int loop 0
	isis enable 1
	qu

检查isis邻居和路由表

image-20230908173954671

image-20230908173936907

2.3 BGP-VPNv4&路由引入

PE-1

bgp 65000
	router-id 1.1.1.1
	peer 4.4.4.4 as-number 65000
	peer 4.4.4.4 connect-int loop0
	peer 4.4.4.4 next-hop-local
	ipv4-family vpnv4
		peer 4.4.4.4 enable
		y
		qu
	ipv4-famliy vpn-instance sr
		import-route ospf 1
		qu
	qu
ospf 1
	import-route bgp 
	qu

PE-2

bgp 65000
	router-id 4.4.4.4
	peer 1.1.1.1 as-number 65000
	peer 1.1.1.1 connect-int loop0
	peer 1.1.1.1 next-hop-local
	ipv4-family vpnv4
		peer 1.1.1.1 enable
		y
		qu
	ipv4-family vpn-instance sr
		import-route ospf 1
		qu
	qu
ospf 1
	import-route bgp 
	qu

2.4 SR-MPLS

注意: 不同于MPLS-BE默认开启, MPLS-TE需要在mpls视图中配置

P-1

mpls lsr-id 2.2.2.2
mpls 
	mpls te	#开启mpls对te的支持
	qu
segment-routing
	qu
isis 1
	cost-style wide
	segment-routing mpls
	segment-routing global-block 20000 30000
	traffic-eng level-2	#开启isis L2层设备的TE功能
	qu
int loop0
	isis prefix-sid index 2
	qu
	

P-2

mpls lsr-id 3.3.3.3
mpls 
	mpls te
	qu
segment-routing
	qu
isis 1
	cost-style wide
	segment-routing mpls
	segment-routing global-block 20000 30000
	traffic-eng level-2	
	qu
int loop0
	isis prefix-sid index 3
	qu

PE1

mpls lsr-id 1.1.1.1
mpls 
	mpls te
	qu
segment-routing
	qu
isis 1
	cost-style wide
	segment-routing mpls
	segment-routing global-block 20000 30000
	traffic-eng level-2	
	qu
int loop0
	isis prefix-sid index 1
	qu

PE2

mpls lsr-id 4.4.4.4
mpls 
	mpls te
	qu
segment-routing
	qu
isis 1
	cost-style wide
	segment-routing mpls
	segment-routing global-block 20000 30000
	traffic-eng level-2	
	qu
int loop0
	isis prefix-sid index 4
	qu

此时CE-1与CE-2已经完成连通

image-20230919155953624

image-20230919155958731

2.5 手动配置TE隧道

首先看好前往每台设备的Label, 我们需要定义的路径为:

PE-1 --> P-1 --> P-2 --> PE-2

dis segment-routing prefix mpls forwarding

image-20230919153949634

PE-1

explicit-path 1234	#1234为显式路径名称
	next sid label 20002 type prefix	#使用Prefix或Adjacency编写路径
	next sid label 20003 type prefix
	next sid label 20004 type prefix
	qu
	
int tunnel 0	#创建隧道接口
	ip add unnumbered int loop 0	#使用环回口激活隧道口
	tunnel-protocol mpls te	#隧道协议选择mpls-te
	destination 4.4.4.4	#指定隧道口目的地址
	mpls te tunnel-id 1	#指定隧道id
	mpls te signal-protocol segment-routing	#使用SR作为命令
	mpls te path explicit-path 1234	#绑定创建的显式路径1234
	qu
	
tunnel-policy pe1	#创建路径策略
	tunnel select-seq sr-te load-balance-number 1
	qu
ip vpn-instance sr
	tnl-policy pe1	#调用路径策略
	qu
	
  • next写错了建议将整个显式路径(explicit-path)整个删除
  • 这里隧道接口本身不需要使用到ip地址, 因此可以使用其他接口的ip进行激活, 如此能不浪费ip地址的同时使用隧道接口.
  • 在vpn实例中调用tunnel-policy时只能写tnl-policy

PE-2

explicit-path 4321
	next sid label 20003 type prefix
	next sid label 20002 type prefix
	next sid label 20001 type prefix
	qu
	
int tunnel 0	
	ip add unnumbered int loop 0	
	tunnel-protocol mpls te
	destination 1.1.1.1
	mpls te tunnel-id 1	
	mpls te signal-protocol segment-routing	
	mpls te path explicit-path 4321
	qu
	
tunnel-policy pe2
	tunnel select-seq sr-te load-balance-number 1
	qu
ip vpn-instance sr
	tnl-policy pe2
	qu
	

简单抓个包验证一下

image-20230919161347610

image-20230919161554930

可以看到PE-1在发出数据包后就已经将标签20002剥离(pop), 标签只剩下SR-MPLS标签20003和20004以及MPLS通常标签48122

image-20230919162157726

3 总结问题

3.1 实验缺陷

  1. 在eNSP上由于缺少控制器设备, 导致只能进行全手工配置(极其复杂)TE隧道的实验, 如果有需要可以搭建EVE-NG环境进行实验

    基于EVE-NG的SR-TE技术仿真

3.2 eNSP上NE40e问题

如果你按照我的拓扑搭建, 在搭建过程中, 需要先开启NE40E设备, 然后再开启AR设备, 顺序颠倒可能会导致AR设备与NE40E设备即使直连并配置地址, 且拓扑中两个端口的灯依然是绿色, 两端仍然无法ping通, 此时重启AR设备可以解决这个问题.