cisco bgp 典型配置 cisco路由器怎么配置BGP

思科cisco是全世界领先且顶尖的通讯厂商,他出产的路由器功能也是很出色的,那么你知道cisco路由器怎么配置BGP吗?下面是小编整理的一些关于cisco路由器怎么配置BGP的相关资料,供你参考。

cisco路由器配置BGP的案例如下:

在RA上启动BGP AS 100, 在RB,RC,RD上启动BGP AS200;并在AS 200 中启动OSPF。

实验要求:

1 AB,BC,CD之间分别建立EBGP,IBGP,IBGP 邻接关系。

2 通过BGP宣告A,B,C上的3个虚拟接口。要求所有路由器都能通过 sh ip bgp 看到这些虚拟接口。(将RC设为路由反射器)

3 要求所有路由器都有全部网络的路由信息

**************************************************************************************

一 基本配置

RA#sh run

!

!interface Loopback0

ip address 1.1.1.1 255.255.255.0

!

interface Serial0

ip address 192.1.1.1 255.255.255.0

!

router bgp 100

no synchronization

bgp log-neighbor-changes

network 1.1.1.0 mask 255.255.255.0

neighbor 192.1.1.2 remote-as 200

no auto-summary

!

RB#sh run

!

interface Loopback0

ip address 2.2.2.2 255.255.255.0

!

interface Ethernet0

ip address 193.1.1.1 255.255.255.0

!

interface Serial0

ip address 192.1.1.2 255.255.255.0

clockrate 64000

!

router ospf 1 //在RB上启动OSPF

network 0.0.0.0 255.255.255.255 area 0 //宣告所有与RB相连的网络

!

router bgp 200

no synchronization

network 2.2.2.0 mask 255.255.255.0

neighbor 192.1.1.1 remote-as 100

neighbor 193.1.1.2 remote-as 200

no auto-summary

!

RC#sh run

!

interface Loopback0

ip address 3.3.3.3 255.255.255.0

!

interface Ethernet0

ip address 193.1.1.2 255.255.255.0

!

interface Serial0

ip address 194.1.1.1 255.255.255.0

clock rate 64000

!

router ospf 1

log-adjacency-changes

network 0.0.0.0 255.255.255.255 area 0 // 同RB

!

router bgp 200

no synchronization

bgp log-neighbor-changes

network 3.3.3.0 mask 255.255.255.0

neighbor 193.1.1.1 remote-as 200

neighbor 194.1.1.2 remote-as 200

no auto-summary

!

RD#sh run

interface Serial0

ip address 194.1.1.2 255.255.255.0

!

router ospf 1 //同RB

log-adjacency-changes

network 0.0.0.0 255.255.255.255 area 0

!

router bgp 200

no synchronization

bgp log-neighbor-changes

neighbor 194.1.1.1 remote-as 200

no auto-summary

二 检查BGP

RA#sh ip bgp

Network Next Hop Metric LocPrf Weight Path

*> 1.1.1.0/24 0.0.0.0 0 32768 i

*> 2.2.2.0/24 192.1.1.2 0 0 200 i

*> 3.3.3.0/24 192.1.1.2 0 200 i

可以看到RA已经通过BGP学习到了各个虚拟接口,这两条路由下一跳均为192.1.1.2。这里需指出当AS边界路由器通过EBGP转发路由信息时,总是将这些路由信息的下一跳设定为自己。

***************************************************

RB#sh ip bgp

Network Next Hop Metric LocPrf Weight Path

*> 1.1.1.0/24 192.1.1.1 0 0 100 i

*> 2.2.2.0/24 0.0.0.0 0 32768 i

*>i3.3.3.0/24 193.1.1.2 0 100 0 i

可以看到RB也学习到了这些虚拟接口

***************************************************

RC#sh ip bgp

Network Next Hop Metric LocPrf Weight Path

*>i1.1.1.0/24 192.1.1.1 0 100 0 100 i

*>i2.2.2.0/24 193.1.1.1 0 100 0 i

*> 3.3.3.0/24 0.0.0.0 0 32768 i

RC也学习到了这些路由

****************************************************

RD#sh ip bgp

Network Next Hop Metric LocPrf Weight Path

*>i3.3.3.0/24 194.1.1.1 0 100 0 i

我们注意到这时RD并没有学习到1.1.1.0/24和2.2.2.0/24两个网段。这是因为在一个BGP域中,RC并不会将它通过RB学习到的路由转发给RD。这是我们需要将RC配置成路由反射器。配置如下:

RC(config)# router bgp 200

RC(config)#neighbor 193.1.1.1 route-reflector-client

RC(config)#neighbor 194.1.1.2 route-reflector-client

这两条命令是将RB和RD设为RC的路由反射器客户端

我们再次在RD上进行验证,之前用 clear ip bgp * 重启BGP进程,稍等一会儿在RD上进行查看;

