【CCNP】BGP联盟配置案例
- 格式:docx
- 大小:218.49 KB
- 文档页数:7
思科CCNP认证BGP的建邻配置与属性详解本⽂讲述了思科CCNP认证BGP的建邻配置与属性。
分享给⼤家供⼤家参考,具体如下:BGP建邻配置BGP的宣告是依赖路由表的,宣告需要满⾜:1:被宣告的路由必须在路由表中。
2:被宣告的路由必须和路由表中的前缀掩码⼀致。
⽆论本地路由表中的条⽬是通过何种⽅式获取的,均可宣告到BGP协议中。
BGP协议宣告时必须和本地路由表中的记录完全⼀致。
宣告:r1(config-router)#network 100.1.1.1 mask 255.255.255.255路由表:IBGP默认使⽤回环建邻,EBGP默认使⽤直连建邻。
r2(config)#router bgp 1r2(config-router)#bgp router-id 100.2.2.2r2(config-router)#neighbor 100.5.5.5 remote-as 2r2(config-router)#neighbor 100.5.5.5 ebgp-multihopEBGP⾮直连建邻修改跳数:EBGP建邻没有特殊情况⼀般使⽤直连建邻,如果使⽤⾮直连建邻需要修改跳数,默认情况下跳数为1(不修改跳数直接使⽤⾮直连建邻会失败)。
BGP的路由传递,传递的是BGP路由表中的路由信息。
BGP的路由表在收到路由以后需要检验该路由的下⼀跳是否可达,如果不可达该路由⼀定不优。
使⽤对等体组建邻BGP邻居:(可以减少建邻过程的重复操作步骤)r1(config)#router bgp 1r1(config-router)#bgp router-id 100.1.1.1r1(config-router)#neighbor a peer-groupr1(config-router)#neighbor a remote-as 1r1(config-router)#neighbor a update-source lo0r1(config-router)#neighbor 100.2.2.2 peer-group ar1(config-router)#neighbor 100.3.3.3 peer-group aBGP属性1:weightcisco私有属性,对于离开AS的路由在路由器选择哪⼀条最优,本台路由器产⽣的路由weight值为32768,学习到的路由的weight值为0,不能传递。
CCNP之BGP实验案例实验需求:1、每一台路由器都起一个/32的回环地址,用来建立BGP邻居关系2、大型企业内部起OSPF协议,ISP B内部也起OSPF协议,企业A分别和ISP B和ISP C建立BGP邻接关系,以用来透传互联网上的条目3、要求ISP C学到挂在ISP B的服务器条目尽可能少4、要求ISP C前往ISP B那些服务器是通过R3和R5之间的高带宽链路,为了充分利用带宽,要求ISP B访问ISP C上的服务器是走的R4和R6之间的低带宽链路,这些配置都需要在大型企业上完成5、要求ISP和企业之间建立的BGP邻接是安全的6、完成配置之后,确信网络中每一台设备都学到了服务器对应的BGP条目实验拓扑图:实验步骤:1、在大型企业A和ISP B内部起OSPF协议R2:R2(config)#router ospf 1R2(config-router)#net 2.2.2.2 0.0.0.0 a 0R2(config-router)#net 23.23.23.23 0.0.0.0 a 0R2(config-router)#net 24.24.24.24 0.0.0.0 a 0R3:R3(config)#router ospf 1R3(config-router)#net 3.3.3.3 0.0.0.0 a 0R3(config-router)#net 23.23.23.1 0.0.0.0 a 0R4:R4(config)#router ospf 1R4(config-router)#net 4.4.4.4 0.0.0.0 a 0R4(config-router)#net 24.24.24.1 0.0.0.0 a 0R5:R5(config)#router ospf 1R5(config-router)#net 5.5.5.5 0.0.0.0 a 0R5(config-router)#net 57.57.57.2 0.0.0.0 a 0R6:R6(config)#router ospf 1R6(config-router)#net 6.6.6.6 0.0.0.0 a 0R6(config-router)#net 67.67.67.2 0.0.0.0 a 0R7:R7(config)#router ospf 1R7(config-router)#net 7.7.7.7 0.0.0.0 a 0R7(config-router)#net 57.57.57.1 0.0.0.0 a 0R7(config-router)#net 67.67.67.1 0.0.0.0 a 02、全网启用BGP协议由于ebgp建立在TCP连接的基础上,所以需要配置静态路由。
BGP 案例分析1使用由RFC 1771定义的 BGP,可以在自治系统 (AS) 之间创建无环路域间路由。
AS 是同处一个技术管理之下的一组路由器。
AS 中的路由器可以使用多个内部网关协议 (IGP) 在 AS 内部交换路由信息。
这些路由器可以使用外部网关协议将数据包路由至 AS 外部。
BGP 如何工作?BGP 在端口 179 上使用 TCP 作为传输协议。
两个 BGP 路由器互相之间形成 TCP 连接。
这些路由器是对等路由器。
对等路由器交换消息以公开和确认连接参数。
BGP 路由器交换网络可达性信息。
这些信息主要指示路由为达到目标网络而必须通过的完整路径。
路径以 BGP AS 编号形式表示。
此信息有助于构建无环路 AS 的图形。
该图形还显示在何处应用路由策略来对路由行为强制实施某些限制。
任何两个形成 TCP 连接以交换 BGP 路由信息的路由器都是“对等体”(或称“邻居”)。
BGP 对等体最初交换完整的 BGP 路由表。
在此交换以后,对等体在路由表更改时发送增量更新。
BGP 保存 BGP 路由表的版本号。
所有 BGP 对等体的版本号都是相同的。
每当 BGP 通过更改的路由信息更新路由表时,版本号就会更改。
发送保持连接数据包可确保 BGP 对等体之间的连接处于活动状态。
出现错误或特殊情况时将发送通知数据包。
eBGP 和iBGP如果一个 AS 有多个 BGP 扬声器,则该 AS 可以充当其他 AS 的传输服务。
如此部分中的图表所示,AS200 是 AS100 和 AS300 的传输 AS。
要将信息发送到外部 AS,必须确保网络的可达性。
为了保证网络可达性,将进行如下过程:•在 AS 内的路由器之间进行内部 BGP (iBGP) 对等•将 BGP 信息重分配到 AS 中运行的 IGP当 BGP 在分属两个不同 AS 的路由器之间运行时,该 BGP 称为外部BGP (eBGP)。
当 BGP 在同一 AS 内的路由器间运行时,该 BGP 称为iBGP。
【CCNP】BGPCommunity属性配置案例【CCNP】BGP Community属性配置案例版本V1.0密级?开放?内部?机密类型?讨论版?测试版?正式版1案例配置拓扑2案例配置需求1、如上图所示,IP地址规划方面,R1上有三个环回接口loopback 0、loopback 1、loopback 2,地址分别为50.1.1.1/32、100.1.1.1/32、200.1.1.1/32,路由器互连的接口为172.8.AB.X/24(其中AB为路由器编号叠加,X为路由器编号,如R1连接R2的接口S0/0的地址为172.8.12.1/24);2、图中有三个AS,AS 100、AS 200、AS 300,R1/R2为eBGP 邻居关系,R2/R3为iBGP邻居关系,R2/R4为eBGP邻居关系;3、将R1的环回接口发布到BGP中,R1将loopback 0接口的BGP路由发送给R2时,设置公有Community属性为NO_ADVERTISE,R1将loopback 1接口的BGP路由发送给R2时,设置公有Community属性为NO_EXPORT,R1将loopback 2接口的BGP路由发送给R2时,设置公有Community属性为LOCAL-AS,查看此时BGP的团体属性;4、在R1路由器上添加环回接口loopback 3,IP地址为3.3.3.3/32,设置发送给R2的私有Community属性为3:3,查看此时BGP的团体属性;3案例配置思路1、R1上的关键配置:router bgp 100no synchronizationbgp log-neighbor-changesnetwork 3.3.3.3 mask 255.255.255.255network 50.1.1.1 mask 255.255.255.255network 100.1.1.1 mask 255.255.255.255network 200.1.1.1 mask 255.255.255.255neighbor 172.8.12.2 remote-as 200neighbor 172.8.12.2 send-community /开启发送community 属性,默认不发送/neighbor 172.8.12.2 route-map community out /做out方向的策略/no auto-summary!ip bgp-community new-format/开启bgp community新格式,用来显示私有community属性/2、R2上的关键配置:router bgp 200no synchronizationbgp log-neighbor-changesneighbor 172.8.12.1 remote-as 100neighbor 172.8.23.3 remote-as 200neighbor 172.8.23.3 send-community /开启发送community 属性,默认不发送/neighbor 172.8.24.4 remote-as 300neighbor 172.8.24.4 send-community /开启发送community 属性,默认不发送/no auto-summary!ip bgp-community new-format3、R3上的关键配置:router bgp 200no synchronizationbgp log-neighbor-changesneighbor 172.8.23.2 remote-as 200no auto-summary!ip bgp-community new-format/开启bgp community新格式,用来显示私有community属性/4、R4上的关键配置:router bgp 300no synchronizationbgp log-neighbor-changesneighbor 172.8.24.2 remote-as 200no auto-summary!ip bgp-community new-format/开启bgp community新格式,用来显示私有community属性/ 4案例检验结果1、查看R1上关于策略的配置情况:R1#show ip prefix-listip prefix-list loopback0: 1 entriesseq 5 permit 50.1.1.1/32ip prefix-list loopback1: 1 entriesseq 5 permit 100.1.1.1/32ip prefix-list loopback2: 1 entriesseq 5 permit 200.1.1.1/32ip prefix-list loopback3: 1 entriesseq 5 permit 3.3.3.3/32R1#show route-map communityroute-map community, permit, sequence 10Match clauses:ip address prefix-lists: loopback0Set clauses:community no-advertisePolicy routing matches: 0 packets, 0 bytesroute-map community, permit, sequence 20Match clauses:ip address prefix-lists: loopback1Set clauses:community no-exportPolicy routing matches: 0 packets, 0 bytesroute-map community, permit, sequence 30Match clauses:ip address prefix-lists: loopback2Set clauses:community local-ASPolicy routing matches: 0 packets, 0 bytesroute-map community, permit, sequence 40Match clauses:ip address prefix-lists: loopback3Set clauses:community 3:3Policy routing matches: 0 packets, 0 bytesroute-map community, permit, sequence 50Match clauses:Set clauses:Policy routing matches: 0 packets, 0 bytes2、查看R2上关于BGP表及相关路由的community属性:R2#show ip bgpBGP table version is 9, local router ID is 172.8.24.2Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incompleteNetwork Next Hop Metric LocPrf Weight Path*> 3.3.3.3/32 172.8.12.1 0 0 100 i*> 50.1.1.1/32 172.8.12.1 0 0 100 i*> 100.1.1.1/32 172.8.12.1 0 0 100 i*> 200.1.1.1/32 172.8.12.1 0 0 100 iR2#show ip bgp 50.1.1.1 255.255.255.255Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to any peer) Not advertised to any peer 100172.8.12.1 from 172.8.12.1 (200.1.1.1)Origin IGP, metric 0, localpref 100, valid, external, bestCommunity: no-advertise /与R1上设置的属性一致/R2#show ip bgp 100.1.1.1 255.255.255.255BGP routing table entry for 100.1.1.1/32, version 8Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised to EBGP peer) Advertised to update-groups: 2100172.8.12.1 from 172.8.12.1 (200.1.1.1)Origin IGP, metric 0, localpref 100, valid, external, bestCommunity: no-export /与R1上设置的属性一致/ 雏鹰论坛CCNPR2#show ip bgp 200.1.1.1 255.255.255.255BGP routing table entry for 200.1.1.1/32, version 7Paths: (1 available, best #1, table Default-IP-Routing-Table, not advertised outside local AS)Advertised to update-groups:2100172.8.12.1 from 172.8.12.1 (200.1.1.1)Origin IGP, metric 0, localpref 100, valid, external, bestCommunity: local-AS /与R1上设置的属性一致/R2#show ip bgp 3.3.3.3 255.255.255.255Paths: (1 available, best #1, table Default-IP-Routing-Table)Advertised to update-groups:2 3100172.8.12.1 from 172.8.12.1 (200.1.1.1)Origin IGP, metric 0, localpref 100, valid, external, bestCommunity: 3:3 /R2路由器上打了BGP Community新格式命令,所以这里正常显示,否则,这里显示不正常/3、查看R3上的BGP表:R3#show ip bgpBGP table version is 1, local router ID is 172.8.23.3Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incompleteNetwork Next Hop Metric LocPrf Weight Path * i3.3.3.3/32 172.8.12.1 0 100 0 100 i* i100.1.1.1/32 172.8.12.1 0 100 0 100 i* i200.1.1.1/32 172.8.12.1 0 100 0 100 i/这里没有50.1.1.1/32的BGP路由,因为此路由在R2上的BGP Community为公有属性no-advertise,意思是不通告给任何的BGP 对等体,R3与R2为iBGP邻居关系,所以R3的BGP 表中不存在此路由,另外,路由前没有“>”,是由于下一跳不可达,这里只测试BGP Community/ 4、查看R4上的BGP表和BGP Community属性:R4#show ip bgpBGP table version is 9, local router ID is 172.8.24.4Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incompleteNetwork Next Hop Metric LocPrf Weight Path*> 3.3.3.3/32 172.8.24.2 0 200 100 i/R4没有收到50.1.1.1/32路由,因为此路由在R2上的BGP Community为公有属性no-advertise,意思是不通告给任何的BGP 对等体,R4与R2为eBGP邻居关系,所以R4的BGP表中不存在此路由,同理,100.1.1.1/32在R2上的BGP Community为公有属性no-export ,意思是不通告给eBGP对等体,R4与R2为eBGP邻居关系,所以R4的BGP表中不存在此路由,R3与R2为iBGP邻居关系,所以R3上存在此路由,200.1.1.1/32在R2上的BGP Community为公有属性local-as,意思是只在本AS内部发送,如果配置联盟,那么不发送到其它AS或者子AS,所以R4上不存在此路由,而R3上存在/ 雏鹰论坛CCNPR4#show ip bgp 3.3.3.3 255.255.255.255BGP routing table entry for 3.3.3.3/32, version 9Paths: (1 available, best #1, table Default-IP-Routing-Table) Not advertised to any peer200 100172.8.24.2 from 172.8.24.2 (172.8.24.2)Origin IGP, localpref 100, valid, external, bestCommunity: 3:35案例数据抓包1、R1发送给R2的关于3.3.3.3/32的Update Message:2、R1发送给R2的关于200.1.1.1/32的Update Message:3、R1发送给R2的关于100.1.1.1/32的Update Message:4、R1发送给R2的关于50.1.1.1/32的Update Message:6案例配置文件7案例总结及其它1、BGP Community属性用来标识一些有相同性质的前缀,给路由打标记,以便统一处理,一个路由可以有多个属性值,不限于一个网络或一个自治系统,没有物理边界;2、BGP Community属性有公有和私有:公认的Community:a)NO_ADVERTISE:不通告给任何的BGP对等体;b)NO_EXPORT:不通告给eBGP对等体;c)INTERNET:可以通告给所有的其它BGP对等体;d)LOCAL-AS:表示本路径不发布到本AS 外部,当配置联盟时,本路径不发布给其它的自治系统或子自治系统;私有的Community:a)私有团体是对用户有意义的数字;b)四个字节,为增加可读性,可配置为aa:nn,一般aa建议为AS号,nn代表业务;3、缺省在peer之间不传递community属性,必须在bgp进程下针对特定peer使用neighbor ××××send-community才能将community属性发送出去;4、参见欢迎来雏鹰论坛参与讨论。
CCNP路由精华7:在可扩展的网络中实施BGP第七章:在可扩展的网络中实施BGP横向隔离规则规定:通过IBGP学到的路由永远不能被传输到其它IGBP对等体。
路由反射器(Route Reflector)路由反射器让被配置为路由反射器的路由器向其他IBGP对等体传输由IBGP所学到的路由来修改BGP的横向隔离规则。
路由反射器的优点:配置了BGP路由反射器,就不再需要全互连的IBGP对等体。
路由反射器被允许向其它IBGP对等体传输IBGP路由。
当内部邻居命令语句数量过多时,I SP就会采用路由反射器技术。
路由反射器通过让主要路由器给它们的路由反射器客户复制路由更新来减少AS内BGP邻居关系的数量(这样可以减少T CP连接)。
路由反射器不影响IP数据包所要经过的路径;只有发布路由信息的那条路径受影响。
如果路由反射器没有被正确配置,那么将可能产生路由环路。
路由反射器的术语:路由反射器:是被配置为允许它把通过IBGP所学到的路由通告(或反射)到其他IBGP对等体的路由器。
集群:路由反射器出其它客户的组合;客户:路由反射器和其他路由有部分IBGP对等关系的这些路由器非客户:不是路由反射器的客户的其他IBGP的对等体;originator(始发者)ID:是任选的、非传递BGP属性,它被路由反射器创建。
这个属性带有本能AS内部由始发者的路由ID;路由反射器集群表:路由报经过的集群ID序列。
originator(始发者)ID、集群ID和集群表有助于在路由反射器配置中防止产生路由环路。
用来将路由器配置为BGP路由反射器,并且将指定的邻居配置为它的客户:neighbor ip-address route-reflector-clientip-address:将被标识为客户的BGP邻居的IP地址bgpcluster-id cluster-id: 配置集群IDshow ip bgp neighbors: 显示那个邻居是路由反射器客户策略控制和前缀列表(Prefix list)发布列表利用访问控制列表来指定哪些路由信息将被过滤。
去年12月的时候做了一个项目,中间碰到一个问题,今天写出来跟大家分享一下。
项目概况是这样的,国家电网的一市局,市局里放了两台NE20E-8的路由器,做为全市的核心路由器,每台NE20E-8用一个CPOS口通过传输设备复用出多个2M线路,下接多个变电所,变电所路由器为cisco的2811路由器。
cisco 2811路由器与两台NE20E-8组成一个链路双归网络,cisco 2811、两台NE20E-8路由器均为PE设备,两台NE20E-8做为全市的路由反射器,变电所的cisco2811路由器只与两台NE20E-8路由器建立BGP邻居关系。
全市存在两个VPN(MPLS/VPN),分别以VRF A和VRF B表示,两台NE20E-8使用upe 方式向cisco2811下发缺省路由引导上行流量,在cisco 2811中重分布直连路由。
以下为网络示意图:以下为三台设备的配置文件NE20E-8A:dis cu#sysname HZLA-NE20E-8A#router id 33.10.191.11#diffserv domain#ip vpn-instance realtimeroute-distinguisher 2007:1vpn-target 30033:11 export-extcommunityvpn-target 30033:1 30033:11 30033:13 import-extcommunity #ip vpn-instance nrtroute-distinguisher 2007:2vpn-target 30033:12 export-extcommunityvpn-target 30033:2 30033:12 30033:14 import-extcommunity #mpls lsr-id 33.10.191.11mpls#mpls ldp#controller Cpos3/0/0e1 6 channel-set 0 timeslot-list 1-31#interface Aux0async mode flowlink-protocol ppp#interface Ethernet1/0/0#interface Ethernet1/0/1#interface Ethernet1/0/2#interface Ethernet1/0/3#interface Ethernet1/0/4description LINK_TO_HZ-NE20-8Aip address 33.10.190.6 255.255.255.252mplsmpls ldp#interface Ethernet1/0/5#interface Ethernet1/0/6#interface Ethernet1/0/7#interface Ethernet2/0/0#interface Ethernet2/0/1#interface Ethernet2/0/2description LINK_TO_HZLA-NE20-8Bip address 33.10.190.61 255.255.255.252 mplsmpls ldp#interface Ethernet2/0/3#interface Ethernet2/0/4#interface Ethernet2/0/5#interface Ethernet2/0/6#interface Ethernet2/0/6.100vlan-type dot1q 100description LINK_TO_HZLA-S3328TP-RT ip binding vpn-instance realtimeip address 33.10.190.209 255.255.255.252 #interface Ethernet2/0/6.200vlan-type dot1q 200description realtimeip binding vpn-instance realtimeip address 10.33.177.94 255.255.255.224 vrrp vrid 200 virtual-ip 10.33.177.94#interface Ethernet2/0/7#interface Ethernet4/0/0#interface Ethernet4/0/1#interface Ethernet4/0/2#interface Ethernet4/0/3#interface Ethernet4/0/4#interface Ethernet4/0/5#interface Ethernet4/0/6#interface Ethernet4/0/6.300#interface Ethernet4/0/6.400description nrt#interface Ethernet4/0/7#interface Serial3/0/0/6:0link-protocol pppdescription xiushuiip address 33.10.177.217 255.255.255.252 mplsmpls ldp#interface GigabitEthernet0/0/1#interface GigabitEthernet0/0/2#interface NULL0#interface LoopBack0ip address 33.10.191.11 255.255.255.255 #bgp 30033group 500 internalpeer 500 connect-interface LoopBack0 peer 33.10.191.131 as-number 30033 peer 33.10.191.131 group 500group 300 internalpeer 300 connect-interface LoopBack0 peer 33.10.191.1 as-number 30033peer 33.10.191.1 group 300peer 33.10.191.12 as-number 30033peer 33.10.191.12 group 300#ipv4-family unicastundo synchronizationreflector cluster-id 100.100.100.100peer 300 enablepeer 33.10.191.1 enablepeer 33.10.191.1 group 300peer 33.10.191.12 enablepeer 33.10.191.12 group 300peer 500 enablepeer 500 reflect-clientpeer 33.10.191.131 enablepeer 33.10.191.131 group 500#ipv4-family vpnv4reflector cluster-id 100.100.100.100policy vpn-targetpeer 300 enablepeer 33.10.191.1 enablepeer 33.10.191.1 group 300peer 33.10.191.12 enablepeer 33.10.191.12 group 300peer 500 enablepeer 500 reflect-clientpeer 500 upepeer 500 default-originate vpn-instance realtimepeer 500 default-originate vpn-instance nrtpeer 33.10.191.131 enablepeer 33.10.191.131 group 500#ipv4-family vpn-instance realtimeimport-route directimport-route static#ipv4-family vpn-instance nrtimport-route directimport-route static#aaalocal-user admin password cipher .]@USE=B,53Q=^Q`MAF4<1!! local-user admin service-type telnetlocal-user admin level 15authentication-scheme default#authorization-scheme default#accounting-scheme default#domain default##ospf 1area 0.0.0.21network 33.10.191.11 0.0.0.0network 33.10.190.4 0.0.0.3network 33.10.190.60 0.0.0.3network 33.10.177.216 0.0.0.3#nqa-jitter tag-version 1#snmp-agentsnmp-agent local-engineid 000007DB7F00000100004E8Bsnmp-agent community write Zpepbdc@sjwsnmp-agent community read huaWei8zjepsnmp-agent sys-info version allsnmp-agent target-host trap address udp-domain 10.33.223.178 params securityname huaWei8zjepsnmp-agent target-host trap address udp-domain 10.33.223.179 params securityname huaWei8zjepsnmp-agent trap enable standardsnmp-agent trap source LoopBack0#user-interface con 0user-interface aux 0user-interface vty 0 4authentication-mode aaa#returnNE20—B:dis cu#sysname HZLA-NE20E-8B#router id 33.10.191.12#diffserv domain#ip vpn-instance realtimeroute-distinguisher 2008:1vpn-target 30033:11 export-extcommunityvpn-target 30033:1 30033:11 30033:13 import-extcommunity#ip vpn-instance nrtroute-distinguisher 2008:2vpn-target 30033:12 export-extcommunityvpn-target 30033:2 30033:12 30033:14 import-extcommunitympls lsr-id 33.10.191.12mpls#mpls ldp#controller Cpos3/0/0e1 6 channel-set 0 timeslot-list 1-31#interface Aux0async mode flowlink-protocol ppp#interface Ethernet1/0/0#interface Ethernet1/0/1#interface Ethernet1/0/2#interface Ethernet1/0/3#interface Ethernet1/0/4#interface Ethernet1/0/5#interface Ethernet1/0/6#interface Ethernet1/0/7#interface Ethernet2/0/0#interface Ethernet2/0/1#interface Ethernet2/0/2description LINK_TO_HZLA-NE20-8A ip address 33.10.190.62 255.255.255.252 mplsmpls ldp#interface Ethernet2/0/3#interface Ethernet2/0/4#interface Ethernet2/0/5interface Ethernet2/0/6#interface Ethernet2/0/6.300vlan-type dot1q 300description LINK_TO_HZLA-S3328TP-NRT ip binding vpn-instance nrtip address 33.10.190.217 255.255.255.252#interface Ethernet2/0/6.400vlan-type dot1q 400description nrtip binding vpn-instance nrtip address 10.33.177.126 255.255.255.224 vrrp vrid 40 virtual-ip 10.33.177.126#interface Ethernet2/0/7#interface Ethernet4/0/0#interface Ethernet4/0/1#interface Ethernet4/0/2#interface Ethernet4/0/3#interface Ethernet4/0/4description LINK_TO_HZFY-NE20-8Aip address 33.10.190.58 255.255.255.252 mplsmpls ldp#interface Ethernet4/0/5#interface Ethernet4/0/6#interface Ethernet4/0/6.100#interface Ethernet4/0/6.200description realtime#interface Ethernet4/0/7#interface Serial3/0/0/6:0link-protocol pppdescription xiushuiip address 33.10.226.217 255.255.255.252 mplsmpls ldp#interface GigabitEthernet0/0/1#interface GigabitEthernet0/0/2#interface NULL0#interface LoopBack0ip address 33.10.191.12 255.255.255.255 #bgp 30033group 500 internalpeer 500 connect-interface LoopBack0 peer 33.10.191.131 as-number 30033 peer 33.10.191.131 group 500group 300 internalpeer 300 connect-interface LoopBack0 peer 33.10.191.11 as-number 30033peer 33.10.191.11 group 300peer 33.10.191.9 as-number 30033peer 33.10.191.9 group 300#ipv4-family unicastundo synchronizationreflector cluster-id 100.100.100.100peer 300 enablepeer 33.10.191.11 enablepeer 33.10.191.11 group 300peer 33.10.191.9 enablepeer 33.10.191.9 group 300peer 500 enablepeer 33.10.191.131 enablepeer 33.10.191.131 group 500#ipv4-family vpnv4reflector cluster-id 100.100.100.100 policy vpn-targetpeer 300 enablepeer 33.10.191.11 enablepeer 33.10.191.11 group 300peer 33.10.191.9 enablepeer 33.10.191.9 group 300peer 500 enablepeer 500 reflect-clientpeer 500 upepeer 500 default-originate vpn-instance realtimepeer 500 default-originate vpn-instance nrtpeer 33.10.191.131 enablepeer 33.10.191.131 group 500#ipv4-family vpn-instance realtimeimport-route directimport-route static#ipv4-family vpn-instance nrtimport-route directimport-route static#aaalocal-user admin password cipher .]@USE=B,53Q=^Q`MAF4<1!! local-user admin service-type telnetlocal-user admin level 15authentication-scheme default#authorization-scheme default#accounting-scheme default#domain default##ospf 1import-route directarea 0.0.0.21network 33.10.191.12 0.0.0.0network 33.10.190.60 0.0.0.3network 33.10.190.56 0.0.0.3network 33.10.226.216 0.0.0.3#nqa-jitter tag-version 1#snmp-agentsnmp-agent local-engineid 000007DB7F00000100004E8Bsnmp-agent community write Zpepbdc@sjwsnmp-agent community read huaWei8zjepsnmp-agent sys-info version allsnmp-agent target-host trap address udp-domain 10.33.223.178 params securityname huaWei8zjepsnmp-agent target-host trap address udp-domain 10.33.223.179 params securityname huaWei8zjepsnmp-agent trap enable standardsnmp-agent trap source LoopBack0#user-interface con 0user-interface aux 0user-interface vty 0 4authentication-mode aaa#returncisco 2811LAXIUSHUI-R2811-1#sho runBuilding configuration...Current configuration : 3511 bytes!version 12.4no service padservice timestamps debug datetime msecservice timestamps log datetime msecservice password-encryption!hostname LAXIUSHUI-R2811-1!boot-start-markerboot-end-marker!card type e1 0 1logging message-counter syslogenable secret 5 $1$0LKz$71.irTxS.bL56D.GD74lD/!no aaa new-modelclock timezone CST 8no network-clock-participate wic 1!dot11 syslogno ip source-routeno ip gratuitous-arps!!ip cefip vrf nrtrd 2406:2route-target export 30033:14route-target import 30033:2route-target import 30033:12!ip vrf realtimerd 2406:1route-target export 30033:13route-target import 30033:1route-target import 30033:11!!!no ipv6 cef!multilink bundle-name authenticated !!!!!!!!!!!!!!!!!!!!!!!voice-card 0!!!!!archivelog confighidekeys!!!!!controller E1 0/1/0framing NO-CRC4clock source internalchannel-group 0 timeslots 1-31!controller E1 0/1/1framing NO-CRC4clock source internalchannel-group 0 timeslots 1-31!!!!!interface Loopback0ip address 33.10.191.131 255.255.255.255 !interface FastEthernet0/0ip address 192.168.1.1 255.255.255.0 duplex autospeed auto!interface FastEthernet0/1no ip addressshutdownduplex autospeed auto!interface FastEthernet0/0/0description ***TO LAXIUSHUI-C2918-01 G0/24*** switchport mode trunk!interface FastEthernet0/0/1description ***TO LAXIUSHUI-C2918-02 G0/24*** switchport mode trunk!interface FastEthernet0/0/2!interface FastEthernet0/0/3!interface Serial0/1/0:0description ***TO LINAN-NE20-A ....***ip address 33.10.177.218 255.255.255.252 encapsulation pppmpls ip!interface Serial0/1/1:0description ***TO LINAN-NE20-B ....***ip address 33.10.226.218 255.255.255.252 encapsulation pppmpls ip!interface Vlan1no ip address!interface Vlan10ip vrf forwarding realtimeip address 33.10.234.97 255.255.255.248!interface Vlan20ip vrf forwarding nrtip address 33.10.234.105 255.255.255.248!interface Vlan30description management-realtimeip vrf forwarding realtimeip address 33.10.185.218 255.255.255.252ip access-group 100 in!interface Vlan40description management-nrtip vrf forwarding nrtip address 33.10.189.218 255.255.255.252!router ospf 1router-id 33.10.191.131log-adjacency-changesnetwork 33.10.177.216 0.0.0.3 area 21 network 33.10.191.131 0.0.0.0 area 21 network 33.10.226.216 0.0.0.3 area 21 !router bgp 30033bgp router-id 33.10.191.131no bgp default ipv4-unicastbgp log-neighbor-changesneighbor 500 peer-groupneighbor 500 remote-as 30033 neighbor 500 update-source Loopback0 neighbor 33.10.191.11 peer-group 500 neighbor 33.10.191.12 peer-group 500 !address-family ipv4neighbor 33.10.191.11 activate neighbor 33.10.191.12 activateno auto-summaryno synchronizationexit-address-family!address-family vpnv4neighbor 500 send-community extended neighbor 33.10.191.11 activate neighbor 33.10.191.12 activateexit-address-family!address-family ipv4 vrf realtime redistribute connectedredistribute staticno synchronizationexit-address-family!address-family ipv4 vrf nrt redistribute connectedredistribute staticno synchronizationexit-address-family!ip forward-protocol ndno ip http serverno ip http secure-server!!!!!!!!!control-plane!!!!!!!!!!line con 0line aux 0line vty 0 4exec-timeout 5 0password 7 1511021F07257A767Blogin!scheduler allocate 20000 1000end正常情况下,按照上面的配置,网络是不会有问题的,但当天做完后,发现网络不通,经检查,发现cisco 2811中每个vrf中均上存在一条缺省路由,为bgp路由是指向NE20-A 的(优选router-ID小的),这条路由是正常的。
配置R2:interface Ethernet0ip address 23.23.23.2 255.255.255.0 interface Serial1ip address 24.24.24.2 255.255.255.0 router ripversion 2network 23.0.0.0no auto-summaryrouter bgp 123bgp router-id 2.2.2.2bgp cluster-id 3355443202bgp log-neighbor-changes neighbor 23.23.23.3 remote-as 123 neighbor 24.24.24.4 remote-as 140 R3:interface Ethernet0ip address 23.23.23.3 255.255.255.0 interface Serial1ip address 35.35.35.3 255.255.255.0 router ripversion 2network 23.0.0.0no auto-summaryrouter bgp 123no synchronizationbgp router-id 3.3.3.3bgp log-neighbor-changes neighbor 23.23.23.2 remote-as 123 neighbor 35.35.35.5 remote-as 150 no auto-summaryR4:interface Serial0ip address 24.24.24.4 255.255.255.0 router bgp 140bgp router-id 4.4.4.4bgp cluster-id 3355443203bgp log-neighbor-changes neighbor 24.24.24.2 remote-as 123 R5:interface Loopback0ip address 105.5.0.5 255.255.0.0 interface Serial0ip address 35.35.35.5 255.255.255.0 router bgp 150no synchronizationbgp router-id 5.5.5.5bgp log-neighbor-changes network 105.5.0.0 mask 255.255.0.0 neighbor 35.35.35.3 remote-as 123no auto-summary此时的实验结果为:R5#show ip bgpBGP table version is 2, local router ID is 5.5.5.5Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incompleteNetwork Next Hop MetricLocPrf Weight Path*> 105.5.0.0/16 0.0.0.0 0 32768 iR3#show ip bgpBGP table version is 2, local router ID is 3.3.3.3Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incompleteNetwork Next Hop Metric LocPrf Weight Path*> 105.5.0.0/16 35.35.35.5 0 0 150 iR2#show ip bgpBGP table version is 1, local router ID is 2.2.2.2Status codes: s suppressed, d damped, h history, * valid, > best, i - internalOrigin codes: i - IGP, e - EGP, ? - incompleteNetwork Next Hop MetricLocPrf Weight Path* i105.5.0.0/16 35.35.35.5 0 100 0 150 i此时在R2上的bgp路由并没有优化,原因为下一跳不可达。
【CCNP】BGP联盟配置案例版本V1.0密级☑开放☐内部☐机密类型☐讨论版☐测试版☑正式版1案例配置拓扑2案例配置需求1、如上图所示,IP地址规划方面,R2上有一环回接口loopback 200,地址为200.1.1.1/32,R5上有一环回接口loopback 100,地址为100.1.1.1/32,路由器互连的接口为172.8.AB.X/24(其中AB为路由器编号叠加,X为路由器编号,如R1连接R2的接口S0/0的地址为172.8.12.1/24)2、如图所示,联盟AS 100中有两个子AS,它们分别为AS 65501、AS 65502,配置R1与R2行成联盟iBGP邻居关系,R2与R3之间行成联盟eBGP邻居关系,R3与R4行成联盟iBGP邻居关系,R3与R5形成eBGP邻居关系,采用物理接口配置邻居建立;SPOTO 全球培训●项目●人才 1SPOTO 全球 培训 ● 项目 ● 人才2 3、 将R2的loopback 200、R5的loopback 100接口宣告到相应的BGP 中,观察联盟内部的特征;3 案例配置思路1、 R1上的关键配置:router bgp 65501 /联盟子AS/no synchronizationbgp log-neighbor-changesbgp confederation identifier 100 /指定对联盟外呈现的AS/ 雏鹰论坛CCNPneighbor 172.8.12.2 remote-as 65501no auto-summary2、 R2上的关键配置:router bgp 65501no synchronizationbgp log-neighbor-changesbgp confederation identifier 100bgp confederation peers 65502 /指定联盟内部eBGP 邻居关系的邻居AS/network 200.1.1.1 mask 255.255.255.255neighbor 172.8.12.1 remote-as 65501neighbor 172.8.23.3 remote-as 65502no auto-summary3、 R3上的关键配置:router bgp 65502no synchronizationbgp log-neighbor-changesbgp confederation identifier 100bgp confederation peers 65501neighbor 172.8.23.2 remote-as 65501neighbor 172.8.34.4 remote-as 65502neighbor 172.8.35.5 remote-as 200no auto-summary4、 R4上的关键配置:router bgp 65502SPOTO 全球 培训 ● 项目 ● 人才3 no synchronizationbgp log-neighbor-changesbgp confederation identifier 100neighbor 172.8.34.3 remote-as 65502no auto-summary5、 R5上的关键配置:router bgp 200no synchronizationbgp log-neighbor-changesnetwork 100.1.1.1 mask 255.255.255.255neighbor 172.8.35.3 remote-as 100no auto-summary4 案例检验结果1、 查看认证后BGP 邻居建立的情况:R5#show ip bgpBGP table version is 3, local router ID is 172.8.35.5Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP , e - EGP , ? - incompleteNetwork Next Hop Metric LocPrf Weight Path*> 100.1.1.1/32 0.0.0.0 0 32768 i*> 200.1.1.1/32 172.8.35.3 0 100 i/AS PATH 中不包含联盟内部的子AS/R3#show ip bgpBGP table version is 3, local router ID is 172.8.35.3Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP , e - EGP , ? - incomplete雏鹰论坛CCNPSPOTO 全球 培训 ● 项目 ● 人才4 Network Next Hop Metric LocPrf Weight Path*> 100.1.1.1/32 172.8.35.5 0 0 200 i*> 200.1.1.1/32 172.8.23.2 0 100 0 (65501) i/R3从R5学习到100.1.1.1/32,下一跳为172.8.35.5,从联盟AS 65501学习到了200.1.1.1/32,AS PATH 为(65501),括号()内的AS 不用来参与最短AS 比较,只是用来做防环/R4#show ip bgpBGP table version is 5, local router ID is 172.8.34.4Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP , e - EGP , ? - incompleteNetwork Next Hop Metric LocPrf Weight Path* i100.1.1.1/32 172.8.35.5 0 100 0 200 i* i200.1.1.1/32 172.8.23.2 0 100 0 (65501) i/下一跳不可达,所以不是最优路径/R2#show ip bgpBGP table version is 4, local router ID is 172.8.23.2Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP , e - EGP , ? - incompleteNetwork Next Hop Metric LocPrf Weight Path* 100.1.1.1/32 172.8.35.5 0 100 0 (65502) 200 i*> 200.1.1.1/32 0.0.0.0 0 32768 i/R2与R3在联盟内部是eBGP 的邻居关系,路由器从联盟外部的eBGP 邻居学习到的路由NEXT-HOP 属性在联盟内部予以保留并传递,Metric 属性在整个联盟予以保留,LocPrf 属性在整个联盟予以保留,而不是在分配它们成员的AS 内保留,R2由于下一跳172.8.35.5不可达,所以没有“>”,不是最佳路由/ 雏鹰论坛CCNPR1#show ip bgpBGP table version is 4, local router ID is 172.8.12.1SPOTO 全球 培训 ● 项目 ● 人才5 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP , e - EGP , ? - incompleteNetwork Next Hop Metric LocPrf Weight Path*>i200.1.1.1/32 172.8.12.2 0 100 0 i/R1没有学习到100.1.1.1/32的路由是因为R2关于这条的路由下一跳不可达,不是最优路径,所以不会发送给R1 /5 案例数据抓包1、 R2/R3为联盟eBGP 邻居,R3发送Update Message 给R2时携带如下属性:2、 R3/R5为eBGP 邻居,R5发送Update Message 给R3时携带如下属性:SPOTO 全球 培训 ● 项目 ● 人才66 案例配置文件7 案例总结及其它1、 iBGP 邻居并不把路由信息从一个iBGP 邻居传播到另外一个iBGP 邻居。
如果正在运行iBGP ,每个iBGP 的路由器必须与同一个其他iBGP 路由器建立连接。
随着iBGP 路由器的增多,这将变为一个规模问题。
N 个路由器的iBGP 连接的数目为[N(N-1)/2],所以在大型AS 中,一般采用BGP 联盟在AS 内部建立多个子AS ,让AS 内部拥有足够多的eBGP 邻居关系;2、 联盟EBGP 在某种程度上来讲,可以说是eBGP 和iBGP 的一种混合。
尤其是在联盟内部具有下面一些特性:在联盟内部保留联盟外部路由的Next Hop 属性;公布给联盟的路由的Metric 属性在整个联盟内予以保留;在路由的LocPrf 属性在整个联盟范围内予以保留,而不是在分配它们的成员AS 内保留;在联盟范围内,将成员自治系统的AS 号加入到AS PATH 中,但是并不将它们公布到联盟的范围以外;SPOTO 全球 培训 ● 项目 ● 人才7 AS PATH 中的联盟AS 号用于避免出现路由环路,但是当在联盟内选择一个最短的AS PATH 时,可以不用考虑联盟AS 号。
3、 对于子AS 的号码只在联盟AS 内部传递路由时添加到AS PATH 中,出联盟AS 时,这些子AS 号码不会写入AS PATH 中;4、 参见 欢迎来雏鹰论坛参与讨论。