关于BGP基本配置的方法

网络 路由交换
边界网关协议(BGP)是运行于 TCP 上的一种自治系统的路由协议。 BGP 是唯一一个用来处理像因特网大小的网络的协议,也是唯一能够妥善处理好不相关路由域间的多路连接的协议。

BGP

as100 as200

router a-------------------router b---------------------router c

s0:192.1.1.1/24 e0:193.1.1.3/24

s0:192.1.1.2/24 e0 193.1.1.2

//// router a ////

int lo0

ip addr 1.1.1.1 255.255.255.0

int s0/0

ip addr 192.1.1.1 255.255.255.0

clockrate 500000

router bgp 100

neighbor 192.1.1.2 remote-as 200 //指定邻居路由器和它所在的自治系统

//// router b ////

int lo0

ip addr 2.2.2.2 255.255.255.0

int e0/0

ip addr 193.1.1.2 255.255.255.0

int s0/0

ip addr 192.1.1.2 255.255.255.0

router bgp 200

neighbor 192.1.1.1 remote-as 100

neighbor 193.1.1.3 remote-as 200

//// router c ////

int lo0

ip addr 3.3.3.3 255.255.255.0

int e0/0

ip addr 193.1.1.3 255.255.255.0

router bgp 200

neighbor 193.1.1.2 remote-as 200

////监视和测试配置////

router a# show ip bgp neighbors

remote-as 200

bgp version 4,remote router id 2.2.2.2

bgp state = established

现在A将通过BGP向B通告路由1.0.0.0,必须满足2个条件:

1、通过使用network命令或redistribute,BGP进程必须能知道路由。

2、被通告路由必须在IP路由表中。

我们将在BGP进程下使用network命令。这个命令满足了***条,使得BGP进程知道路由。此network命令能使你更好控制从IGP重分布什么到BGP,并使用户能分别列出需经BGP通告的前缀。CISCO路由器能被配置的网络描述***数为200。如果有超过200个网络需要通告,那就需要动态重分布。

由于网络1.0.0.0是直接相连的网络,它存在于IP路由表中,故第二个条件满足。

显示A上的IP路由表。注意网络1.0.0.0在IP路由表中。

a# show ip route

C 1.0.0. is directly connected,loopback 0

no shynchronization

在路由器A上,在BGP进程下增加命令network 1.0.0.0

a# conf t

router bgp 100

netw 1.0.0.0

用show ip bgp显示B上的IP BGP表,network 1.0.0.0是通过192.1.1.1得到的

B# show ip bgp

network next-hop metric loca pref weight path

*>1.0.0.0 192.1.1.1 0 0 100 i

///// *表示有效,>表示***路由

b# show ip ro

B 1.0.0.0/8 [20/0] via 192.1.1.1, 00:12:02

用show ip bgp显示C上的IP BGP表,注意network 1.0.0.0出现在BGP表中,它的下一跳是192.1.1.1(未变),此路由是有效的(用*号标出),它是通过iBGP会话得到的,在网络号前加字母i表示了这一状态。

c# show ip bgp

network next-hop metric locprf weight path

* i1.0.0.0 192.1.1.1 0 0 100 i

C# show ip route

无1.0.0.0路由到网络1.0.0.0的路由不在IP路由表中有双重原因。

1、192.1.1.1不在C的路由表。而且下一跳地址是:从该处得到此路由的EBGP邻居的IP地址。当路由通过EBGP注入到AS中,从EBGP获得的下一跳被无改变地传送到IBGP中。

2、在缺省情况下BGP和IGP必须是同步的(因为网络1.0.0.0不是通过IGP得到的)。这意味着路由器B上的BGP知道的路由没有被重分布到IGP,这两者是不同步的。no synchronization

为解决***个问题:

B# router bgp 200

neighbor 193.1.1.3 next-hop-self

为解决第二个问题:

C# router bgp 200

责任编辑:林琳 来源: 新浪博客
相关推荐

2011-03-14 17:02:36

BGP

2010-06-18 15:03:12

BGP路由协议

2011-04-08 09:14:04

BGP

2011-04-08 09:26:53

BGP路由器

2011-04-08 09:27:06

路由反射器

2011-04-21 09:54:14

Linuxiptables

2009-07-16 16:47:22

jdk的配置Tomcat的配置eclipse与MyE

2009-12-09 10:26:51

静态路由协议配置

2011-08-23 09:54:26

路由BGP

2011-03-14 17:26:29

BGP

2009-11-25 14:56:43

2009-12-17 15:39:39

2010-03-16 12:11:03

无线UWB技术

2009-11-30 13:40:43

VS 2003 Boo

2016-12-15 08:38:50

1 Hibernate基本配置

2009-09-02 16:24:44

CCNP配置实验MPLS

2011-04-22 16:24:58

维修电脑

2010-08-03 17:26:13

NFS端口

2009-12-01 15:12:34

路由器配置VLAN

2010-05-24 18:07:34

SNMP命令
点赞
收藏

51CTO技术栈公众号