本文共 4909 字,大约阅读时间需要 16 分钟。
为什么需要路由反射器就是为了打破BGP中从IBGP学到的路由不能再传给IBGP(防止环路),那用什么来防止环路呢?利用 Originator_ID和Cluster_List ,收到 Originator_ID和本地的Router ID,如果两个ID相同,BGP 路由器会忽略掉这条路由,不做处理。 更详细的内容请见前面 1. R1、R2、R3、R4、R5、R6、R7处于同一AS 10 2. R8处于AS30,R9处于AS20,它们之间通过EBGP与AS10进行通信。 3. 在R1发布汇总静态路由10.0.0.0/16至BGP、在R5发布汇总静态路由10.5.0.0/16至BGP、 在R7发布汇总静态路由10.7.0.0/16至BGP、在R8发布汇总静态路由10.8.0.0/16至BGP、 在R9发布汇总静态路由10.9.0.0/16至BGP。 4.运用RR全连接或二级路由反射解决路由反射问题。 passive-interface Ethernet0/0 network 10.0.14.0 0.0.0.3 area 0 network 10.0.16.0 0.0.0.3 area 0 network 10.0.12.0 0.0.0.3 area 0 network 10.0.13.0 0.0.0.3 area 0 network 10.0.18.0 0.0.0.3 area 0(上面拓扑写错了,是10.0.18.0/30) network 10.0.0.1 0.0.0.0 area 0 passive-interface Ethernet0/1 network 10.0.0.2 0.0.0.0 area 0 network 10.0.12.0 0.0.0.3 area 0 network 10.0.29.0 0.0.0.3 area 0 network 10.0.0.3 0.0.0.0 area 0 network 10.0.13.0 0.0.0.3 area 0 network 10.0.0.4 0.0.0.0 area 0 network 10.0.14.0 0.0.0.3 area 0 network 10.0.45.0 0.0.0.3 area 0 network 10.0.0.5 0.0.0.0 area 0 network 10.0.45.0 0.0.0.3 area 0 network 10.0.0.6 0.0.0.0 area 0 network 10.0.16.0 0.0.0.3 area 0 network 10.0.67.0 0.0.0.3 area 0 network 10.0.0.7 0.0.0.0 area 0 network 10.0.67.0 0.0.0.3 area 0 在R1、R4、R6上配置成RR,R2、R3为R1的客户端,R5为R4的客户端,R7为R6的客户端,R1与R8建立EBGP,R2与R9建立EBGP。 no synchronization //关闭同步 network 10.0.0.0 //静态发布BGP路由汇总 neighbor rrc peer-group //创建一个名为rrc对等组(共享同一BGP策略) neighbor rrc remote-as 10 //指定邻居AS为10 neighbor rrc update-source Loopback0 //指定更新源为LOOP 0 neighbor rrc route-reflector-client //指定为RR的客户端RRC neighbor rrc next-hop-self //将下一条改变为自己 neighbor 10.0.0.2 peer-group rrc //指定邻居使用对等组策略 neighbor 10.0.0.3 peer-group rrc //指定邻居使用对等组策略 neighbor 10.0.0.4 remote-as 10 neighbor 10.0.0.4 update-source Loopback0 neighbor 10.0.0.4 next-hop-self neighbor 10.0.0.6 remote-as 10 neighbor 10.0.0.6 update-source Loopback0 neighbor 10.0.0.6 next-hop-self neighbor 10.0.18.2 remote-as 30 ip route 10.0.0.0 255.0.0.0 Null0 //添加汇总静态路由 router bgp 10 //RRC只需在RR上配置,RRC只要配置IGBP neighbor 10.0.0.1 remote-as 10 neighbor 10.0.0.1 update-source Loopback0 neighbor 10.0.0.1 next-hop-self neighbor 10.0.29.2 remote-as 20 //配置EBGP邻居 router bgp 10 //RRC只需在RR上配置,RRC只要配置IGBP neighbor 10.0.0.1 remote-as 10 neighbor 10.0.0.1 update-source Loopback0 neighbor 10.0.0.1 next-hop-self router bgp 10 //配置成RR,客户端为R5 neighbor rrc remote-as 10 neighbor rrc update-source Loopback0 neighbor rrc route-reflector-client neighbor rrc next-hop-self neighbor 10.0.0.1 remote-as 10 neighbor 10.0.0.1 update-source Loopback0 neighbor 10.0.0.1 next-hop-self neighbor 10.0.0.5 peer-group rrc network 10.5.0.0 mask 255.255.0.0 //发布路由到BGP neighbor 10.0.0.4 remote-as 10 neighbor 10.0.0.4 update-source Loopback0 neighbor 10.0.0.4 next-hop-self ip route 10.5.0.0 255.255.0.0 Null0 //添加汇总静态路由 router bgp 10 //配置成RR,RRC为R7 neighbor rrc remote-as 10 neighbor rrc update-source Loopback0 neighbor rrc route-reflector-client neighbor rrc next-hop-self neighbor 10.0.0.1 remote-as 10 neighbor 10.0.0.1 update-source Loopback0 neighbor 10.0.0.1 next-hop-self neighbor 10.0.0.7 peer-group rrc network 10.7.0.0 mask 255.255.0.0 //发布到BGP neighbor 10.0.0.6 remote-as 10 neighbor 10.0.0.6 update-source Loopback0 neighbor 10.0.0.6 next-hop-self ip route 10.7.0.0 255.255.0.0 Null0 //添加汇总静态路由 network 10.8.0.0 mask 255.255.0.0 neighbor 10.0.18.1 remote-as 10 //发布到BGP中 ip route 10.8.0.0 255.255.0.0 Null0 //添加汇总静态路由 network 10.9.0.0 mask 255.255.0.0 //发布到BGP中 neighbor 10.0.29.1 remote-as 10 ip route 10.9.0.0 255.255.0.0 Null0 //添加汇总静态路由 现在我们可以看到R9能够学习到所有路由,R8也一样: Network Next Hop Metric LocPrf Weight Path *> 10.0.0.0 10.0.29.1 0 10 i *> 10.5.0.0/16 10.0.29.1 0 10 i *> 10.7.0.0/16 10.0.29.1 0 10 i *> 10.8.0.0/16 10.0.29.1 0 10 30 i *> 10.9.0.0/16 0.0.0.0 0 32768 i 我们来分析一下10.7.0.0/16路由是怎么传播到R9的: R7: Network Next Hop Metric LocPrf Weight Path
*>i10.0.0.0 10.0.0.1 0 100 0 i
*> 10.7.0.0/16 0.0.0.0 0 32768 i *>i10.8.0.0/16 10.0.0.1 0 100 0 30 i
*>i10.9.0.0/16 10.0.0.2 0 100 0 20 i
首先由R7始发路由,所以下一跳为0.0.0.0,本地始发Weight为32768 转载地址:http://qydfa.baihongyu.com/