一、SRv6 Policy 操作实例
L3VPNv4 over SRv6 Policy
本实例通过华为ENSP Pro进行演示
拓扑图如下:
逻辑图如下:
一、组网需求:SRv6 BE承载L3VPNv4业务路由
1.PE1和PE2设备各有一个CE属于VPN实例vpna。
2.在骨干网络中部署L3VPN迭代SRv6 BE路径,使得CE1和CE2的loopback1接口可以相互通信。
3.PE1和PE2之间建立双向的SRv6 BE路径,承载L3VPN业务
二、配置思路:
1.完成设备接口IPv6地址及IS-IS配置。
2.在PE1与PE2之间建立MP-BGP对等体关系。
3.骨干网上使能Segment Routing,建立SRv6 BE路径。
4.PE上配置使能IPv4地址族VPN实例。
5.PE之间配置MP-IBGP交换路由信息。
6.结果验证。
三、配置过程:
步骤1.完成设备接口IPv6地址及IS-IS配置。
PE1+PE2+P1 配置:
PE1接口配置:
[PE1]dis cur int Ethernet 3/0/0
#
interface Ethernet3/0/0
undo shutdown
ipv6 enable
ipv6 address 2001:DB88:12::1/96
isis ipv6 enable 65000
#
[PE1]dis cur int Ethernet 3/0/0
#
interface Ethernet3/0/0
undo shutdown
ipv6 enable
ipv6 address 2001:DB88:12::1/96
isis ipv6 enable 65000
#
[PE1]dis cur int loo0
#
interface LoopBack0
ipv6 enable
ip address 1.1.1.1 255.255.255.255
ipv6 address 2001:DB88:1::1/128
isis ipv6 enable 65000
#
PE1 ISIS配置:
[PE1]dis cur int loo0
#
interface LoopBack0
ipv6 enable
ip address 1.1.1.1 255.255.255.255
ipv6 address 2001:DB88:1::1/128
isis ipv6 enable 65000
#
PE2 ISIS配置:
[PE2]dis cur con isis
#
isis 65000
is-level level-2
cost-style wide
network-entity 49.0000.0000.0002.00
#
ipv6 enable topology ipv6
#
P1 ISIS 配置:
[P1]dis cur con isis
#
isis 65000
is-level level-2
cost-style wide
network-entity 49.0000.0000.0003.00
#
ipv6 enable topology ipv6
#
Tips:
命令:ipv6 enable topology ipv6
/使能IS-IS进程的IPv6能力/;/配置使用IPv6拓扑进行独立的IPv6路由计算
命令:cost-style wide
/narrow模式不支持携带TE场景下所需的TE信息,故需要配置为wide类型;配置IS-IS的Wide Metric属性/
配置完成后,检查ISIS邻居关系,以PE1举例:
PE1:dis isis peer
检查ISIS peer 是否建立
PE1:dis ipv6 routing-table protocol isis
检查路由
步骤2.在PE1与PE2之间建立MP-BGP对等体关系。
1、在PE设备上配置使能ipv4地址族的VPN实例,将CE接入PE
PE1设备:配置VPN实例和接口
PE1 配置vpn实例和与CE互联接口
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
interface Ethernet3/0/2
undo shutdown
ip binding vpn-instance vpna
ip address 10.0.14.254 255.255.255.0
PE2设备:配置VPN实例和接口
PE2 配置vpn实例和CE互联接口
[PE2]dis cur | sec in vpn
ip vpn-instance vpna
ipv4-family
route-distinguisher 200:1
apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
interface Ethernet3/0/2
undo shutdown
ip binding vpn-instance vpna
ip address 10.0.35.254 255.255.255.0
在PE设备上执行:dis ip vpn-instance verbose 检查VPN实例详情
PE1:dis ip vpn-instance verbose
可以看到VPN实例详细信息.
2、在PE和CE之间建立EBGP邻居关系
PE1配置 BGP
[PE1-bgp]dis cur con bgp
#
bgp 100
router-id 1.1.1.1
private-4-byte-as enable
#
ipv4-family unicast
undo synchronization
#
ipv4-family vpn-instance vpna
import-route direct
peer 10.0.14.1 as-number 65000
#
CE1配置BGP
#
bgp 65000
router-id 10.1.4.4
private-4-byte-as enable
peer 10.0.14.254 as-number 100
#
ipv4-family unicast
network 10.1.4.4 255.255.255.255
peer 10.0.14.254 enable
#
PE2配置BGP
bgp 100
router-id 3.3.3.3
private-4-byte-as enable
#
ipv4-family unicast
undo synchronization
#
ipv4-family vpn-instance vpna
import-route direct
peer 10.0.35.1 as-number 65001
#
CE2 配置BGP
[CE2-bgp]dis th
#
bgp 65001
router-id 10.1.5.5
private-4-byte-as enable
peer 10.0.35.254 as-number 100
#
ipv4-family unicast
network 10.1.5.5 255.255.255.255
peer 10.0.35.254 enable
#
在PE上执行命令:dis bgp vpnv4 vpn-instance vpna peer
检查PE和CE之间EBGP邻居关系是否建立完成
3、在PE1与PE2之间建立MP-BGP对等体关系
PE1配置
[PE1-bgp]dis th
#
bgp 100
router-id 1.1.1.1
private-4-byte-as enable
peer 2001:DB88:3::3 as-number 100
peer 2001:DB88:3::3 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
#
ipv4-family vpnv4
policy vpn-target
peer 2001:DB88:3::3 enable
#
bgp 100
peer 2001:DB88:1::1 as-number 100
peer 2001:DB88:1::1 connect-interface LoopBack0
ipv4-family vpnv4
policy vpn-target
peer 2001:DB88:1::1 enable
PE2配置
[PE2-bgp]dis th
#
bgp 100
router-id 3.3.3.3
private-4-byte-as enable
peer 2001:DB88:1::1 as-number 100
peer 2001:DB88:1::1 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
#
ipv4-family vpnv4
policy vpn-target
peer 2001:DB88:1::1 enable
#
在敲PE之间vpnv4邻居时,需要注意的是peer xxx enable,需要敲 Y 进行确认
检查:在PE设备上执行命令:dis bgp vpnv4 all peer
查看PE之间的MP-IBGP邻居对等体是否建立完成
PE有2个BGP Peer:
- PE之间的MP-IBGP:表示IBGP邻居vpnv4 peer已经建立成功,
- PE与CE之间的EBGP vpn邻居建立成功
步骤3、骨干网上使能Segment Routing,建立SRv6 BE路径。
END.DT4.SID 可以通过BGP动态分配,也可以通过静态进行分配,本实例采用BGP动态分配。
在PE之间建立SRv6 BE 路径
PE1配置如下:SRv6 配置:
PE1:
segment-routing ipv6
encapsulation source-address 2001:DB88:1::1
locator srv6 ipv6-prefix 2001:DB8:100:: 64 static 32
#
bgp 100
ipv4-family vpnv4
policy vpn-target
peer 2001:DB88:3::3 enable
peer 2001:DB88:3::3 prefix-sid
#
isis 65000
segment-routing ipv6 locator srv6
***重点命令***
SRv6配置:
segment-routing ipv6
/使能IPv6转发平面的Segment Routing功能,并且进入SRv6视图/
encapsulation source-address 2001:DB88:1::1
/配置SRv6的报文源地址,一般是loopback0的地址/
locator srv6 ipv6-prefix 2001:DB8:100:: 64 static 32
/配置SID的节点路由段。配置的Locator指定了SID静态段长度,动态SID分配会在去除静态段的SID范围内申请,确保SID不会冲突/
BGP配置:
ipv4-family vpnv4
peer 2001:DB88:3::3 prefix-sid
/执行命令peer ipv6-address prefix-sid,使能与指定IPv6对等体之间交换IPv4 Prefix SID信息/
执行命令peer ipv6-address prefix-sid,使能与指定对等体之间交换Prefix SID信息
ISIS 配置
isis 65000
segment-routing ipv6 locator srv6
/使能IS-IS SRv6能力并且发布Locator srv6的前缀路由;使能IS-IS SRv6能力并指定Locator/
步骤4、PE上使能IPv4地址族的VPN实例
PE1配置
PE1:
ip vpn-instance vpna
ipv4-family
route-distinguisher 100:1
apply-label per-instance
vpn-target 111:1 export-extcommunity
vpn-target 111:1 import-extcommunity
#
PE1 BGP配置
PE1:
bgp 100
ipv4-family vpn-instance vpna
import-route direct
segment-routing ipv6 locator srv6
segment-routing ipv6 best-effort
peer 10.0.14.1 as-number 65000
#
***重点命令***
segment-routing ipv6 locator srv6
/执行命令segment-routing ipv6 locator locator-name ,使能公网路由携带SID属性。/
segment-routing ipv6 best-effort
/执行命令segment-routing ipv6 best-effort,使能根据路由携带的SID属性进行SRv6 BE迭代的功能/
步骤5:结果验证:
PE1上查看路由:
dis ip routing-table vpn-instance vpna
可以看到从PE2学到IBGP路由10.1.5.5,此路由是从PE2下面的CE2学到的,迭代SRv6 BE隧道而来
SRv6 BE其实就是路由。
查看详细VPN路由
命令:dis ip routing-table vpn-instance vpna 10.1.5.5 verbose
VPN 路由10.1.5.5,迭代到SRv6 BE路径。
以路由下一跳:2001:DB8:200::1:0:3 为目的地址查看ipv6路由的详细信息:
命令:dis ipv6 routing-table 2001:DB8:200::1:0:3 verbose
在PE2上查看SRv6所有类型的SID的本地SID信息
命令:dis segment-routing ipv6 local-sid forwarding
SID : 2001:DB8:200::1:0:3/128----End.DT4 SID
PE2在本地生成的End.DT4类型的SID,PE2将该SID发布PE1
在PE1上查看vpnv4路由的详细信息
命令:dis bgp vpnv4 all routing-table 10.1.5.5
From: 2001:DB88:3::3 (3.3.3.3)
对等体的IPv6地址,
在PE1上查看vpn 路由10.1.5.5 详细信息,它的prefix-sid Prefix-sid: 2001:DB8:200::1:0:3
就是从PE2发来的。
VPN路由10.1.5.5 对应的SID和PE2发布过来的是一样的。
Tips:【PE2在本地生成的End.DT4类型的SID,PE2将该SID发布PE1】
检查CE1ping CE2
<CE1>ping -a 10.1.4.4 10.1.5.5
结论:
1、SRv6 BE上承载L3VPNv4业务路由
2、在SRv6、ISIS、BGP配置关键点