1
为了使其他网络层协议也可以使用BGP-4,必须添加多协议NLRI及其下一跳信息。RFC 2858扩展了BGP,使之支持多个网络层协议。IPv6就是一个受支持的协议。为了适应多协议支持的新需求,BGP4+添加了两个新属性:多协议可达NLRI(MP-REACH-NLRI)多协议不可达NLRI(MP-UNREACH-NLRI)
多协议可达NLRI(MP-REACH-NLRI)描述了到达目的地的信息。该属性包含的信息有:
地址属于哪个网络层协议
到目的前缀的下一跳地址
每个MP-REACH-NLRI更新报文包含一个下一跳地址和一些相关的NLRI。NLRI都以
。
如图所示,R3和R4是EBGP邻居,R2和R3也是EBGP邻居,这三个路由器共享一个以太网链路。R1和R2是IBGP邻居。该属性允许邻居路由器撤销IPv6路由,它包含了邻居应该从其RIB中删除的IPv6前缀列表。
MP_UNREACH_NLRI属性的字段介绍如下:
Address Family Identifier(地址族标识符,2字节)
2
Subsequent Address Family Identifier(并发的地址族标识符,1字节) Withdrawn Routes(撤销的路由)步骤1、启动BGP4+
启动BGP4+配置实例R1的配置:
ZXR10_R1(config)#router bgp 100
ZXR10_R1(config-router)#bgp router-id 1.1.1.1
3
ZXR10_R1(config-router)#neighbor 2005::2 remote-as 200 ZXR10_R1(config-router)#address-family ipv6ZXR10_R1(config-router-af)#neighbor 2005::2 activate
ZXR10_R1(config-router-af)#network 2001::/64
R2的配置:
ZXR10_R2(config)#router bgp 200
ZXR10_R2(config-router)#bgp router-id 2.2.2.2
ZXR10_R2(config-router)#neighbor 2005::1 remote-as 100
ZXR10_R2(config-router)#address-family ipv6
ZXR10_R2(config-router-af)#neighbor 2005::1 activate
ZXR10_R2(config-router-af)#network 2003::/64
步骤2、配置BGP4+路由通告
在建立好BGP4+邻居后,可以使用以下办法通告BGP4+路由:
用network命令通告路由
用redistribute命令将别的路由协议学习到的路由再分配到BGP4+中
步骤3、配置EBGP多跳
如图所示,路由器R1需要与路由器R2上地址为2003::2/64的非直连接口建立邻居关系。
R1的配置(其他配置省略): ZXR10_R1(config)#router bgp 100
4
ZXR10_R1(config-router)#neighbor 2003::2 remote-as 300 ZXR10_R1(config-router)#neighbor 2003::2 ebgp-multihopR2的配置(其他配置省略):
ZXR10_R2(config)#router bgp 300
步骤4、配置BGP4+路由反射器
步骤 | 命令 | 功能 |
1 | ZXR10(config-router-af)# neighbor {<ipv6-address> | | 将邻居设置为路由反射器客户 |
2 | ZXR10(config-router)# bgp client-to-clientreflection | 设置客户端到客户端的反射 |
3 | ZXR10(config-router)# bgp cluster-id {< value> | < ip-address>} | 设置路由反射器的群ID |
BGP4+路由反射器配置实例
如图所示,AS100中有两个路由反射器:R3和R4。其中R4的客户端为R5和R6,R3的客户端为R1和R2。
R3的配置: ZXR10_R3(config)#router bgp 100
5
ZXR10_R3 (config-router)#address-family ipv6 ZXR10_R3 (config-router-af)#neighbor 3ffe::1 activateZXR10_R3 (config-router-af)#neighbor 3ffe::2 activate
ZXR10_R3 (config-router-af)#neighbor 3ffe::1 route-reflector-client //设置路由反射器客户
ZXR10_R3 (config-router-af)#neighbor 3ffe::2 route-reflector-client //设置路由反射器客户
R2的配置:
ZXR10_R2(config)#router bgp 100
ZXR10_R2(config-router)#address-family ipv6
ZXR10_R2(config-router-af)#neighbor 3ffe::3 activate
步骤5、配置BGP联盟
步骤 | 命令 | 功能 |
1 | ZXR10(config-router)# bgp confederation identifier <value> | 设置联盟ID |
2 | ZXR10(config-router)# bgp confederation peers<as-number> [< as-number>] | 设置联盟对等端AS号 |
BGP联盟配置实例
如图所示,AS200中有5台BGP4+路由器,我们将其划分成两个子AS,一个定义为AS65010,包含路由器R3,R5,R6;另一个定义为AS65020,包含路由器R4,R7。
6
R3的配置:R3(config)#router bgp 65010 R3(config-router)#bgp confederation identifier 200 //设置联盟IDR3(config-router)#bgp confederation peers 65020 //设置联盟对等端AS号
R5的配置:
R5(config)#router bgp 65010
R5(config-router)#bgp confederation identifier 200 //设置联盟ID
步骤6、配置BGP路由属性
命令 | 功能 |
ZXR10(config-router)# bgp always-compare-med | 允许对不同自治系统中各邻居路径的多出口鉴别器(MED)进行比较 |
ZXR10(config-router)# bgp default local-preference < value> | 设置BGP4+的默认本地优先权值 |
ZXR10(config-router)# neighbor {< ipv6-address> | | 设置向邻居传播路由变化的最小时间间隔 |
ZXR10(config-router)# neighbor {< ipv6-address> | | 设置邻居的描述 |
ZXR10(config-router)# neighbor {< ipv6-address> | | 设置不发送更新信息给邻居 |
展开表格
步骤7、配置BGP4+的IPv6地址族
命令 | 功能 |
ZXR10(config-router)# address-family ipv6 | 进入IPv6地址族模式 |
ZXR10(config-router-af)# neighbor {< ipv6-address> | | 向指定邻居发送缺省路由::/0 |
ZXR10(config-router-af)# neighbor {< ipv6-address> | | 设置可以从邻居接收的最大路由数目 |
ZXR10(config-router-af)# neighbor {< ipv6-address> | | 强制使用自身作为通告路由的下一跳,一般用于NBMA网络上 |
ZXR10(config-router-af)# neighbor {< ipv6-address> | | 将通告给邻居的路由中的私有AS过滤掉 |
展开表格
如图所示,R4和R1建立EBGP,R1和R2建立IBGP,R2和R5建立多跳EBGP。其中,假设R4中存在图中右上角标注的四条静态路由。在R4的配置中,仅通告聚合网段2004::/16。R2与R5之间通过R3建立EBGP多跳关系。 R4的配置:
R4(config)#router bgp 2
R4(config-router)#neighbor 2001::1 remote-as 1
7
R4(config-router)#address-family ipv6 R4(config-router-af)#neighbor 2001::1 activateR4(config-router-af)#redistribute static
R4(config-router-af)#aggregate-address 2004::/16 as-set summary-only //仅通告聚合网段
R1的配置:
R1(config)#router bgp 1
R1(config-router)#neighbor 2003::2 remote-as 1
R1(config-router)#neighbor 2001::4 remote-as 2
R1(config-router)#address-family ipv6
R1(config-router-af)#neighbor 2001::4 activate
R1(config-router-af)#neighbor 2003::2 activate
R1(config-router-af)#neighbor 2003::2 next-hop-self
R2的配置:
R2(config)#router bgp 1
R2(config-router)#neighbor 2003::1 remote-as 1
R2(config-router)#neighbor 2007::5 remote-as 3
R2(config-router)#neighbor 2007::5 ebgp-multihop //配置EBGP多跳
R2(config-router)#address-family ipv6
R2(config-router-af)#neighbor 2003::1 activate
R2(config-router-af)#neighbor 2007::5 activate
R2(config-router-af)#neighbor 2003::1 next-hop-self
R5的配置:
R5(config)#router bgp 3
R5(config-router)#neighbor 2005::2 remote-as 1
R5(config-router)#neighbor 2005::2 ebgp-multihop //配置EBGP多跳
R5(config-router)#address-family ipv6
R5(config-router-af)#neighbor 2005::2 activate
当遇到BGP4+路由问题时,我们可以通过相关的调试命令来帮助定位故障,排除错误。其中用的最多的是show命令,通过show命令可以查看当前BGP4+邻居状态,路由器学习到的BGP4+路由信息等。
命令 | 功能 |
ZXR10# show bgp all protocol | 显示BGP4+协议模块的配置信息 |
ZXR10# show bgp ipv6 unicast neighbor | 查看BGP4+邻接关系,显示当前邻居状态 |
ZXR10# show bgp ipv6 unicast | 显示BGP4+路由选择表中的条目 |
ZXR10# show bgp ipv6 unicast summary | 显示所有BGP4+邻居连接的状态 |
ZXR10#show bgp all protocol
BGP router ID is 2.2.2.2, Local as is 1
Hold time is 90 seconds, KeepAlive time is 30 seconds
Default local preference is 100
Default export metric is 0
IGP synchronization is enabled
Default information advertise is disabled
Always compare med is disabled
Fast fallover is enabled
Client-to-client reflection is enabled
Ipv4 unicast is activated
Router target is filtered
Route dampening is disabled
Distance : external 20 internal 200
ZXR10#show bgp ipv6 unicast neighbor
BGP neighbor is 2005::1, remote AS 1, internal link
BGP version 4, remote router ID 1.1.1.1
BGP state = Established, up for 00:08:04
Last read update 00:02:31, hold time is 90 seconds, keepalive interval
is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received
Address family IPv6 Unicast: advertised and received
ZXR10#show bgp ipv6 unicast
Status codes: *valid, >best, i-internal
Origin codes: i-IGP, e-EGP, ?-incomplete
n
Network Next Hop Metric LocPrf Path
*>i2001::/64 2005::1 100 i
*>i2001::1/128 2005::1 100 i
*> 2003::/64 :: i
*> 2003::2/128 :: i
*> 2005::/64 ::
*i2005::/64 2005::1 100
*>i2005::1/128 2005::1 100
*> 2005::2/128 ::
ZXR10#show bgp ipv6 unicast summary
Neighbor Ver As MsgRcvd MsgSend Up/Down(s) State/PfxRcd
2005::1 4 1 25 25 00:12:04 4
除show命令外,我们还可以使用debug命令观察BGP4+邻接建立过程、路由更新过程等。
命令 | 功能 |
ZXR10# debug ip bgp in | 跟踪显示BGP接收的notification报文,并列出错误号和子错误号 |
ZXR10# debug ip bgp out | 跟踪显示BGP发出的notification报文,并列出错误号和子错误号 |
ZXR10# debug ip bgp events | 跟踪显示BGP连接的状态机迁移 |
1、本网站为开放性注册平台,以上所有展示信息均由会员自行提供,内容的真实性、准确性和合法性均由发布会员负责,本网站对此不承担任何法律责任。
2、网站信息如涉嫌违反相关法律规定或侵权,请发邮件至599385753@qq.com删除。