免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1289 | 回复: 0
打印 上一主题 下一主题

Configuring BGP Using Loopback Addresses [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-15 19:22 |只看该作者 |倒序浏览
实验目的:
1、掌握基于回环口的BGP的邻居关系建立的配置方法。
2、理解需要使用回环口为目的。

实验拓扑图:


实验步骤及要求:
1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。
2、配置AS 64512自治系统的RIPv2路由协议。
R1(config)#router rip
R1(config-router)#network 172.16.0.0
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#exit

R2(config)#router rip
R2(config-router)#no auto-summary
R2(config-router)#version 2
R2(config-router)#network 172.16.0.0
R2(config-router)#exit
3、首先在R1和R2上使用回环口创建邻居关系,配置如下:
R1(config)#router bgp 64512
R1(config-router)#network 172.16.0.0 mask 255.255.255.0
R1(config-router)#network 172.16.1.0 mask 255.255.255.0
R1(config-router)#neighbor 172.16.16.1 remote-as 64512
[stanley1]

R1(config-router)#exit

R2(config)#router bgp 64512
R2(config-router)#network 172.16.255.0 mask 255.255.255.252
R2(config-router)#network 10.1.255.0 mask 255.255.255.252
R2(config-router)#
R2(config-router)#neighbor 172.16.0.1 remote-as 64512
[stanley2]

R2(config-router)#exit
4、由于BGP在创建对等体时,需要时间较长。所以,需要等待一段时间。然后再查看R1和R2的BGP Summary信息。
R1#show ip bgp summary

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
172.16.16.1     4 64512       0       0        0    0    0 never    Active
[stanley3]

R1#

R2#show ip bgp summary

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
172.16.0.1      4 64512       0       0        0    0    0 never    Active
R2#
5、在R1路由器开启对BGP的调试:
R1#debug ip bgp in
[stanley4]

*Mar 30 11:42:34.607: BGP: 172.16.16.1 multihop open delayed 19731ms (no route)
*Mar 30 11:42:54.339: BGP: 172.16.16.1 multihop open delayed 17735ms (no route)
*Mar 30 11:43:12.075: BGP: 172.16.16.1 multihop open delayed 17459ms (no route)
*Mar 30 11:43:29.535: BGP: 172.16.16.1 multihop open delayed 14687ms (no route)
[stanley5]

6、由于R1和R2是同一个自治系统,所以我们使用RIPv2协议来解决路由不可达的问题,同时还要在BGP协议中指出使用回环口配置邻居关系,具体配置如下:
R1(config)#router rip
R1(config-router)#version 2
[stanley6]

R1(config-router)#no auto-summary
R1(config-router)#
R1(config-router)#network 172.16.0.0
R1(config-router)#exit
R1(config)#
R1(config)#router bgp 64512
R1(config-router)#neighbor 172.16.16.1 update-source loopback 0
[stanley7]

R1(config-router)#exit

R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#network 172.16.0.0
R2(config-router)#exit
R2(config)#
R2(config)#router bgp 64512
R2(config-router)#neighbor 172.16.0.1 update-source loopback 0
R2(config-router)#exit
7、稍等片刻或是直接clear ip bgp *后,再次查看R1的BGP summary信息:
R1#sh ip bgp summary
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
172.16.16.1     4 64512       5       5        6    0    0 00:00:20        2
[stanley8]

R1#
8、再次配置R2与R3使用回环口创建eBGP邻居关系:
R2(config)#router bgp 64512
R2(config-router)#neighbor 192.168.0.1 remote-as 64513
R2(config-router)#neighbor 192.168.0.1 update-source loopback 0
R2(config-router)#neighbor 192.168.0.1 ebgp-multihop 2
[stanley9]

R2(config-router)#exit
R2(config)#ip route 192.168.0.1 255.255.255.255 10.1.255.2
[stanley10]


R3(config)#router bgp 64513
R3(config-router)#neighbor 172.16.16.1 remote-as 64512
R3(config-router)#neighbor 172.16.16.1 update-source loopback 0
R3(config-router)#neighbor 172.16.16.1 ebgp-multihop 2
R3(config-router)#
R3(config-router)#network 192.168.0.0
R3(config-router)#network 192.168.1.0
R3(config-router)#network 10.1.255.0 mask 255.255.255.252
R3(config-router)#exit
R3(config)#ip route 172.16.16.1 255.255.255.255 10.1.255.1
9、在R2上观察BGP的邻居关系状态:
R2#show ip bgp summary
Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
172.16.0.1      4 64512      19      20        9    0    0 00:14:11        2
192.168.0.1     4 64513       5       6        9    0    0 00:00:10        3
[stanley11]

R2#
10、实验完成。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/99768/showart_1997395.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP