一、拓朴如下:
要求:AR1 走 SRv6 BE 通道,和 AR2 通信
二、配置过程:
1、起core igp,全程配 IPv6 地址,这里我们用 isis
2、使能 SRv6,在 SRv6 下配置 prefix-sid
3、在 IGP 中通告 prefix-sid
4、在 NE1 和 NE4 上起 BGP,并建立 vpnv4 邻居关系
5、边界路由器 PE 配置 vrf,接口划入
6、PE 和 CE 建动态路由,这里用 OSPF,PE 建在 VRF 下面
7、PE 和 CE 做 BGP 和 OSPF 双向注入( BGP 不需要 )
8、SRv6 通过 vpnv4 发布 prefix-sid,隧道迭代进入
三、配置:
[ne1]:
ip vpn-instance A
ipv4-family
route-distinguisher 14:1
apply-label per-instance
vpn-target 14:14 export-extcommunity
vpn-target 14:14 import-extcommunity
#
segment-routing
#
segment-routing ipv6
locator ne1 ipv6-prefix 2001:1:: 96 static 16
opcode ::11 end-dt4 vpn-instance A
opcode ::10 end-op
#
isis 1
is-level level-2
cost-style wide
network-entity 49.0001.0000.0000.0001.00
is-name ne1
#
ipv6 enable topology ipv6
segment-routing ipv6 locator ne1
#
#
interface Ethernet3/0/0
undo shutdown
ipv6 enable
ipv6 address FE80:12::1 link-local
isis enable 1
isis ipv6 enable 1
#
interface Ethernet3/0/1
undo shutdown
ipv6 enable
ipv6 address FE80:13::1 link-local
isis enable 1
isis ipv6 enable 1
#
interface Ethernet3/0/2
undo shutdown
ip binding vpn-instance A
ip address 172.1.1.1 255.255.255.0
#
interface LoopBack0
ipv6 enable
ipv6 address 2001::1/128
isis enable 1
isis ipv6 enable 1
#
bgp 14
router-id 10.1.1.1
private-4-byte-as enable
peer 2001::4 as-number 14
peer 2001::4 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
undo peer 10.1.4.4 enable
#
ipv4-family vpnv4
policy vpn-target
peer 2001::4 enable
peer 2001::4 prefix-sid
#
ipv4-family vpn-instance A
import-route ospf 1
segment-routing ipv6 locator ne1
segment-routing ipv6 best-effort
#
ospf 1 router-id 10.1.1.1 vpn-instance A
import-route bgp permit-ibgp
opaque-capability enable
area 0.0.0.0
network 172.1.1.0 0.0.0.255
#
四、验证:
五、主要配置命令:
segment-routing
segment-routing ipv6 #启用SRv6,并进入SRv6视图下
locator <xx> ipv6-prefix <locator> <locator位数> static <function位数> #在SRv6视图下,配置locator的结构locator + function
opcode ::<function x> end no-flavor|psp|psp-usp-usd...在SRv6的locator视图下,配置本地操作码
ipv6 enable topology ipv6 #在IGP视图下使能 IPv6 多拓朴(NE默认开多拓朴,SR默认开单拓朴)
segment-routing ipv6 locator <locator_name> #在IGP视图下宣告本地的locator
peer <IPv6_BGP_Peer地址> prefix-sid #在 BGP 的vpnv4地址族下,通告本地定义的prefix-sid
dis ipv6 interface <接口> | verbose #查看 ipv6 接口信息
dis isis route ipv6|<ip>|topology
dis segment-routing ipv6 locator #查看本地的locator
dis segment-routing ipv6 local-sid forwarding #查看本地定义的locator转发表项