IBGP EBGP基本配置.docx_第1页
IBGP EBGP基本配置.docx_第2页
IBGP EBGP基本配置.docx_第3页
IBGP EBGP基本配置.docx_第4页
IBGP EBGP基本配置.docx_第5页
已阅读5页,还剩9页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

IBGP EBGP基本配置一、 路由器基本配置R1enableR1#conf tR1(config)#int lo 0R1(config-if)#ip add 1.1.1.1 255.255.255.0R1(config-if)#exitR1(config)#int s0/0R1(config-if)#ip add 12.12.12.1 255.255.255.0R1(config-if)#clock rate 128000R1(config-if)#no shutdownR1(config-if)#endR1#R2enableR2#conf tR2(config)#int lo 0R2(config-if)#ip add 2.2.2.2 255.255.255.0R2(config-if)#exitR2(config)#int s0/0R2(config-if)#ip add 12.12.12.2 255.255.255.0R2(config-if)#no shutdownR2(config-if)#exitR2(config)#int s0/1R2(config-if)#ip add 23.23.23.1 255.255.255.0R2(config-if)#clock rate 128000R2(config-if)#no shutdownR2(config-if)#exitR2(config)#R3enableR3#conf tR3(config)#int lo 0R3(config-if)#ip add 3.3.3.3 255.255.255.0R3(config-if)#exitR3(config)#int s0/0R3(config-if)#ip add 23.23.23.2 255.255.255.0R3(config-if)#no shutdownR3(config-if)#exitR3(config)#int s0/1R3(config-if)#ip add 34.34.34.1 255.255.255.0R3(config-if)#clock rate 128000R3(config-if)#no shutdownR3(config-if)#exitR3(config)#R4enableR4#conf tR4(config)#int s0/0R4(config-if)#ip add 34.34.34.2 255.255.255.0R4(config-if)#no shutdownR4(config-if)#exitR4(config)#int lo 0R4(config-if)#ip add 4.4.0.4 255.255.255.0R4(config-if)#exitR4(config)#int lo 1R4(config-if)#ip add 4.4.1.4 255.255.255.0R4(config-if)#exitR4(config)#int lo 2R4(config-if)#ip add 4.4.2.4 255.255.255.0R4(config-if)#exitR4(config)#int lo 3R4(config-if)#ip add 4.4.3.4 255.255.255.0R4(config-if)#exitR4(config)#int lo 4R4(config-if)#ip add 4.4.4.4 255.255.255.0R4(config-if)#exit二、 对路由器进行配置R1#conf tR1(config)#router eigrp 1R1(config-router)#net 1.1.1.0R1(config-router)#net 12.12.12.0R1(config-router)#no auto-summaryR1(config-router)#exitR1(config)#router bgp 100 /启动BGP进程R1(config-router)#no synchronization /关闭同步R1(config-router)#bgp router-id 1.1.1.1 /配置BGP路由器IDR1(config-router)#neighbor 2.2.2.2 remote-as 100 /指定邻居路由器及所在的ASR1(config-router)#neighbor 2.2.2.2 update-source lo 0 /制定更新源R1(config-router)#neighbor 3.3.3.3 remote-as 100R1(config-router)#neighbor 3.3.3.3 update-source lo 0R1(config-router)#net 1.1.1.0 mask 255.255.255.0 /通告网络R1(config-router)#no auto-summary /关闭自动汇总R1(config-router)#endR1#R2#conf tR2(config)#router eigrp 1R2(config-router)#net 23.23.23.0R2(config-router)#net 2.2.2.0R2(config-router)#net 12.12.12.0R2(config-router)#no auto-summaryR2(config)#router bgp 100R2(config-router)#bgp router-id 2.2.2.2R2(config-router)#neighbor 1.1.1.1 remote-as 100R2(config-router)#neighbor 1.1.1.1 update-source lo 0R2(config-router)#neighbor 3.3.3.3 remote-as 100R2(config-router)#neighbor 3.3.3.3 update-source lo 0R2(config-router)#no auto-summaryR2(config-router)#exitR2(config)#exitR3#conf tR3(config)#router eigrp 1R3(config-router)#net 3.3.3.0R3(config-router)#net 23.23.23.0R3(config-router)#no auto-summaryR3(config-router)#exitR3(config)#router bgp 100R3(config-router)#no synchronizationR3(config-router)#bgp router-id 3.3.3.3R3(config-router)#neighbor 1.1.1.1 remote-as 100R3(config-router)#neighbor 1.1.1.1 update-source lo 0R3(config-router)#neighbor 1.1.1.1 next-hop-self/配置下一跳自我,即对从EBGP邻居传入的路由,在通告给IBGP邻居的同时,强迫路由器通告自己是发送BGP更新的下一跳,而不是EBGP邻居。R3(config-router)#neighbor 2.2.2.2 update-source lo 0R3(config-router)#neighbor 2.2.2.2 next-hop-selfR3(config-router)#neighbor 34.34.34.2 remote-as 200R3(config-router)#no auto-summaryR3(config-router)#endR3#R4#conf tR4(config)#router bgp 200R4(config-router)#no synchronizationR4(config-router)#bgp router-id 4.4.4.4R4(config-router)#neighbor 34.34.34.3 remote-as 100R4(config-router)#no auto-summaryR4(config-router)#net 4.4.4.4 mask 255.255.255.0R4(config-router)#net 4.4.4.0 mask 255.255.255.0R4(config-router)#net 4.4.1.0 mask 255.255.255.0R4(config-router)#net 4.4.2.0 mask 255.255.255.0R4(config-router)#net 4.4.3.0 mask 255.255.255.0R4(config-router)#net 4.4.0.0 mask 255.255.252.0 /用network做路由汇总通报R4(config-router)#exitR4(config)#ip route 4.4.0.0 255.255.252.0 null0R4(config)#exitR4#三、 查看路由表R1#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback0 2.0.0.0/24 is subnetted, 1 subnetsD 2.2.2.0 90/2297856 via 12.12.12.2, 00:32:55, Serial0/0 3.0.0.0/24 is subnetted, 1 subnetsD 3.3.3.0 90/2809856 via 12.12.12.2, 00:29:03, Serial0/0 4.0.0.0/8 is variably subnetted, 5 subnets, 2 masksB 4.4.0.0/22 200/0 via 3.3.3.3, 00:08:14B 4.4.1.0/24 200/0 via 3.3.3.3, 00:08:14B 4.4.2.0/24 200/0 via 3.3.3.3, 00:08:14B 4.4.3.0/24 200/0 via 3.3.3.3, 00:08:14B 4.4.4.0/24 200/0 via 3.3.3.3, 00:08:14 23.0.0.0/24 is subnetted, 1 subnetsD 23.23.23.0 90/2681856 via 12.12.12.2, 00:32:56, Serial0/0 12.0.0.0/24 is subnetted, 1 subnetsC 12.12.12.0 is directly connected, Serial0/0R1#R2#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnetsD 1.1.1.0 90/2297856 via 12.12.12.1, 00:33:07, Serial0/0 2.0.0.0/24 is subnetted, 1 subnetsC 2.2.2.0 is directly connected, Loopback0 3.0.0.0/24 is subnetted, 1 subnetsD 3.3.3.0 90/2297856 via 23.23.23.2, 00:29:14, Serial0/1 4.0.0.0/8 is variably subnetted, 5 subnets, 2 masksB 4.4.0.0/22 200/0 via 3.3.3.3, 00:08:25B 4.4.1.0/24 200/0 via 3.3.3.3, 00:08:25B 4.4.2.0/24 200/0 via 3.3.3.3, 00:08:25B 4.4.3.0/24 200/0 via 3.3.3.3, 00:08:25B 4.4.4.0/24 200/0 via 3.3.3.3, 00:08:25 23.0.0.0/24 is subnetted, 1 subnetsC 23.23.23.0 is directly connected, Serial0/1 12.0.0.0/24 is subnetted, 1 subnetsC 12.12.12.0 is directly connected, Serial0/0R2#R3#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not set 34.0.0.0/24 is subnetted, 1 subnetsC 34.34.34.0 is directly connected, Serial0/1 1.0.0.0/24 is subnetted, 1 subnetsD 1.1.1.0 90/2809856 via 23.23.23.1, 00:29:33, Serial0/0 2.0.0.0/24 is subnetted, 1 subnetsD 2.2.2.0 90/2297856 via 23.23.23.1, 00:29:33, Serial0/0 3.0.0.0/24 is subnetted, 1 subnetsC 3.3.3.0 is directly connected, Loopback0 4.0.0.0/8 is variably subnetted, 5 subnets, 2 masksB 4.4.0.0/22 20/0 via 34.34.34.2, 00:08:42B 4.4.1.0/24 20/0 via 34.34.34.2, 00:08:42B 4.4.2.0/24 20/0 via 34.34.34.2, 00:08:42B 4.4.3.0/24 20/0 via 34.34.34.2, 00:08:42B 4.4.4.0/24 20/0 via 34.34.34.2, 00:08:43 23.0.0.0/24 is subnetted, 1 subnetsC 23.23.23.0 is directly connected, Serial0/0 12.0.0.0/24 is subnetted, 1 subnetsD 12.12.12.0 90/2681856 via 23.23.23.1, 00:29:35, Serial0/0R3#R4#sh ip int bri*Mar 1 01:04:48.007: %SYS-5-CONFIG_I: Configured from console by consoleR4#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not set 34.0.0.0/24 is subnetted, 1 subnetsC 34.34.34.0 is directly connected, Serial0/0 1.0.0.0/24 is subnetted, 1 subnetsB 1.1.1.0 20/0 via 34.34.34.1, 00:08:59 4.0.0.0/8 is variably subnetted, 6 subnets, 2 masksC 4.4.0.0/24 is directly connected, Loopback0S 4.4.0.0/22 is directly connected, Null0C 4.4.1.0/24 is directly connected, Loopback1C 4.4.2.0/24 is directly connected, Loopback2C 4.4.3.0/24 is directly connected, Loopback3C 4.4.4.0/24 is directly connected, Loopback4R4#四、 测试连通性R1#ping 4.4.4.4Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:.Success rate is 0 percent (0/5)R1#ping 4.4.4.4 source 1.1.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:Packet sent with a source address of 1.1.1.1!Success rate is 100 percent (5/5), round-trip min/avg/max = 92/100/124 msR1#五、 检测R3#sh tcp briefTCB Local Address Foreign Address (state)644D1A4C 3.3.3.3.179 1.1.1.1.11003 ESTAB6503880C 3.3.3.3.11000 2.2.2.2.179 ESTAB644D7698 34.34.34.1.179 34.34.34.2.11006 ESTABR3#R3#sh ip bgp neighbors 34.34.34.2BGP neighbor is 34.34.34.2, remote AS 200, external link BGP version 4, remote router ID 4.4.4.4 BGP state = Established, up for 00:15:06 Last read 00:00:06, hold time is 180, keepalive interval is 60 seconds Neighbor capabilities: Route refresh: advertised and received(old & new) Address family IPv4 Unicast: advertised and received Message statistics: InQ depth is 0 OutQ depth is 0 Sent Rcvd Opens: 1 1 Notifications: 0 0 Updates: 1 2 Keepalives: 18 18 Route Refresh: 0 0 Total: 20 21 Default minimum time between advertisement runs is 30 seconds For address family: IPv4 Unicast BGP table version 8, neighbor version 8/0 Output queue sizes : 0 self, 0 replicated Index 2, Offset 0, Mask 0x4 2 update-group member Sent Rcvd Prefix activity: - - Prefixes Current: 1 5 (Consumes 240 bytes) Prefixes Total: 1 5 Implicit Withdraw: 0 0 Explicit Withdraw: 0 0 Used as bestpath: n/a 5 Used as multipath: n/a 0 Outbound Inbound Local Policy Denied Prefixes: - - AS_PATH loop: n/a 1 Bestpath from this peer: 5 n/a Total: 5 1 Number of NLRIs in the update sent: max 0, min 0 Connections established 1; dropped 0 Last reset neverConnection state is ESTAB, I/O status: 1, unread input bytes: 0Connection is ECN DisabledLocal host: 34.34.34.1, Local port: 179Foreign host: 34.34.34.2, Foreign port: 11006Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)Event Timers (current time is 0x410E3C):Timer Starts Wakeups NextRetrans 18 0 0x0TimeWait 0 0 0x0AckHold 18 1 0x0SendWnd 0 0 0x0KeepAlive 0 0 0x0GiveUp 0 0 0x0PmtuAger 0 0 0x0DeadWait 0 0 0x0iss: 405608279 snduna: 405608712 sndnxt: 405608712 sndwnd: 15952irs: 3985095617 rcvnxt: 3985096120 rcvwnd: 15882 delrcvwnd: 502SRTT: 273 ms, RTTO: 490 ms, RTV: 217 ms, KRTT: 0 msminRTT: 44 ms, maxRTT: 300 ms, ACK hold: 200 msFlags: passive open, nagle, gen tcbsIP Precedence value : 6Datagrams (max data segment is 1460 bytes):Rcvd: 37 (out of order: 0), with data: 19, total data bytes: 502Sent: 19 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 17, total data bytes: 432R3#R3#sh ip bgp summaryBGP router identifier 3.3.3.3, local AS number 100BGP table version is 8, main routing table version 86 network entries using 702 bytes of memory6 path entries using 288 bytes of memory3/2 BGP path/bestpath attribute entries using 348 bytes of memory1 BGP AS-PATH entries using 24 bytes of memory0 BGP route-map cache entries using 0 bytes of memory0 BGP filter-list cache entries using 0 bytes of memoryBGP using 1362 total bytes of memoryBGP activity 6/0 prefixes, 6/0 paths, scan interval 60 secsNeighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd1.1.1.1 4 100 39 39 8 0 0 00:34:45 12.2.2.2 4 100 37 38 8 0 0 00:33:02 034.34.34.2 4 200 21 20 8 0 0 00:15:58 5R3#R3#sh ip bgpBGP table version is 8, 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, ? - incomplete Network Next Hop Metric LocPrf Weight Pathri1.1.1.0/24 1.1.1.1 0 100 0 i* 4.4.0.0/22 34.34.34.2 0 0 200 i* 4.4.1.0/24 34.34.34.2 0 0 200 i* 4.4.2.0/24 34.34.34.2 0 0 200 i* 4.4.3.0/24 34.34.34.2 0 0 200 i* 4.4.4.0/24 34.34.34.2 0 0 200 iR3#六、在R1上打开BGP同步,然后查看BGP表R1#sh ip bgpBGP table version is 7, local router ID is 1.1.1.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 1.1.1.0/24 0.0.0.0 0 32768 i*i4.4.0.0/22 3.3.3.3 0 100 0 200 i*i4.4.1.0/24 3.3.3.3 0 100 0 200 i*i4.4.2.0/24 3.3.3.3 0 100 0 200 i*i4.4.3.0/24 3.3.3.3 0 100 0 200 i*i4.4.4.0/24 3.3.3.3 0 100 0 200 iR1#R1#conf tR1(config)#router bgp 100R1(config-router)#synchronizationR1#clear ip bgp *R1#sh ip bgpBGP table version is 1, local router ID is 1.1.1.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i4.4.0.0/22 3.3.3.3 0 100 0 200 i* i4.4.1.0/24 3.3.3.3 0 100 0 200 i* i4.4.2.0/24 3.3.3.3 0 100 0 200 i* i4.4.3.0/24 3.3.3.3 0 100 0 200 i* i4.4.4.0/24 3.3.3.3 0 100 0 200 iR1#注:前后对比。六、 删除邻居关系再次查看R1#conf tR1(config)#router bgp 100R1(config-router)#no neighbor 3.3.3.3R1(config-router)#exitR1(config)#exitR3#conf tR3(config)#router bgp 100R3(config-router)#no neighbor 1.1.1.1R3(config-router)#exitR3(config)#七、各路由器上的情况R1#sh ip bgpBGP table version is 12, local router ID is 1.1.1.1Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* 1.1.1.0/24 0.0.0.0 0 32768 iR1#ping 4.4.4.4 source 1.1.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:Packet sent with a source address of 1.1.1.1.Success rate is 0 percent (0/5)R1#R2#sh ip bgpBGP table version is 14, local router ID is 2.2.2.2Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Pathri1.1.1.0/24 1.1.1.1 0 100 0 i*i4.4.0.0/22 3.3.3.3 0 100 0 2

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论