组网需求
如图所示,PC1、PC3属于vpn1,PC2、PC4属于vpn2。其中vpn1的vpn-target属性为100:10,vpn2的vpn-target属性为100:20,现配置SR-MPLS,TE的隧道接口引流方式将PC1和PC3的互访流量迭代到隧道Tunnel1,,将vpn2PC2PC4互访流量迭代到隧道Tunnel2来实现流量转发路径的编排。
(1)结合基于Node,Segment的转发路径来控制PC1与PC3流量互访路径,即PC1访问PC3的路径为:
NE1->NE2->NE3-NE4(拓扑图中红色虚线流量走向)
;PC3访问PC1的路径为:
NE4->NE3->NE2->NE1(拓扑图中红色虚线流量走向)
;
(2)结合基于Adjacency,Segment的转发路径来控制PC2和PC4流量互访路径,即PC2访问PC4的路径为:
NE1->NE3->NE2-NE4(拓扑图中绿色虚线流量走向)
;PC4访问PC2的路径为:
NE4->NE2->NE3->NE1(拓扑图中绿色色虚线流量走向)
。
组网拓扑
配置思路
配置步骤:
步骤1:
骨干网上配置IS-IS实现NE1,NE2,NE3,NE4的IGP路由互通,配置完成后验证IS-IS邻居状态、路由信息、网络连通性,以NE1配置为例。
undodcnsysnameNE1isisis-levellevel-2network-entity50.0001.0000.0000.0001.00interfaceLoopBack0ipaddress1.1.1.1255.255.255.255isisenableinterfaceEthernet1/0/0ipaddress10.1.12.1255.255.255.252isisenableisiscircuit-typep2pisiscircuit-levellevel-2interfaceEthernet1/0/1ipaddress10.1.13.1255.255.255.252isisenableisiscircuit-typep2pisiscircuit-levellevel-2
步骤2:
骨干网上使能MPLS,MPLS,TE,配置Segment,Routing,建立SR-MPLS,TE隧道,指定隧道的IP地址、隧道协议、以及目的地址等,路径计算采用显式路径。
(1)配置MPLS、MPLS,TE、Segment,Routing,以NE1配置为例。
mplslsr-id1.1.1.1mpls//使能mpls,当接口下使能IS-IS功能后,接口自动使能MPLS能力,所以可以忽略接口下MPLS配置。mplste//使能mplstesegment-routing//使能segment-routingisisis-levellevel-2cost-stylewide//cost类型network-entity50.0001.0000.0000.0001.00//配置network-entity地址traffic-englevel-2//配置traffic-eng级别segment-routingmpls//使能IS-IS的SegmentRouting功能。segment-routingglobal-block//配置SRGB标签范围interfaceLoopBack0ipaddress1.1.1.1255.255.255.255isisenableisisprefix-sidindex//配置前缀索引号
步骤3:
NE1和NE4上配置使能IPv4地址族VPN实例,并把与PC互连的接口和相应的VPN实例绑定,以NE1为例。
ipvpn-instancevpn1ipv4-familyroute-distinguisher:10vpn-target:10export-extcommunityvpn-target:10import-extcommunityipvpn-instancevpn2ipv4-familyroute-distinguisher:20vpn-target:20export-extcommunityvpn-target:20import-extcommunityinterfaceEthernet1/0/2ipbindingvpn-instancevpn1ipaddress192.168.10.254255.255.255.0interfaceEthernet1/0/3ipbindingvpn-instancevpn2ipaddress192.168.20.254255.255.255.0
步骤4:
NE1和NE4之间配置MP-IBGP交换路由信息。
bgprouter-id1.1.1.1peer4.4.4.4as-numberpeer4.4.4.4connect-interfaceLoopBack0ipv4-familyunicastundosynchronizationpeer4.4.4.4enableipv4-familyvpnv4policyvpn-targetpeer4.4.4.4enableipv4-familyvpn-instancevpn1import-routedirectipv4-familyvpn-instancevpn2import-routedirect
bgprouter-id4.4.4.4peer1.1.1.1as-numberpeer1.1.1.1connect-interfaceLoopBack0ipv4-familyunicastundosynchronizationpeer1.1.1.1enableipv4-familyvpnv4policyvpn-targetpeer1.1.1.1enableipv4-familyvpn-instancevpn1import-routedirectipv4-familyvpn-instancevpn2import-routedirect
-使用dis,bgp,vpnv4,all,routing-table命令查看是否收到MP-IBGP邻居发送来的vpnv4路由。
从上图中可以看到从NE1去往“192.168.30.0”有2条等价路由,路由是通过IS-IS路由协议SPF算法计算出去往下一跳4.4.4.4是等价的,即通过下一跳迭代实现IBGP路由的等价负载分担;,而SR-MPLS,BE使用SID来指导设备基于最短路径进行数据转发,这种工作机制称为SR-MPLS,BE(Best,Effort),例如在本例中使用NE4的Node,SID,16040可以指导数据沿着去往NE4的最短路径来转发数据,该最短路径是基于路由协议计算得出的,并且支持等价路径。SR-MPLS,BE是一种替代“LDP+IGP方案”的一种新方案
使用192.168.10.1,ping,192.168.30.1抓包分析,最外层标签为NE4的Node,SID,16040,内层标签48063为MG-IBGP为192.168.30.0分配的私网标签,此时PC1去往PC3的报文走的是SR-MPLS,BE(尽力而为)的LSP隧道
。
步骤5
:通过配置SR-MPLS,TE对流量转发路径进行编排,配置SR-MPLS,TE的隧道接口引流方式将PC1和PC3的互访流量迭代到隧道Tunnel1,,PC2和PC4互访流量迭代到隧道Tunnel2。
(1)结合基于Node,Segment的转发路径来控制PC1与PC3流量互访路径,即PC1访问PC3的路径为:
NE1->NE2->NE3-NE4
;PC3访问PC1的路径为:
NE4->NE3->NE2->NE1
;
(2)结合基于Adjacency,Segment的转发路径来控制PC2和PC4流量互访路径,即PC2访问PC4的路径为:
NE1->NE3->NE2-NE4
;PC4访问PC2的路径为:
NE4->NE2->NE3->NE1
。
(1)配置显示路径explicit-pathR1234//采用NodeSegment方式来配置显示路径nextsidlabeltypeprefixnextsidlabeltypeprefixnextsidlabeltypeprefixexplicit-pathR1324//采用AdjacencySegmentt方式来配置显示路径nextsidlabeltypeadjacencynextsidlabeltypeadjacencynextsidlabeltypeadjacency(2)配置隧道接口Tunnel1和Tunnel2interfaceTunnel1ipaddressunnumberedinterfaceLoopBack0tunnel-protocolmplstedestination4.4.4.4mplstesignal-protocolsegment-routingmplstereserved-for-bindingmplstetunnel-idmplstepathexplicit-pathR1234//指定显示路径R1234interfaceTunnel2ipaddressunnumberedinterfaceLoopBack0tunnel-protocolmplstedestination4.4.4.4mplstesignal-protocolsegment-routingmplstereserved-for-bindingmplstetunnel-idmplstepathexplicit-pathR1324//指定显示路径R1324(3)配置隧道策略tunnel-policytunnel-policyp1tunnelbindingdestination4.4.4.4teTunnel1//采用隧道和策略绑定方式配置tunnel-policyp2tunnelbindingdestination4.4.4.4teTunnel2//采用隧道和策略绑定方式配置(4)vpn实例的ipv4地址族下引用隧道策略tunnel-policyipvpn-instancevpn1ipv4-familyroute-distinguisher:10tnl-policyp1//引用隧道策略p1vpn-target:10export-extcommunityvpn-target:10import-extcommunityipvpn-instancevpn2ipv4-familyroute-distinguisher:20tnl-policyp2//引用隧道策略p2vpn-target:20export-extcommunityvpn-target:20import-extcommunity
(1)配置显示路径explicit-pathR4321//采用NodeSegment方式来配置显示路径nextsidlabeltypeprefixnextsidlabeltypeprefixnextsidlabeltypeprefixexplicit-pathR4231//采用AdjacencySegmentt方式来配置显示路径nextsidlabeltypeadjacencynextsidlabeltypeadjacencynextsidlabeltypeadjacency(2)配置隧道接口Tunnel1和Tunnel2interfaceTunnel1ipaddressunnumberedinterfaceLoopBack0tunnel-protocolmplstedestination1.1.1.1mplstesignal-protocolsegment-routingmplstereserved-for-bindingmplstetunnel-idmplstepathexplicit-pathR4321//指定显示路径R4321interfaceTunnel2ipaddressunnumberedinterfaceLoopBack0tunnel-protocolmplstedestination1.1.1.1mplstesignal-protocolsegment-routingmplstereserved-for-bindingmplstetunnel-idmplstepathexplicit-pathR4231//指定显示路径R4231(3)配置隧道策略tunnel-policytunnel-policyp1tunnelbindingdestination1.1.1.1teTunnel1//采用隧道和策略绑定方式配置tunnel-policyp2tunnelbindingdestination1.1.1.1teTunnel2//采用隧道和策略绑定方式配置(4)vpn实例的ipv4地址族下引用隧道策略tunnel-policyipvpn-instancevpn1ipv4-familyroute-distinguisher:10tnl-policyp1//引用隧道策略p1vpn-target:10export-extcommunityvpn-target:10import-extcommunityipvpn-instancevpn2ipv4-familyroute-distinguisher:20tnl-policyp2//引用隧道策略p2vpn-target:20export-extcommunityvpn-target:20import-extcommunity
查看SR-MPLS,TE隧道状态
查看vpn实例路由。。出接口都为SR-MPLS,TE隧道接口Tunnel
使用192.168.10.1,ping,192.168.30.1,在NE1与NE2互联接口Ethernet,1/0/0抓包分析,路由器上根据SR-MPLS,TE隧道LSP对应的标签栈,对报文进行标签操作,并根据栈顶标签逐跳查找转发出接口,指导数据报文转发到隧道目的地址.192.168.10.1通过Ethernet,1/0/0接口去往192.168.30.1的icmp,request报文发出时,已将10620的标签弹出,数据包中只有10630和1640的标签栈,数据包的转发路径为NE1->NE2->NE3->NE4.
反之,在NE4与NE3互联接口Ethernet,1/0/1抓包分析,192.168.30.1通过Ethernet,1/0/1接口去往192.168.10.1的icmp,reply报文发出时,已将10630的标签弹出,数据包中只有10620和1610的标签栈,数据包的转发路径为NE4->NE3->NE2->NE1.
使用192.168.20.1,ping,192.168.40.1,在NE1与NE3互联接口Ethernet,1/0/1抓包分析,路由器上根据SR-MPLS,TE隧道LSP对应的标签栈,对报文进行标签操作,并根据栈顶标签逐跳查找转发出接口,指导数据报文转发到隧道目的地址.192.168.20.1通过Ethernet,1/0/1接口去往192.168.40.1的icmp,request报文发出时,已将48020的标签弹出,数据包中只有48022和48021的标签栈,数据包的转发路径为NE1->NE3->NE2->NE4.
反之,在NE4与NE2互联接口Ethernet,1/0/0抓包分析,192.168.40.1通过Ethernet,1/0/0接口去往192.168.20.1的icmp,reply报文发出时,已将48021的标签弹出,数据包中只有48020和48021的标签栈,数据包的转发路径为NE4->NE2->NE3->NE1.