实验分解图
组网需求:
1.AS65000边界网段发布:RT1、RT2重发布直连路由至OSPF(metric 1000 type 1)
2.AS65001边界网段发布:RT5、RT6 network至OSPF,并设置被动接口。
3.RT3、RT4、发布业务网段至OSPF AREA 0(10.3.3.0、10.2.2.0、10.4.4.0)
4.BGP配置要求:
no synchronization
no auto-summary IBGP使用LOOPBACK建立邻居,下一跳指向自己
5.RT3、RT4、RT1、RT2都运行BGP,RT3、RT4为同簇RR(簇ID为RT3ROUTER-ID),RT1、RT2都分别为RT3、RT4的客户端,且RT3与RT4之间建立IBGP邻居。
6.RT1,RT2发布AS65000的汇总路由至BGP:10.0.0.0/16、10.2.0.0/16、10.3.0.0/16、10.4.0.0/16
7.RT5、RT6发布AS65001的汇总路由至BGP:10.5.0.0/16、10.6.0.0/16
选路需求:
1.AS65001(RT5、RT6)去往10.3.0.0/16的主路径走RT5-RT1
2.AS65001(RT5、RT6)去往10.2.0.0/16、10.4.0.0/16的主路径走RT6-RT2
3.AS65000(RT1、RT2、RT3、RT4)去往10.5.0.0/16的主路径走RT1-RT5
4.AS65000(RT1、RT2、RT3、RT4)去往10.6.0.0/16的主路径走RT2-RT6
工程化配置思想如下:
一、基本信息配置(如设备名,密码、描述)
略
二、接口链路配置及调测(封装,时钟、IP)
略
三、IGP配置及调测(OSPF)
RT1:
router ospf 1
redistribute connected metric 1000 metric-type 1 subnets //重发布直连
passive-interface default //不需要的接口需配置成被动接口
no passive-interface Serial0/0
no passive-interface Serial0/1
no passive-interface FastEthernet1/0
network 10.0.0.1 0.0.0.0 area 0 //在相应的接口上开启OSPF
network 10.0.1.4 0.0.0.3 area 0
network 10.0.1.12 0.0.0.3 area 0
RT2:
router ospf 1
redistribute connected metric 1000 metric-type 1 subnets
passive-interface default
no passive-interface Serial0/0
no passive-interface Serial0/1
no passive-interface FastEthernet1/0
network 10.0.0.2 0.0.0.0 area 0
network 10.0.1.8 0.0.0.3 area 0
network 10.0.1.12 0.0.0.3 area 0
RT3:
router ospf 1
passive-interface default
no passive-interface Serial0/0
no passive-interface FastEthernet1/0
network 10.0.0.3 0.0.0.0 area 0
network 10.0.1.0 0.0.0.3 area 0
network 10.0.1.4 0.0.0.3 area 0
network 10.3.3.0 0.0.0.255 area 0 //需要将业务网段发布至IGP中
RT4:
router ospf 1
passive-interface default
no passive-interface Serial0/0
no passive-interface FastEthernet1/0
network 10.0.0.4 0.0.0.0 area 0
network 10.0.1.0 0.0.0.3 area 0
network 10.0.1.8 0.0.0.3 area 0
network 10.2.2.0 0.0.0.255 area 0 //需要将业务网段发布至IGP中
network 10.4.4.0 0.0.0.255 area 0 //需要将业务网段发布至IGP中
RT5:
router ospf 1
passive-interface default
no passive-interface FastEthernet1/0
network 10.0.15.0 0.0.0.3 area 0
network 10.5.0.1 0.0.0.0 area 0
network 10.5.1.0 0.0.0.3 area 0
network 10.5.5.0 0.0.0.255 area 0 //需要将业务网段发布至IGP中
RT6:
router ospf 1
passive-interface default
no passive-interface FastEthernet1/0
network 10.0.26.0 0.0.0.3 area 0
network 10.5.1.0 0.0.0.3 area 0
network 10.6.0.1 0.0.0.0 area 0
network 10.6.6.0 0.0.0.255 area 0 //需要将业务网段发布至IGP中
四、BGP配置及调测(IBGP、EBGP、RR)
RT3:
router bgp 65000
no synchronization //关闭同步
network 10.0.0.0 mask 255.255.0.0 //静态发布汇总路由到BGP中,需把整
network 10.2.0.0 mask 255.255.0.0 个AS内的所有汇总路由发布,起到备份
network 10.3.0.0 mask 255.255.0.0 的作用(因为与BGP路由器相连的是一
network 10.4.0.0 mask 255.255.0.0 个AS,里面有很多的网段)
neighbor 10.0.0.1 remote-as 65000 //建立IBGP邻居
neighbor 10.0.0.1 update-source Loopback0//指定更新源
neighbor 10.0.0.1 route-reflector-client//指定为客户端(相当于自己是服务端)
neighbor 10.0.0.1 next-hop-self //将下一跳改变为自己
neighbor 10.0.0.2 remote-as 65000
neighbor 10.0.0.2 update-source Loopback0
neighbor 10.0.0.2 route-reflector-client
neighbor 10.0.0.2 next-hop-self
neighbor 10.0.0.4 remote-as 65000 //建立IBGP邻居
neighbor 10.0.0.4 update-source Loopback0
neighbor 10.0.0.4 next-hop-self
no auto-summary //关闭自动汇总
ip route 10.0.0.0 255.255.0.0 Null0 //为发布BGP汇总路由而特意加的
ip route 10.2.0.0 255.255.0.0 Null0
ip route 10.3.0.0 255.255.0.0 Null0
ip route 10.4.0.0 255.255.0.0 Null0
RT4:
router bgp 65000
no synchronization
bgp cluster-id 10.0.0.3 //改变簇ID为同簇双RR,可以减少一些BGP路由表的传播,同时起到备份的作用
network 10.0.0.0 mask 255.255.0.0 //静态发布汇总路由到BGP中,需把整
network 10.2.0.0 mask 255.255.0.0 个AS内的所有汇总路由发布,起到备份
network 10.3.0.0 mask 255.255.0.0 的作用(因为与BGP路由器相连的是一
network 10.4.0.0 mask 255.255.0.0 个AS,里面有很多的网段)
neighbor 10.0.0.1 remote-as 65000
neighbor 10.0.0.1 update-source Loopback0
neighbor 10.0.0.1 route-reflector-client //指定R1为RRC
neighbor 10.0.0.1 next-hop-self
neighbor 10.0.0.2 remote-as 65000
neighbor 10.0.0.2 update-source Loopback0
neighbor 10.0.0.2 route-reflector-client //指定R2为RRC
neighbor 10.0.0.2 next-hop-self
neighbor 10.0.0.3 remote-as 65000
neighbor 10.0.0.3 update-source Loopback0
neighbor 10.0.0.3 next-hop-self
no auto-summary
ip route 10.0.0.0 255.255.0.0 Null0
ip route 10.2.0.0 255.255.0.0 Null0//为发布BGP汇总路由而特意加的
ip route 10.3.0.0 255.255.0.0 Null0
ip route 10.4.0.0 255.255.0.0 Null0
RT1:
router bgp 65000 //只需与RT3和RT4建立IBGP邻居
no synchronization
neighbor 10.0.0.3 remote-as 65000
neighbor 10.0.0.3 update-source Loopback0
neighbor 10.0.0.3 next-hop-self
neighbor 10.0.0.4 remote-as 65000
neighbor 10.0.0.4 update-source Loopback0
neighbor 10.0.0.4 next-hop-self
neighbor 10.0.15.2 remote-as 65001
no auto-summary
RT2:
router bgp 65000 //只需与RT3和RT4建立IBGP邻居
no synchronization
neighbor 10.0.0.3 remote-as 65000
neighbor 10.0.0.3 update-source Loopback0
neighbor 10.0.0.3 next-hop-self
neighbor 10.0.0.4 remote-as 65000
neighbor 10.0.0.4 update-source Loopback0
neighbor 10.0.0.4 next-hop-self
neighbor 10.0.26.2 remote-as 65001
no auto-summary
RT5:
router bgp 65001
no synchronization
network 10.5.0.0 mask 255.255.0.0 //发布汇总路由到BGP
network 10.6.0.0 mask 255.255.0.0
neighbor 10.0.15.1 remote-as 65000
neighbor 10.6.0.1 remote-as 65001
neighbor 10.6.0.1 update-source Loopback0
no auto-summary
ip route 10.5.0.0 255.255.0.0 Null0 //为发布BGP汇总路由而特意加的
ip route 10.6.0.0 255.255.0.0 Null0
RT6:
router bgp 65001
no synchronization
network 10.5.0.0 mask 255.255.0.0 //发布汇总路由到BGP
network 10.6.0.0 mask 255.255.0.0
neighbor 10.0.26.1 remote-as 65000
neighbor 10.5.0.1 remote-as 65001
neighbor 10.5.0.1 update-source Loopback0
no auto-summary
ip route 10.5.0.0 255.255.0.0 Null0
ip route 10.6.0.0 255.255.0.0 Null0 //为发布BGP汇总路由而特意加的
五、BGP路由策略部署(weight、local_preference、MED、community、综合运用)
做路由策略时,大家必须非常清楚BGP路由优先原则:
1.丢弃下一条不可达的路由(这里的不可达是指全局路由表中没有下一条的路由,并不是说不能PING通)
2.在同步状态下,丢弃没有达到同步的路由
3.选择有最大Weight的路由 (范围0 到 65,535,本地始发默认为32768,weight是CISCO私有的参数,路由器配置了权重后在本地有效,即收到的为0)
4.选择LOCAL_PREF值最大的路由(范围 0到 4,294,967,295,默认都为100).
5.选择本路由器始发的路由(包括network、重分布、及汇总)
6.选择AS_PATH最短的路由(同AS中的as_path为空,只有离开AS才会加上AS号)
7.选择Origin源头最小的路由(IGP>EGP>Incomplete)
8.选择MED 值最小的路由
9.外部路由EBGP优先于联盟(confederation)外部路由优于内部路由IBGP(优选 E-BGP路由)
10.选择下一跳IBGP开销最小的路由
11.选择Router-id最小的BGP邻居通告的路由(在配置了路由反射器时具有Originator_ID属性时,不看这一条)
12.选择Originator_ID小的路由(没有Originator_ID时,用Router-id和Originator_ID进行比较,哪个小哪个优)
13.当Originator_ID相同时(没有Originator_ID和Router-id相同时),选择Cluster_List最短的路由(如果没有Cluster_List则为最优)
14.选择邻居地址最小的BGP邻居通告过来的路由(BGP只会向外通告一条最优的路由,所以这里是不可能相同的)
BGP路由策略与选路控制案例详解(下)
抱歉一篇发不了,我会在附件中上传!