组网要求
RA,RB,RC,和RD通过BGP协议实现网络互联。要求链路B(A-B-D)正常时,RA和RD之间的流量通过B转发,当链路B出现故障时快速切换到链路A(A-C-D)上。
1配置各接口IP地址
2在AS200内配置OSPFV3,发布接口地址所在的网段的路由,确保RB,RC和RD之间IPV6路由可达。
3配置BGP连接
#配置RA 分别与RB和RC建立EBGP会话,并配置通过BGP发布路由1:: /64
1-2配置:
RA
sys
int lo0
ipv6 add 1::1 64
ip add 1.1.1.1 32
int g0/1
ipv6 add 3001::1 64
int g0/2
ipv6 add 2001::1 64
quit
RB
sys
sysname RB
ospfv3 1
router-id 2.2.2.2
quit
int lo0
ip add 2.2.2.2
int g0/2
ipv6 add 3002::1 64
ospfv3 1 area 0
int g0/1
ipv6 add 3001::2 64
quit
RC
sys
sysname RC
ospfv3 1
router-id 3.3.3.3
int lo0
ip add 3.3.3.3
int g0/2
ipv6 add 2002::1 64
ospfv3 1 area 0
int g0/1
ipv6 add 2001::2 64
quit
RD
sys
Sysname RD
ospfv3 1
int lo0
ip add 4.4.4.4 32
ipv6 add 4::4 64
ospfv3 1 area 0
int g0/1
ipv6 add 3002::2 64
ospfv3 1 area 0
int g0/2
ipv6 add 2002::2 64
ospfv3 1 area 0
quit
quit
3配置BGP 连接
RA
bgp 100
router-id 1.1.1.1
peer 3001::2 as-num 200
peer 2001::2 as-num 200
address-family ipv6 unicast
peer 3001::2 enable
peer 2001::2 enable
net 1:: 64
quit
quit
#配置RB与RA建立EBGP会话与RD建立IBGP会话。
RB
bgp 200
router-id 2.2.2.2
peer 3001::1 as-num 100
peer 3002::2 as-num 200
address-family ipv6 unicast
peer 3001::1 enable
peer 3002::2 enable
peer 3002::2 next-hop-local
quit
quit
#配置RC与RA建立EBGP会话,与RD建立IBGP会话。
RC
bgp 200
router-id 3.3.3.3
peer 2001::1 as-num 100
peer 2002::2 as-num 200
address-family ipv6 unicast
peer 2001::1 enable
peer 2002::2 enable
peer 2002::2 next-hop-local
quit
quit
#配置RD分别与RB和RC建立IBGP会话,并配置BGP发布4:: 64 。
RD
bgp 200
router-id 4.4.4.4
peer 3002::1 as-num 200
peer 2002::1 as-num 200
address-family ipv6 unicast
peer 3002::1 enble
peer 2002::1 enble
net 4:: 64
quit
quit
4 修改路由属性值,使得RA和RD之间的流量优先通过链路B转发
#在RA上配置从RB接收到的路由的首选值为100
RA
bgp 100
address-family ipv6 unicast
peer 3001::2 prefered-value 100
#在RD上配置从RB接收到的路由的首选值为100
bgp 200
address-family ipv6 unicast
peer 3002::1 prefered-value 100
quit
quit
5配置BGP快速重路由
#配置RA:创建路由策略frr(根据fast-reroute起名)。为路由4:: 64 指定备份下一跳 的地址为2001::2(对等体RC的地址);在BGP IPV6单播地址族下应用该路由策略。
RA
ipv6 prefix-list abc index 10 permit 4:: 64
route-policy frr permit node 10
if-match ipv6 add prefix-list abc
apply ipv6 fast-reroute backup-nexthop 2001::2
quit
bgp 100
address-family ipv6 unicast
fast-reroute route-policy frr
quit
quit
#配置RD:创建路由策略frr(根据fast-reroute起名)。为路由1:: 64 指定备份下一跳 的地址为2002::1(对等体RC的地址);在BGP IPV6单播地址族下应用该路由策略。
RD
ipv6 presix-list abc inde 10 permit 1:: 64
route-policy frr permit node 10 add prefix-lixt abc
apply ipv6 fast-reroute back-nexthop 2002::1
quit
bgp 200
address-family ipv6 unicast
fast-reroute route-policy frr
quit
quti
验证配置
#在RA上查看4:: 64路由,可以看到备份下一跳
#在RD上查看1:: 64路由,可以看到备份下一跳