RD#sh ip bgp

Network Next Hop Metric LocPrf Weight Path

*>i1.1.1.0/24 192.1.1.1 0 100 0 100 i

*>i2.2.2.0/24 193.1.1.1 0 100 0 i

*>i3.3.3.0/24 194.1.1.1 0 100 0 i

这时RD已经学习到了所有的虚拟接口,至此我们的路由反射器配置成功。下面我们将通过查看路由表来追踪这些路由信息。在这之前我们再次进入所有路由器的 BGP进程,输入: no synchronization 来取消BGP与IGP的同步关系,使得IGP能学到BGP中的路由信息,再次 clearip bgp * 和 clear ip route * 稍等片刻,等待BGP邻接关系再次建立后,我们在RB,RC,RD 分别用 sh iproute 就都能得到完整的路由信息了。以RC为例;

RC#sh ip route

Gateway of last resort is not set

1.0.0.0/24 is subnetted, 1 subnets

B 1.1.1.0 [200/0] via 192.1.1.1, 02:08:19

2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

O 2.2.2.2/32 [110/11] via 193.1.1.1, 02:08:58, Ethernet0

B 2.2.2.0/24 [200/0] via 193.1.1.1, 02:08:43

cisco bgp 典型配置 cisco路由器怎么配置BGP

3.0.0.0/24 is subnetted, 1 subnets

C 3.3.3.0 is directly connected, Loopback0

C 193.1.1.0/24 is directly connected, Ethernet0

O 192.1.1.0/24 [110/74] via 193.1.1.1, 02:08:58, Ethernet0

C 194.1.1.0/24 is directly connected, Serial0

到现在为止,所有路由器的BGP表都已经完整,RB,RC,RD的IP路由表也已经完整,现在我们来看RA的路由表。

RA#sh ip route

Gateway of last resort is not set

1.0.0.0/24 is subnetted, 1 subnets

C 1.1.1.0 is directly connected, Loopback0

2.0.0.0/24 is subnetted, 1 subnets

B 2.2.2.0 [20/0] via 192.1.1.2, 02:18:43

3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

B 3.3.3.3/32 [20/11] via 192.1.1.2, 02:12:30

B 3.3.3.0/24 [20/0] via 192.1.1.2, 02:18:43

C 192.1.1.0/24 is directly connected, Serial0

我们可以看到在RA的路由表中并没有193.1.1.0/24和194.1.1.0/24这两个网段的路由,这是因为这两条路由是在AS200中通过OSPF发布的,因此R1当然无法学到。我们需要在AS边界路由器RB上将OSPF的路由信息重发布到BGP中;配置如下:

RB(config)#router bgp 200

RB(config)#redistribute ospf 1

再次来到RA中,

RA#sh ip route

Gateway of last resort is not set

1.0.0.0/24 is subnetted, 1 subnets

C 1.1.1.0 is directly connected, Loopback0

2.0.0.0/24 is subnetted, 1 subnets

B 2.2.2.0 [20/0] via 192.1.1.2, 02:26:51

3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks

B 3.3.3.3/32 [20/11] via 192.1.1.2, 02:20:39

B 3.3.3.0/24 [20/0] via 192.1.1.2, 02:26:51

B 193.1.1.0/24 [20/0] via 192.1.1.2, 02:20:38

C 192.1.1.0/24 is directly connected, Serial0

B 194.1.1.0/24 [20/74] via 192.1.1.2, 02:20:38

我们可以看到这两条路由已经被RA学习到了。

  

爱华网本文地址 » http://www.413yy.cn/a/230561/304443757.html

更多阅读

dlink无线路由器怎么设置密码 dlink无线路由器dir605

dlink无线路由器怎么设置密码——简介  许多人在购买路由器后不知道该如何设置,在接触dlink无线路由器配置方法的过程中,大家遇到了很多问题。今日就为大家详细讲解下dlink无线路由器怎么设置。并经整理成dlink无线路由器设置图文教

小米线刷详细图文教程 【图文教程】小米路由器怎么设置 精

【图文教程】小米路由器怎么设置 精――简介怎么对小米路由器进行设置呢?小米路由器作为智能家电控制的首选组网设备,已受到各位米份们的广泛关注和使用。小米路由器除了采用高硬件配置外,还具有“远程下载”、“急速上网”以及“智能

192.168.0.1路由器设置 腾达无线路由器怎么设置

腾达无线路由器怎么设置――简介本文以腾达系列无线路由器为例,主要给大家介绍下tenda无线路由器设置的过程,全文为图解过程,便于大家理解和掌握,重点介绍无线网络配置部分。 腾达无线路由器怎么设置――工具/原料腾达无线路由器 腾达

声明:《cisco bgp 典型配置 cisco路由器怎么配置BGP》为网友長情詴辠分享!如侵犯到您的合法权益请联系我们删除